##// END OF EJS Templates
with: use context manager for wlock in workingctx.add
Bryan O'Sullivan -
r27809:37a75d69 default
parent child Browse files
Show More
@@ -1415,9 +1415,8 class workingctx(committablectx):
1415
1415
1416 def add(self, list, prefix=""):
1416 def add(self, list, prefix=""):
1417 join = lambda f: os.path.join(prefix, f)
1417 join = lambda f: os.path.join(prefix, f)
1418 wlock = self._repo.wlock()
1418 with self._repo.wlock():
1419 ui, ds = self._repo.ui, self._repo.dirstate
1419 ui, ds = self._repo.ui, self._repo.dirstate
1420 try:
1421 rejected = []
1420 rejected = []
1422 lstat = self._repo.wvfs.lstat
1421 lstat = self._repo.wvfs.lstat
1423 for f in list:
1422 for f in list:
@@ -1445,8 +1444,6 class workingctx(committablectx):
1445 else:
1444 else:
1446 ds.add(f)
1445 ds.add(f)
1447 return rejected
1446 return rejected
1448 finally:
1449 wlock.release()
1450
1447
1451 def forget(self, files, prefix=""):
1448 def forget(self, files, prefix=""):
1452 join = lambda f: os.path.join(prefix, f)
1449 join = lambda f: os.path.join(prefix, f)
General Comments 0
You need to be logged in to leave comments. Login now