--- a/mercurial/context.py Fri Jan 15 13:14:46 2016 -0800
+++ b/mercurial/context.py Fri Jan 15 13:14:46 2016 -0800
@@ -1415,9 +1415,8 @@
def add(self, list, prefix=""):
join = lambda f: os.path.join(prefix, f)
- wlock = self._repo.wlock()
- ui, ds = self._repo.ui, self._repo.dirstate
- try:
+ with self._repo.wlock():
+ ui, ds = self._repo.ui, self._repo.dirstate
rejected = []
lstat = self._repo.wvfs.lstat
for f in list:
@@ -1445,8 +1444,6 @@
else:
ds.add(f)
return rejected
- finally:
- wlock.release()
def forget(self, files, prefix=""):
join = lambda f: os.path.join(prefix, f)