--- a/mercurial/commands.py Fri Jan 15 13:14:46 2016 -0800
+++ b/mercurial/commands.py Fri Jan 15 13:14:46 2016 -0800
@@ -1197,8 +1197,7 @@
ui.write("%s\n" % repo.dirstate.branch())
return
- wlock = repo.wlock()
- try:
+ with repo.wlock():
if opts.get('clean'):
label = repo[None].p1().branch()
repo.dirstate.setbranch(label)
@@ -1220,8 +1219,6 @@
if not others:
ui.status(_('(branches are permanent and global, '
'did you want a bookmark?)\n'))
- finally:
- wlock.release()
@command('branches',
[('a', 'active', False,