##// END OF EJS Templates
with: use context manager for wlock in _kwfwrite
Bryan O'Sullivan -
r27815:16cfbbc6 default
parent child Browse files
Show More
@@ -357,14 +357,11 b' def _kwfwrite(ui, repo, expand, *pats, *'
357 if len(wctx.parents()) > 1:
357 if len(wctx.parents()) > 1:
358 raise error.Abort(_('outstanding uncommitted merge'))
358 raise error.Abort(_('outstanding uncommitted merge'))
359 kwt = kwtools['templater']
359 kwt = kwtools['templater']
360 wlock = repo.wlock()
360 with repo.wlock():
361 try:
362 status = _status(ui, repo, wctx, kwt, *pats, **opts)
361 status = _status(ui, repo, wctx, kwt, *pats, **opts)
363 if status.modified or status.added or status.removed or status.deleted:
362 if status.modified or status.added or status.removed or status.deleted:
364 raise error.Abort(_('outstanding uncommitted changes'))
363 raise error.Abort(_('outstanding uncommitted changes'))
365 kwt.overwrite(wctx, status.clean, True, expand)
364 kwt.overwrite(wctx, status.clean, True, expand)
366 finally:
367 wlock.release()
368
365
369 @command('kwdemo',
366 @command('kwdemo',
370 [('d', 'default', None, _('show default keyword template maps')),
367 [('d', 'default', None, _('show default keyword template maps')),
General Comments 0
You need to be logged in to leave comments. Login now