# HG changeset patch # User Pierre-Yves David # Date 1398460469 25200 # Node ID 8cac667a0d7d4dc2f9945381ae251f50e592a38e # Parent 79ee85bd899b5657d986843dd551ee438d00b1ae prune: work around lazy revset slowdown Since 3.0 lazy revset is making some revset very slow. We currently work around the issue by using a simple loop instead. diff -r 79ee85bd899b -r 8cac667a0d7d README --- a/README Tue Sep 02 19:19:17 2014 +0200 +++ b/README Fri Apr 25 14:14:29 2014 -0700 @@ -62,6 +62,7 @@ - uncommit: add a --rev argument - evolve: add a `working directory now at xxxxxxxxxx` message - properly skip marker creating if patch apply cleanly +- prune: work around a massive slowdown from lazy revset 4.1.0 -- 2014-08-08 diff -r 79ee85bd899b -r 8cac667a0d7d hgext/evolve.py --- a/hgext/evolve.py Tue Sep 02 19:19:17 2014 +0200 +++ b/hgext/evolve.py Fri Apr 25 14:14:29 2014 -0700 @@ -1870,11 +1870,19 @@ if bookmark: _deletebookmark(ui, marks, bookmark) for ctx in repo.unfiltered().set('bookmark() and %ld', precs): - ldest = list(repo.set('max((::%d) - obsolete())', ctx)) - if ldest: - dest = ldest[0] - updatebookmarks = _bookmarksupdater(repo, ctx.node()) - updatebookmarks(dest.node()) + # used to be: + # + # ldest = list(repo.set('max((::%d) - obsolete())', ctx)) + # if ldest: + # c = ldest[0] + # + # but then revset took a lazy arrow in the knee and became much + # slower. The new forms makes as much sense and a much faster. + for dest in ctx.ancestors(): + if not dest.obsolete(): + updatebookmarks = _bookmarksupdater(repo, ctx.node()) + updatebookmarks(dest.node()) + break finally: lockmod.release(lock, wlock)