hgext/inhibit.py
changeset 1535 f6d10432499d
parent 1534 9a78ed4b9765
child 1538 ef5da2310398
--- 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