Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
23425:2b1ffaaab01f | 23440:57d35d3c1cf1 |
---|---|
447 targetnode = repo[target].node() | 447 targetnode = repo[target].node() |
448 | 448 |
449 # restore original working directory | 449 # restore original working directory |
450 # (we do this before stripping) | 450 # (we do this before stripping) |
451 newwd = state.get(originalwd, originalwd) | 451 newwd = state.get(originalwd, originalwd) |
452 if newwd < 0: | |
453 # original directory is a parent of rebase set root or ignored | |
454 newwd = originalwd | |
452 if newwd not in [c.rev() for c in repo[None].parents()]: | 455 if newwd not in [c.rev() for c in repo[None].parents()]: |
453 ui.note(_("update back to initial working directory parent\n")) | 456 ui.note(_("update back to initial working directory parent\n")) |
454 hg.updaterepo(repo, newwd, False) | 457 hg.updaterepo(repo, newwd, False) |
455 | 458 |
456 if not keepf: | 459 if not keepf: |