wafsamba: Properly lock object store when retrieving version through Bazaar.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 22 Jul 2011 10:44:59 +0000 (12:44 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 23 Jul 2011 20:08:10 +0000 (22:08 +0200)
buildtools/wafsamba/samba_version.py

index 0c39ed4..96d5d0d 100644 (file)
@@ -37,7 +37,11 @@ def bzr_version_summary(path):
         ret = "BZR-%d" % revno
     else:
         store = get_object_store(b.repository)
-        full_rev = store._lookup_revision_sha1(revid)
+        store.lock_read()
+        try:
+            full_rev = store._lookup_revision_sha1(revid)
+        finally:
+            store.unlock()
         fields["GIT_COMMIT_ABBREV"] = full_rev[:7]
         fields["GIT_COMMIT_FULLREV"] = full_rev
         ret = "GIT-" + fields["GIT_COMMIT_ABBREV"]