[Bug 5665] New: Merge lost changes when a revert and re-landing occurred on p2

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Aug 21 16:27:35 UTC 2017


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

            Bug ID: 5665
           Summary: Merge lost changes when a revert and re-landing
                    occurred on p2
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: gregory.szorc at gmail.com
                CC: mercurial-devel at mercurial-scm.org

A merge on the Firefox repository lost changes to files when p2 ancestry
contained a revert and relanding.

STR:

1) hg clone https://hg.mozilla.org/mozilla-central
2) hg up 792d0a2e04d7
3) hg merge 0d1d26e7fa93

Expected results:

* State of files in 17e524a6c990 are in merged result

Actual results:

* State of files from 17e524a6c990 (e.g. dom/script/ScriptLoader.cpp) are lost
during the merge

The DAG looks like this:

$ hg log -G -r '17e524a6c990 + 792d0a2e04d7 + 70bd3854b6d0 + 548ed79f2337 +
732e73a9c657 + 20344f0dbff9 + 6f1914a4f241 + 0d1d26e7fa93' -T '{node|short}
{desc|firstline}'
o    6f1914a4f241 Merge inbound to central, a=merge
|\
| @  792d0a2e04d7 Bug 1386588 - Always print out the commands run by the clang
build job. r=gps,a=KWierso
@ :  0d1d26e7fa93 Bug 1386689 - disable non-e10s tests which are duplicated
with e10s jobs. r=gbrown
o :  17e524a6c990 Bug 1053321 - Correctly pass info about 'defer' and 'async'
attributes ...
o :  70bd3854b6d0 Backed out changeset 548ed79f2337 (bug 1053321) for strange
and ...
:/
o  548ed79f2337 Bug 1053321 - Correctly pass info about 'defer' and 'async'
attributes ...
o  732e73a9c657 Backed out changeset 20344f0dbff9 (bug 1053321) for ESLint
failures.
o  20344f0dbff9 Bug 1053321 - Correctly pass info about 'defer' and 'async'
attributes ...

p2 in this case is 0d1d26e7fa93. As we can see from the DAG, 70bd3854b6d0
(which reverted a previous version of 17e524a6c990) and 17e524a6c990 were both
on the p2 branch.

When we merge 0d1d26e7fa93 into 792d0a2e04d7, changes from 17e524a6c990 are
effectively lost. The final merge (6f1914a4f241 in the Firefox repo, which can
also be reproduced locally using 4.3) list e.g. dom/script/ScriptLoader.cpp as
modified by the merge. However, the file content of dom/script/ScriptLoader.cpp
is as follows:

o 6f1914a4f241 B
|\
o : 17e524a6c990 A
o : 70bd3854b6d0 B
:/
o 548ed79f2337 A
o 732e73a9c657 B
o 20344f0dbff9 A

I have no clue why the merge chose "B" as the final file content, since "B"
wasn't the file content of any of the parents to the merge.

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


More information about the Mercurial-devel mailing list