inhibit: improve performance of transaction wrapping
authorLaurent Charignon <lcharignon@fb.com>
Sat, 13 Jun 2015 11:14:27 -0700
changeset 1362 73e5b5280c1c
parent 1361 043e5ca9322f
child 1363 2eaa2943f9f3
inhibit: improve performance of transaction wrapping Before this patch, transaction wrapping was the most expensive part of inhibit computation wise. This patch changes the revset that we use in the transaction wrapping to make it ~50x faster to compute: revset #0: obsolete() - hidden() 0) wall 0.000214 comb 0.000000 user 0.000000 sys 0.000000 (best of 11209) vs revset #0: (not hidden()) and obsolete() 0) wall 0.010965 comb 0.010000 user 0.010000 sys 0.000000 (best of 237)
hgext/inhibit.py
--- a/hgext/inhibit.py	Thu Jun 04 16:49:16 2015 -0700
+++ b/hgext/inhibit.py	Sat Jun 13 11:14:27 2015 -0700
@@ -172,7 +172,7 @@
     def inhibitposttransaction(transaction):
         # At the end of the transaction we catch all the new visible and
         # obsolete commit to inhibit them
-        visibleobsolete = repo.revs('(not hidden()) and obsolete()')
+        visibleobsolete = repo.revs('obsolete() - hidden()')
         ignoreset = set(getattr(repo, '_rebaseset', []))
         visibleobsolete = list(r for r in visibleobsolete if r not in ignoreset)
         if visibleobsolete: