# HG changeset patch # User Bryan O'Sullivan # Date 2016-01-15 21:14:46 # Node ID 4692571df9eecc987d37961840d18be6f053dbff # Parent 0e55e93b50b5bbbccd1a2d4ff25b52b6124a839a with: use context manager for wlock in overridepurge diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1223,8 +1223,7 @@ def overridepurge(orig, ui, repo, *dirs, orig(ui, repo, *dirs, **opts) repo.status = oldstatus def overriderollback(orig, ui, repo, **opts): - wlock = repo.wlock() - try: + with repo.wlock(): before = repo.dirstate.parents() orphans = set(f for f in repo.dirstate if lfutil.isstandin(f) and repo.dirstate[f] != 'r') @@ -1258,8 +1257,6 @@ def overriderollback(orig, ui, repo, **o for lfile in orphans: lfdirstate.drop(lfile) lfdirstate.write() - finally: - wlock.release() return result def overridetransplant(orig, ui, repo, *revs, **opts):