# HG changeset patch # User Christian Ebert # Date 1384952108 0 # Node ID 02972bce7d415d0d31426f2b13739a2b22d260a8 # Parent 12c752c0a02b81e2a11ae8111e46433bbf5b8d11 wlock while setting branch in kwdemo diff -r 12c752c0a02b -r 02972bce7d41 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, '')