Comments
Patch
@@ -447,10 +447,13 @@ def rebase(ui, repo, **opts):
targetnode = repo[target].node()
# restore original working directory
# (we do this before stripping)
newwd = state.get(originalwd, originalwd)
+ if newwd < 0:
+ # original directory is a parent of rebase set root or ignored
+ newwd = originalwd
if newwd not in [c.rev() for c in repo[None].parents()]:
ui.note(_("update back to initial working directory parent\n"))
hg.updaterepo(repo, newwd, False)
if not keepf:
@@ -298,12 +298,16 @@ Check rebasing public changeset
$ hg rebase -d 5 -b 6 --keep
Check rebasing mutable changeset
Source phase greater or equal to destination phase: new changeset get the phase of source:
+ $ hg id -n
+ 5
$ hg rebase -s9 -d0
saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-backup.hg (glob)
+ $ hg id -n # check we updated back to parent
+ 5
$ hg log --template "{phase}\n" -r 9
draft
$ hg rebase -s9 -d1
saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg (glob)
$ hg log --template "{phase}\n" -r 9