[Bug 5350] New: Decide what to do when grafting changes to files that never existed on the target branch

bugzilla at mercurial-scm.org bugzilla at mercurial-scm.org
Fri Aug 26 12:04:22 UTC 2016


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

            Bug ID: 5350
           Summary: Decide what to do when grafting changes to files that
                    never existed on the target branch
           Product: Mercurial
           Version: 3.9
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: gabor.stefanik at nng.com
                CC: mercurial-devel at selenic.com
        Depends on: 4028

This is a followup to bug 4028.

Consider the following DAG:
A -> B -> C
 \-> D

B creates a file, that C modifies. We then graft or rebase C onto D.
A confusing prompt is thrown: "other [graft] changed file, which local [local]
deleted".

>From Hg's standpoint, this prompt makes sense, since it views the DAG like
this:
B -> C
 \-> A -> D

Since A->B is reversed, the file creation in A->B is treated as a deletion in
B->A.

However, the user doesn't see a graft/rebase as a "3-way merge in a rotated
DAG" (he may not even care about what DAGs or 3-way merges are), but as
"copying/moving a change to a new location". With this mindset, the prompt
makes no sense: the file was not deleted on the "local" side; instead it never
existed.

Furthermore, if the user chooses "keep changed", the restored filename doesn't
take directory renames into account.
That is, if the directory containing the new file is renamed either between A
and D, or between A and B, restoring the file will create a directory at the
location where the file is in B, rather than putting the restored file in the
corresponding directory in D.

It needs to be decided what to do in this case - should we keep the prompt
(reworded to avoid claiming a deletion that never was), and fix up directory
rename tracking, or just drop such changes automatically?


Referenced Bugs:

https://bz.mercurial-scm.org/show_bug.cgi?id=4028
[Bug 4028] Graft fails when files have been moved in an ancestor revision
-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list