[Bug 6501] New: Rebase switches parent order of merge

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Tue Mar 23 21:31:49 UTC 2021


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

            Bug ID: 6501
           Summary: Rebase switches parent order of merge
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: rebase
          Assignee: bugzilla at mercurial-scm.org
          Reporter: me at manueljacob.de
                CC: mercurial-devel at mercurial-scm.org
    Python Version: ---

$ cat >> $HGRCPATH <<EOF
  > [extensions]
  > rebase =
  > [experimental]
  > evolution = all
  > EOF

  $ hg init
  $ touch test1 test2
  $ hg add test1 test2
  $ hg ci -m base
  $ echo left > test1
  $ hg ci -m left -q
  $ hg up 0 -q
  $ echo right1 > test2
  $ hg ci -m right1 -q
  $ hg up 0 -q
  $ echo right2 > test2
  $ hg ci -m right2 -q
  $ hg up 2 -q
  $ touch test3
  $ hg add test3
  $ hg ci -m right
  $ hg up 1 -q
  $ hg merge 4 -q
  $ hg ci -m merge
  $ hg log -G
  @    changeset:   5:fba4923e310a
  |\   tag:         tip
  | |  parent:      1:429ab2e55fe3
  | |  parent:      4:590a481a3fab
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     merge
  | |
  | o  changeset:   4:590a481a3fab
  | |  parent:      2:db5f9ff551fb
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     right
  | |
  | | o  changeset:   3:ea268a950081
  | | |  parent:      0:477af4eeb07e
  | | |  user:        test
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | | |  summary:     right2
  | | |
  | o |  changeset:   2:db5f9ff551fb
  | |/   parent:      0:477af4eeb07e
  | |    user:        test
  | |    date:        Thu Jan 01 00:00:00 1970 +0000
  | |    summary:     right1
  | |
  o |  changeset:   1:429ab2e55fe3
  |/   user:        test
  |    date:        Thu Jan 01 00:00:00 1970 +0000
  |    summary:     left
  |
  o  changeset:   0:477af4eeb07e
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     base

  $ hg rebase -d 3 -s 4
  rebasing 4:590a481a3fab "right"
  rebasing 5:fba4923e310a tip "merge"
  $ hg log -G
  @    changeset:   7:4244bf817b97
  |\   tag:         tip
  | |  parent:      6:5fe7af8712dd
  | |  parent:      1:429ab2e55fe3
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     merge
  | |
  | o  changeset:   6:5fe7af8712dd
  | |  parent:      3:ea268a950081
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     right
  | |
  | o  changeset:   3:ea268a950081
  | |  parent:      0:477af4eeb07e
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     right2
  | |
  | | o  changeset:   2:db5f9ff551fb
  | |/   parent:      0:477af4eeb07e
  | |    user:        test
  | |    date:        Thu Jan 01 00:00:00 1970 +0000
  | |    summary:     right1
  | |
  o |  changeset:   1:429ab2e55fe3
  |/   user:        test
  |    date:        Thu Jan 01 00:00:00 1970 +0000
  |    summary:     left
  |
  o  changeset:   0:477af4eeb07e
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     base

Before the rebase, "left" is the first parent and "right" is the second parent.
After the rebase, "right" is the first parent and "left" is the second parent,
while "left" should stay the first parent and "right" should stay the second
parent.

This is basically the same problem as
https://bz.mercurial-scm.org/show_bug.cgi?id=6141, but it is easier to add a
test for it since reproducing it does not depend on out-of-tree extensions.

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


More information about the Mercurial-devel mailing list