# HG changeset patch # User Pierre-Yves David # Date 1447820715 28800 # Node ID f6d10432499de7e2b5648f9b3476609cab3d3033 # Parent 9a78ed4b976548777e18d663e2fdf2e822224e9b inhibit: use dirty revset trick to speedup the inhibit search space. See documentation for details. I'm a bit sad about this changesets. diff -r 9a78ed4b9765 -r f6d10432499d hgext/inhibit.py --- a/hgext/inhibit.py Tue Nov 17 20:19:32 2015 -0800 +++ b/hgext/inhibit.py Tue Nov 17 20:25:15 2015 -0800 @@ -129,7 +129,15 @@ if not _inhibitenabled(repo): return - newinhibit = repo.revs('::%ln and obsolete()', nodes) + # we add (non public()) as a lower boundary to + # - use the C code in 3.6 (no ancestors in C as this is written) + # - restrict the search space. Otherwise, the ancestors can spend a lot of + # time iterating if you have a check very low in the repo. We do not need + # to iterate over tens of thousand of public revisions with higher + # revision number + # + # In addition, the revset logic could be made significantly smarter here. + newinhibit = repo.revs('(not public())::%ln and obsolete()', nodes) if newinhibit: node = repo.changelog.node lock = tr = None