evolve: drop len comparison in prune and fold
Computing the length of a smartest may be significantly more expensive than
computing it length.
--- 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