comparison hgext/mq.py @ 27830:1c5941542f24

with: use context manager for wlock in qrefresh
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 15 Jan 2016 13:14:47 -0800
parents bab359a3cf49
children 62f3126ef678
comparison
equal deleted inserted replaced
27829:bab359a3cf49 27830:1c5941542f24
2625 Returns 0 on success. 2625 Returns 0 on success.
2626 """ 2626 """
2627 q = repo.mq 2627 q = repo.mq
2628 message = cmdutil.logmessage(ui, opts) 2628 message = cmdutil.logmessage(ui, opts)
2629 setupheaderopts(ui, opts) 2629 setupheaderopts(ui, opts)
2630 wlock = repo.wlock() 2630 with repo.wlock():
2631 try:
2632 ret = q.refresh(repo, pats, msg=message, **opts) 2631 ret = q.refresh(repo, pats, msg=message, **opts)
2633 q.savedirty() 2632 q.savedirty()
2634 return ret 2633 return ret
2635 finally:
2636 wlock.release()
2637 2634
2638 @command("^qdiff", 2635 @command("^qdiff",
2639 commands.diffopts + commands.diffopts2 + commands.walkopts, 2636 commands.diffopts + commands.diffopts2 + commands.walkopts,
2640 _('hg qdiff [OPTION]... [FILE]...'), 2637 _('hg qdiff [OPTION]... [FILE]...'),
2641 inferrepo=True) 2638 inferrepo=True)