_inhibitmarkers: turn the result from generator into a list
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 17 Nov 2015 22:43:17 -0800
changeset 1533 74cf5a69f201
parent 1532 48547b4c77de
child 1534 9a78ed4b9765
_inhibitmarkers: turn the result from generator into a list A generator object is always True, we have to turn it into a list in order to be able to use it in the tests. Before this patch we were rewriting the 'obsinhibit' file all the time, this had a performance impact especially on repository where transaction are expensive (hooks, cache invalidation, etc). Writing this file less often have a minor effect on test where a stripped changeset does not get removed from the obsinhibit file is still inhibited when unbundled back. I think this is fine and I'm moving forward.
hgext/inhibit.py
tests/test-inhibit.t
--- a/hgext/inhibit.py	Fri Nov 06 21:37:38 2015 -0500
+++ b/hgext/inhibit.py	Tue Nov 17 22:43:17 2015 -0800
@@ -129,7 +129,7 @@
     if not _inhibitenabled(repo):
         return
 
-    newinhibit = repo.set('::%ln and obsolete()', nodes)
+    newinhibit = list(repo.set('::%ln and obsolete()', nodes))
     if newinhibit:
         lock = tr = None
         try:
--- a/tests/test-inhibit.t	Fri Nov 06 21:37:38 2015 -0500
+++ b/tests/test-inhibit.t	Tue Nov 17 22:43:17 2015 -0800
@@ -651,7 +651,7 @@
   adding manifests
   adding file changes
   added 2 changesets with 1 changes to 2 files (+1 heads)
-  (run 'hg heads' to see heads, 'hg merge' to merge)
+  (run 'hg heads .' to see heads, 'hg merge' to merge)
 
  Only allow direct access and check that evolve works like before
 (also disable evolve commands to avoid hint about using evolve)