wlock while setting branch in kwdemo
authorChristian Ebert <blacktrash@gmx.net>
Wed, 20 Nov 2013 12:55:08 +0000
changeset 1309 02972bce7d41
parent 1308 12c752c0a02b
child 1310 21d35cf4933e
child 1312 c44d24e2fc66
wlock while setting branch in kwdemo
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Nov 20 12:26:54 2013 +0000
+++ b/hgkw/keyword.py	Wed Nov 20 12:55:08 2013 +0000
@@ -438,7 +438,11 @@
     repo[None].add([fn])
     ui.note(_('\nkeywords written to %s:\n') % fn)
     ui.note(keywords)
-    repo.dirstate.setbranch('demobranch')
+    wlock = repo.wlock()
+    try:
+        repo.dirstate.setbranch('demobranch')
+    finally:
+        wlock.release()
     for name, cmd in ui.configitems('hooks'):
         if name.split('.', 1)[0].find('commit') > -1:
             repo.ui.setconfig('hooks', name, '')