# HG changeset patch # User Bryan O'Sullivan # Date 2016-01-15 21:14:47 # Node ID f087b7095381bc9b0d4050c44732d3e0984da7bc # Parent 4692571df9eecc987d37961840d18be6f053dbff with: use context manager for wlock in mergeupdate diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1337,8 +1337,7 @@ def mergeupdate(orig, repo, node, branch matcher = kwargs.get('matcher', None) # note if this is a partial update partial = matcher and not matcher.always() - wlock = repo.wlock() - try: + with repo.wlock(): # branch | | | # merge | force | partial | action # -------+-------+---------+-------------- @@ -1387,8 +1386,6 @@ def mergeupdate(orig, repo, node, branch normallookup=partial) return result - finally: - wlock.release() def scmutilmarktouched(orig, repo, files, *args, **kwargs): result = orig(repo, files, *args, **kwargs)