Mercurial > public > mercurial-scm > hg-stable
diff hgext/rebase.py @ 23440:57d35d3c1cf1 stable
rebase: ignore negative state when updating back to original wc parent
The state mapping also contains some magic negative values (detached
parent, ignored revision). Blindly reading the state thus lead to
unfortunate usage of the negative value as an update destination. We
now filter them out.
We do a minor alteration of the test to catch this.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 02 Dec 2014 11:06:38 -0800 |
parents | 643c58303fb0 |
children | fc76f55705eb |
line wrap: on
line diff
--- a/hgext/rebase.py Mon Dec 01 18:51:10 2014 -0600 +++ b/hgext/rebase.py Tue Dec 02 11:06:38 2014 -0800 @@ -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)