Mercurial > hg
changeset 23072:d583f1cfca96 stable
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 20 Oct 2014 18:50:09 -0700 |
parents | 652ab726ba93 |
children | 5715c93cb854 |
files | hgext/rebase.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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