[Bug 6118] New: merge can lead to conflicts on unchanged files when rename and rename back is involved

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Apr 15 18:38:29 UTC 2019


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

            Bug ID: 6118
           Summary: merge can lead to conflicts on unchanged files when
                    rename and rename back is involved
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: 7895pulkit at gmail.com
                CC: mercurial-devel at mercurial-scm.org

When there is rename and rename back involved, merge can lead to conflicts on
files which are not changed in current branch.

Steps to reproduce:

 $ hg init repo
 $ cd repo
 $ for ch in a b c d; do echo foo > $ch; hg ci -Aqm 'added '$ch; done;
 $ hg branch user1
 $ echo foo > foo
 $ hg ci -Aqm 'added foo'
 $ hg up default
 $ hg mv b x
 $ hg ci -m 'moved b to x'
 $ hg mv x b
 $ hg ci -m 'moved x to b'
 $ hg up user1
 $ hg merge default
 $ hg ci -m 'merge commit with default'

At this step, if you check filelog for file b, you will see that this merge
commit creates a new filelog.

 <create more commits on user1 branch>

  $ hg up default
  $ hg rm b
  $ hg ci -m 'removed b'
  $ hg up user1
  $ hg merge default

This will pop up saying file 'b' was delted in other rev but was modified in
local. But in the user1 branch, we didn't modified b at all.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list