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