[Bug 6180] New: pruning while rebasing confuses rebase

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Fri Aug 2 10:14:27 EDT 2019


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

            Bug ID: 6180
           Summary: pruning while rebasing confuses rebase
           Product: Mercurial
           Version: 4.8
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: rebase
          Assignee: bugzilla at mercurial-scm.org
          Reporter: martinvonz at google.com
                CC: mercurial-devel at mercurial-scm.org

The test case below starts a rebase of 2 commits and runs into conflicts on the
first one. We then decide we don't want the changes from that commit, so we
revert the changes and also prune the original commit. When we continue the
rebase, the second commit is also pruned. Perhaps the evolve extension should
disallow `hg prune` during rebase, but it still seems like rebase should behave
better in this case.


  $ cat >> $HGRCPATH <<EOF
  > [experimental]
  > evolution.createmarkers=True
  > evolution.allowunstable=True
  >
  > [extensions]
  > rebase=
  >
  > [alias]
  > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
  > EOF

  $ hg init repo
  $ cd repo
  $ echo 0 > a
  $ hg ci -Aqm 'add a'
  $ echo 1 > a
  $ hg ci -m 'edit a'
  $ hg co -q 0
  $ echo 2 > a
  $ hg ci -qm 'conflict in a'
  $ echo 3 > b
  $ hg ci -Aqm 'add b'
  $ hg tglog
  @  3:draft 'add b'
  |
  o  2:draft 'conflict in a'
  |
  | o  1:draft 'edit a'
  |/
  o  0:draft 'add a'

  $ hg rebase -d 1
  rebasing 2:06a50ac6b5ab "conflict in a"
  merging a
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')      
  unresolved conflicts (see hg resolve, then hg rebase --continue)              
  [1]
  $ echo 1 > a
  $ hg debugobsolete $(hg id -ir 2 --debug)
  obsoleted 1 changesets
  1 new orphan changesets
  $ hg resolve -m
  (no more unresolved files)
  continue: hg rebase --continue
  $ hg rebase -c
  note: not rebasing 2:06a50ac6b5ab "conflict in a", it has no successor        
  rebasing 3:aea370672fd7 "add b" (tip)
  note: not rebasing 3:aea370672fd7 "add b" (tip), its destination already has
all its changes                            
  $ hg tglog
  @  1:draft 'edit a'
  |
  o  0:draft 'add a'

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


More information about the Mercurial-devel mailing list