# HG changeset patch # User Pierre-Yves David # Date 1435010694 25200 # Node ID aaccca501ae09a706fd60dfba63eaddaa4d5e3ba # Parent 4198e2fad6ba08c0798c217e7b643fae9c28e81b evolve: drop len comparison in prune and fold Computing the length of a smartest may be significantly more expensive than computing it length. diff -r 4198e2fad6ba -r aaccca501ae0 hgext/evolve.py --- a/hgext/evolve.py Sat Jun 20 02:04:37 2015 -0700 +++ b/hgext/evolve.py Mon Jun 22 15:04:54 2015 -0700 @@ -2087,7 +2087,7 @@ raise util.Abort('nothing to prune') if not obsolete.isenabled(repo, obsolete.allowunstableopt): - if len(repo.revs("(%ld::) - %ld", revs, revs)) != 0: + if repo.revs("(%ld::) - %ld", revs, revs): raise util.Abort(_("cannot prune in the middle of a stack")) # defines successors changesets @@ -2583,7 +2583,7 @@ head = repo[heads.first()] disallowunstable = not obsolete.isenabled(repo, obsolete.allowunstableopt) if disallowunstable: - if len(repo.revs("(%ld::) - %ld", revs, revs)) != 0: + if repo.revs("(%ld::) - %ld", revs, revs): raise util.Abort(_("cannot fold chain not ending with a head "\ "or with branching")) wlock = lock = None