[Bug 5973] New: Merge can fails to use descendant filenode over ancestors one

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Wed Aug 29 08:14:11 UTC 2018


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

            Bug ID: 5973
           Summary: Merge can fails to use descendant filenode over
                    ancestors one
           Product: Mercurial
           Version: earlier
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: lothiraldan at gmail.com
                CC: mercurial-devel at mercurial-scm.org

We have noticed cases where merged manifest replaces a filenode with one of its
ancestors. This is not supposed to happen since it produces a slightly buggy
history.

Redoing the same merge manually does not produce a faulty manifest so how to
reproduce the issue is unclear.

We initially noticed one occurrence in the private repository. However, a tool
to detect this at a wider scale revealed many more occurrences. We can spot
such buggy merge within every serious repository we looked at mercurial,
mozilla… etc. The occurrences are not localized in time and seem to be still
happening from time to time today.

For example, the first occurrence of this in the mercurial repository is
5e73dfe26ac1 (depth: 1687; date: 2006-02-03) It affects 5 files.

    5e73dfe26ac1 mercurial/changelog.py at 03be250163a1 not a descendant of
243d7f8d6ce4 (it is an ancestor)
    5e73dfe26ac1 mercurial/filelog.py at 80e3cd985743 not a descendant of
b19ace6ac92c (it is an ancestor)
    5e73dfe26ac1 mercurial/manifest.py at 0229e4efa726 not a descendant of
08af5a58aa45 (it is an ancestor)
    5e73dfe26ac1 mercurial/revlog.py at 03d6f352827a not a descendant of
2cbad71c6176 (it is an ancestor)
    5e73dfe26ac1 mercurial/statichttprepo.py at 45e1b2eddc09 not a descendant of
04aa8ad6b9e9 (it is an ancestor)

And the latest occurrence happens on 98e990bb7330 (depth: 33646 date:
2017-08-10)

    98e990bb7330 tests/test-pull.t at 99fa3b6f103b not a descendant of
3279510969cf (it is an ancestor)

Once the merge code has been confused once, it will never be able to fully
correct the error. Depending on the merge ancestors situation, the error will
be corrected or reintroduced over and over.

To search for this issues in a repository you can use the same tool as we did:

    $ hg clone https://bitbucket.org/octobus/octobus-misc
    $ hg --config
extensions.octotools=path/to/octobus-misc/hgext3rd/octotools.py
debuganalyzemerge


The full consequences of this are unclear:

* some `hg log FILE` call might be wrong,

* some copy tracing might be wrong,

* the eternal battle between branches with the right content and the one with
wrong content induces extra manifest churn.

* some linkrev adjustment might be wrong (or extra costly)

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


More information about the Mercurial-devel mailing list