Mercurial > hg
comparison hgext/rebase.py @ 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 | 8792ac090e3b |
children | e53f6b72a0e4 643c58303fb0 |
comparison
equal
deleted
inserted
replaced
23071:652ab726ba93 | 23072:d583f1cfca96 |
---|---|
271 base = scmutil.revrange(repo, [basef or '.']) | 271 base = scmutil.revrange(repo, [basef or '.']) |
272 if not base: | 272 if not base: |
273 ui.status(_('empty "base" revision set - ' | 273 ui.status(_('empty "base" revision set - ' |
274 "can't compute rebase set\n")) | 274 "can't compute rebase set\n")) |
275 return 1 | 275 return 1 |
276 rebaseset = repo.revs( | 276 commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first() |
277 '(children(ancestor(%ld, %d)) and ::(%ld))::', | 277 rebaseset = repo.revs('(%d::(%ld) - %d)::', |
278 base, dest, base) | 278 commonanc, base, commonanc) |
279 if not rebaseset: | 279 if not rebaseset: |
280 # transform to list because smartsets are not comparable to | 280 # transform to list because smartsets are not comparable to |
281 # lists. This should be improved to honor lazyness of | 281 # lists. This should be improved to honor lazyness of |
282 # smartset. | 282 # smartset. |
283 if list(base) == [dest.rev()]: | 283 if list(base) == [dest.rev()]: |