https://bz.mercurial-scm.org/show_bug.cgi?id=6971

            Bug ID: 6971
           Summary: Stabilizing orphan merge loses rename information
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: evolution
          Assignee: bugzi...@mercurial-scm.org
          Reporter: m...@manueljacob.de
                CC: mercurial-de...@mercurial-scm.org,
                    pierre-yves.da...@ens-lyon.org
    Python Version: ---

Set up a merge where one side renames a file to some name (in the example: "a"
and the other side creates a file with that name. The merge correctly tracks
the rename.

  $ echo foo > a
  $ hg add a
  $ hg ci -m 'add a'
  $ hg rename a b
  $ hg ci -m 'rename a to b'
  $ hg up null -q
  $ echo foo > b
  $ hg add b
  $ hg ci -m 'add b' -q
  $ hg up 1 -q
  $ hg merge 2 -q
  $ hg ci -m 'merge'
  $ hg glog
  @    3:1a91cc7b3612 merge
  |\    () draft
  | o  2:bca25efad6a1 add b
  |     () draft
  o  1:d1d01b9802bf rename a to b
  |   () draft
  o  0:f87d03aef498 add a
      () draft
  $ hg diff --git --from 0 --to 3
  diff --git a/a b/b
  rename from a
  rename to b

When the merge is rebased by the evolve command, it should keep tracking the
rename, but doesn’t. This creates the surprising situation where the diff from
B to C is empty, but the diff from A to B is different to the diff from A to C.

  $ hg touch 1
  1 new orphan changesets
  $ hg evolve -r 3
  move:[3] merge
  atop:[4] rename a to b
  working directory is now at 9e9bce9bfc72
  $ hg glog
  @    5:9e9bce9bfc72 merge
  |\    () draft
  | o  4:d9d30a981797 rename a to b
  | |   () draft
  o |  2:bca25efad6a1 add b
   /    () draft
  o  0:f87d03aef498 add a
      () draft
  $ hg diff --git --from 0 --to 4
  diff --git a/a b/b
  rename from a
  rename to b
  $ hg diff --git --from 4 --to 5
  $ hg diff --git --from 0 --to 5
  diff --git a/a b/a
  deleted file mode 100644
  --- a/a
  +++ /dev/null
  @@ -1,1 +0,0 @@
  -foo
  diff --git a/b b/b
  new file mode 100644
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +foo

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to