Patchwork [Bug,5361] New: hg backout forgets renames for non-direct ancestors

login
register
mail settings
Submitter bugzilla@mercurial-scm.org
Date Sept. 6, 2016, 9:01 a.m.
Message ID <bug-5361-285@https.bz.mercurial-scm.org/>
Download mbox | patch
Permalink /patch/16563/
State Not Applicable
Headers show

Comments

bugzilla@mercurial-scm.org - Sept. 6, 2016, 9:01 a.m.
https://bz.mercurial-scm.org/show_bug.cgi?id=5361

            Bug ID: 5361
           Summary: hg backout forgets renames for non-direct ancestors
           Product: Mercurial
           Version: default branch
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: bug
          Priority: normal
         Component: Mercurial
          Assignee: bugzilla@selenic.com
          Reporter: jargon@molb.org
                CC: mercurial-devel@selenic.com

This is a continuation of Bug 3039: With recent versions of Mercurial (e.g.
3.8.4, 3.9.1 and 3.9+198-f148bfa40489), a backout of the most recent commit
preserves renames. However a single unrelated commit destroys this information.

Good:

$ hg init repo
$ cd repo
$ echo a > a
$ hg ci -Am adda
adding a
$ hg mv a b
$ hg ci -m moveab
$ hg backout -m backout tip
adding a
removing b
changeset 2:030c62140b54 backs out changeset 1:ec5932ef5cba
$ hg diff --git -c .

Patch

diff --git a/b b/a
rename from b
rename to a


Bad:

$ hg init repo
$ cd repo
$ echo a > a
$ hg ci -Am adda
adding a
$ hg mv a b
$ hg ci -m moveab
$ echo c > c
$ hg ci -Am addc
adding c
$ hg backout -m backout 1
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
changeset 3:2de33e2e7df1 backs out changeset 1:576d406e865d
$ hg diff --git -c .
diff --git a/a b/a
new file mode 100644
--- /dev/null
+++ b/a
@@ -0,0 +1,1 @@ 
+a
diff --git a/b b/b
deleted file mode 100644
--- a/b
+++ /dev/null
@@ -1,1 +0,0 @@ 
-a