[PATCH 04 of 19] tests: lock before creating transaction in test-filelog

Mads Kiilerich mads at kiilerich.com
Fri Jan 13 01:32:38 UTC 2012


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1326413947 -3600
# Node ID d153ef199ab47c4f2723eb00ccca425058eb3991
# Parent  6a060414330b91f9cb2a48ee1535120bfebe8148
tests: lock before creating transaction in test-filelog

diff --git a/tests/test-filelog b/tests/test-filelog
--- a/tests/test-filelog
+++ b/tests/test-filelog
@@ -17,12 +17,17 @@
     else:
         meta = {}
 
-    t = repo.transaction('commit')
+    lock = t = None
     try:
+        lock = repo.lock()
+        t = repo.transaction('commit')
         node = fl.add(text, meta, t, 0, nullid, nullid)
         return node
     finally:
-        t.close()
+        if t:
+            t.close()
+        if lock:
+            lock.release()
 
 def error(text):
     print 'ERROR: ' + text



More information about the Mercurial-devel mailing list