[Bug 6332] New: fold can create merge with ancestor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 6332] New: fold can create merge with ancestor

mercurial-bugs-2
https://bz.mercurial-scm.org/show_bug.cgi?id=6332

            Bug ID: 6332
           Summary: fold can create merge with ancestor
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Mac OS
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: evolution
          Assignee: [hidden email]
          Reporter: [hidden email]
                CC: [hidden email],
                    [hidden email]
    Python Version: ---

If you fold the merge commit with all the commits on one side, you'll get a
merge where one parent is an ancestor of the other. `hg merge` does not let you
do that, so it should probably be considered a bug that `hg fold` allows it.

The evolve tests did not detect the case because they used the null revision as
merge base, so the merge commit ended up having a commit and the null revision
as parents, which mercurial treats like a regular (non-merge) commit. If you
apply this diff:

```
diff --git a/tests/test-fold.t b/tests/test-fold.t
--- a/tests/test-fold.t
+++ b/tests/test-fold.t
@@ -316,9 +316,10 @@ One merge commit
   $ hg init fold-a-merge
   $ cd fold-a-merge

+  $ mkcommit root
   $ mkcommit zebra

-  $ hg up null
+  $ hg up 'desc("root")'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ mkcommit apple
   $ mkcommit banana
```

Then the tests will fail with this hunk (among others):

```
@@ -362,9 +366,11 @@
   2 changesets folded
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg glf
-  @  6: apple+banana+coconut is a child of zebra (apple banana coconut)
-  |
-  o  0: zebra (zebra)
+  @    7: apple+banana+coconut is a child of zebra (apple banana coconut)
+  |\
+  | o  1: zebra (zebra)
+  |/
+  o  0: root (root)
```

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel