tests: lock before creating transaction in test-filelog
authorMads Kiilerich <mads@kiilerich.com>
Fri, 13 Jan 2012 01:19:07 +0100
changeset 15876 2de1244361aa
parent 15875 7eca9db689d6
child 15877 afd459933d5f
tests: lock before creating transaction in test-filelog
tests/test-filelog
--- a/tests/test-filelog	Fri Jan 13 01:19:07 2012 +0100
+++ b/tests/test-filelog	Fri Jan 13 01:19:07 2012 +0100
@@ -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