# HG changeset patch # User Bryan O'Sullivan # Date 1452892487 28800 # Node ID 823069f73ff9ea9731d3a653c993e6bc8f0349f9 # Parent a5b168953013e6b2d6e60f4c99cc7d68cc10d41d with: use context manager for wlock in qpush diff -r a5b168953013 -r 823069f73ff9 hgext/mq.py --- a/hgext/mq.py Fri Jan 15 13:14:47 2016 -0800 +++ b/hgext/mq.py Fri Jan 15 13:14:47 2016 -0800 @@ -1318,8 +1318,7 @@ keepchanges=False): self.checkkeepchanges(keepchanges, force) diffopts = self.diffopts() - wlock = repo.wlock() - try: + with repo.wlock(): heads = [] for hs in repo.branchmap().itervalues(): heads.extend(hs) @@ -1461,9 +1460,6 @@ self.ui.write(_("now at: %s\n") % top) return ret[0] - finally: - wlock.release() - def pop(self, repo, patch=None, force=False, update=True, all=False, nobackup=False, keepchanges=False): self.checkkeepchanges(keepchanges, force)