changeset 15876:2de1244361aa

tests: lock before creating transaction in test-filelog
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 13 Jan 2012 01:19:07 +0100
parents 7eca9db689d6
children afd459933d5f
files tests/test-filelog
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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