# HG changeset patch # User Matt Mackall # Date 1417562360 21600 # Node ID fc76f55705eb5884707c977ecb756aee7c794676 # Parent e1086c7dd3c42f70fd347dd90742637f1579e364# Parent 57d35d3c1cf170513cc150c5021f5e3e0d7cdafb merge with stable diff -r e1086c7dd3c4 -r fc76f55705eb hgext/rebase.py --- a/hgext/rebase.py Tue Nov 18 22:18:05 2014 -0800 +++ b/hgext/rebase.py Tue Dec 02 17:19:20 2014 -0600 @@ -449,6 +449,9 @@ # 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) diff -r e1086c7dd3c4 -r fc76f55705eb tests/test-rebase-scenario-global.t --- a/tests/test-rebase-scenario-global.t Tue Nov 18 22:18:05 2014 -0800 +++ b/tests/test-rebase-scenario-global.t Tue Dec 02 17:19:20 2014 -0600 @@ -300,8 +300,12 @@ 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