# HG changeset patch # User Pierre-Yves David # Date 1413845974 25200 # Node ID 7173c70ab2c37b451412ce06bf7147f4f7a3b0c7 # Parent 8b3b0549a4b668edc6331a7b62c84d9bbc65e45a prune: stop reinjecting all selected revisions back into the revrange This trigger quadratic complexity for no good reason. diff -r 8b3b0549a4b6 -r 7173c70ab2c3 hgext/evolve.py --- a/hgext/evolve.py Mon Oct 20 15:53:00 2014 -0700 +++ b/hgext/evolve.py Mon Oct 20 15:59:34 2014 -0700 @@ -1704,7 +1704,7 @@ a future release (with the functionality absorbed automatically). """ - revs = set(scmutil.revrange(repo, list(revs) + opts.get('rev'))) + revs = scmutil.revrange(repo, list(revs) + opts.get('rev')) succs = opts['new'] + opts['succ'] bookmark = opts.get('bookmark') metadata = _getmetadata(**opts) @@ -1722,11 +1722,11 @@ wlock = lock = None try: wlock = repo.wlock() - sortedrevs = lambda specs: sorted(set(scmutil.revrange(repo, specs))) lock = repo.lock() # defines pruned changesets precs = [] - for p in sortedrevs(revs): + revs.sort() + for p in revs: cp = repo[p] if not cp.mutable(): # note: createmarkers() would have raised something anyway @@ -1737,7 +1737,7 @@ raise util.Abort('nothing to prune') # defines successors changesets - sucs = tuple(repo[n] for n in sortedrevs(succs)) + sucs = tuple(repo[n] for n in scmutil.revrange(repo, succs)) if not biject and len(sucs) > 1 and len(precs) > 1: msg = "Can't use multiple successors for multiple precursors" raise util.Abort(msg)