##// END OF EJS Templates
with: use context manager for wlock in branch
Bryan O'Sullivan -
r27804:aa41199a default
parent child Browse files
Show More
@@ -1197,8 +1197,7 b' def branch(ui, repo, label=None, **opts)'
1197 ui.write("%s\n" % repo.dirstate.branch())
1197 ui.write("%s\n" % repo.dirstate.branch())
1198 return
1198 return
1199
1199
1200 wlock = repo.wlock()
1200 with repo.wlock():
1201 try:
1202 if opts.get('clean'):
1201 if opts.get('clean'):
1203 label = repo[None].p1().branch()
1202 label = repo[None].p1().branch()
1204 repo.dirstate.setbranch(label)
1203 repo.dirstate.setbranch(label)
@@ -1220,8 +1219,6 b' def branch(ui, repo, label=None, **opts)'
1220 if not others:
1219 if not others:
1221 ui.status(_('(branches are permanent and global, '
1220 ui.status(_('(branches are permanent and global, '
1222 'did you want a bookmark?)\n'))
1221 'did you want a bookmark?)\n'))
1223 finally:
1224 wlock.release()
1225
1222
1226 @command('branches',
1223 @command('branches',
1227 [('a', 'active', False,
1224 [('a', 'active', False,
General Comments 0
You need to be logged in to leave comments. Login now