keyword: wlock while setting branch in kwdemo
authorChristian Ebert <blacktrash@gmx.net>
Wed, 20 Nov 2013 12:55:08 +0000
changeset 20113 7ad2ae7792ad
parent 20112 169f8141ba00
child 20114 390aff33c2f9
keyword: wlock while setting branch in kwdemo
hgext/keyword.py
--- a/hgext/keyword.py	Sun Nov 17 15:43:46 2013 +0100
+++ b/hgext/keyword.py	Wed Nov 20 12:55:08 2013 +0000
@@ -439,7 +439,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, '')