Mercurial > evolve
changeset 684:19a1a8f93c07 stable
prune: detect bad input
We accept multiple changeset folded into one successors. One changesets split in
multiple successors. But we refuse multiple changesets split in multiple ones.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 04 Feb 2013 18:07:09 +0100 |
parents | 6d24bd455f79 |
children | 7398f9729821 |
files | hgext/evolve.py |
diffstat | 1 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/evolve.py Mon Feb 04 17:55:03 2013 +0100 +++ b/hgext/evolve.py Mon Feb 04 18:07:09 2013 +0100 @@ -1259,19 +1259,24 @@ wlock = repo.wlock() try: lock = repo.lock() - new = set(scmutil.revrange(repo, succs)) - targetnodes = set(scmutil.revrange(repo, revs)) - if not targetnodes: + precs = [] + for p in sorted(set(scmutil.revrange(repo, revs))): + cp = repo[p] + precs.append(cp) + if not precs: raise util.Abort('nothing to prune') - if new: - sucs = tuple(repo[n] for n in new) else: sucs = () + + sucs = tuple(repo[n] + for n in sorted(set(scmutil.revrange(repo, succs)))) + if len(sucs) > 1 and len(precs) > 1: + msg = "Can't use multiple successors for multiple precursors" + raise util.Abort(msg) markers = [] - for n in targetnodes: - markers.append((repo[n], sucs)) + for p in precs: + markers.append((p, sucs)) createmarkers(repo, markers) - # update to an unkilled parent wdp = repo['.'] newnode = wdp