# HG changeset patch # User Bryan O'Sullivan # Date 1452892486 28800 # Node ID bce0afa1921ad34b527fa1bcea2d9842fc7b7381 # Parent bf3bf7158f69c28142d048a705d3cc4ef825815a with: use context manager for wlock in removelargefiles diff -r bf3bf7158f69 -r bce0afa1921a hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Fri Jan 15 13:14:46 2016 -0800 +++ b/hgext/largefiles/overrides.py Fri Jan 15 13:14:46 2016 -0800 @@ -196,8 +196,7 @@ # Need to lock because standin files are deleted then removed from the # repository and we could race in-between. - wlock = repo.wlock() - try: + with repo.wlock(): lfdirstate = lfutil.openlfdirstate(ui, repo) for f in sorted(remove): if ui.verbose or not m.exact(f): @@ -228,8 +227,6 @@ False) lfdirstate.write() - finally: - wlock.release() return result