rebase: improve base revset performance
The old revset had pretty terrible performance on large repositories (12+
seconds). This new revset achieves the same result in only 0.7s. As we improve
the underlying revset APIs we can probably get this revset down to 'only(base,
dest)::', but at the moment that version still takes 2s.
--- a/hgext/rebase.py Thu Oct 16 06:35:06 2014 -0700
+++ b/hgext/rebase.py Mon Oct 20 18:50:09 2014 -0700
@@ -273,9 +273,9 @@
ui.status(_('empty "base" revision set - '
"can't compute rebase set\n"))
return 1
- rebaseset = repo.revs(
- '(children(ancestor(%ld, %d)) and ::(%ld))::',
- base, dest, base)
+ commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first()
+ rebaseset = repo.revs('(%d::(%ld) - %d)::',
+ commonanc, base, commonanc)
if not rebaseset:
# transform to list because smartsets are not comparable to
# lists. This should be improved to honor lazyness of