Mercurial > hg-stable
changeset 27810:8c81975fe145
with: use context manager for wlock in workingctx.forget
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 15 Jan 2016 13:14:46 -0800 |
parents | 37a75d69eb43 |
children | 09820fb88e14 |
files | mercurial/context.py |
diffstat | 1 files changed, 1 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Fri Jan 15 13:14:46 2016 -0800 +++ b/mercurial/context.py Fri Jan 15 13:14:46 2016 -0800 @@ -1447,8 +1447,7 @@ def forget(self, files, prefix=""): join = lambda f: os.path.join(prefix, f) - wlock = self._repo.wlock() - try: + with self._repo.wlock(): rejected = [] for f in files: if f not in self._repo.dirstate: @@ -1459,8 +1458,6 @@ else: self._repo.dirstate.drop(f) return rejected - finally: - wlock.release() def undelete(self, list): pctxs = self.parents()