Mercurial > public > mercurial-scm > hg
diff hgext/rebase.py @ 16280:0806823370d8 stable
rebase: properly calculate descendant set when aborting (issue3332)
Checking for descendants of target being public was also wrong.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 22 Mar 2012 17:47:00 -0500 |
parents | 5b41d5ad52bf |
children | b9f51f49bf2a |
line wrap: on
line diff
--- a/hgext/rebase.py Thu Mar 22 17:07:39 2012 -0500 +++ b/hgext/rebase.py Thu Mar 22 17:47:00 2012 -0500 @@ -557,15 +557,18 @@ def abort(repo, originalwd, target, state): 'Restore the repository to its original state' - descendants = repo.changelog.descendants - ispublic = lambda r: repo._phaserev[r] == phases.public - if filter(ispublic, descendants(target)): + dstates = [s for s in state.values() if s != nullrev] + if [d for d in dstates if not repo[d].mutable()]: repo.ui.warn(_("warning: immutable rebased changeset detected, " "can't abort\n")) return -1 - elif set(descendants(target)) - set(state.values()): + + descendants = set() + if dstates: + descendants = set(repo.changelog.descendants(*dstates)) + if descendants - set(dstates): repo.ui.warn(_("warning: new changesets detected on target branch, " - "can't abort\n")) + "can't abort\n")) return -1 else: # Strip from the first rebased revision