changeset 1535:f6d10432499d

inhibit: use dirty revset trick to speedup the inhibit search space. See documentation for details. I'm a bit sad about this changesets.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 17 Nov 2015 20:25:15 -0800
parents 9a78ed4b9765
children 9afe9e0191a1
files hgext/inhibit.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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