# HG changeset patch # User FUJIWARA Katsunori # Date 1408102131 -32400 # Node ID efc591e8b35c4c09f97f72bd3db15c694b1efd93 # Parent d1823cdf85543b2ecb0d63dd29fdac5fdd5ef929 largefiles: put whole "hgupdaterepo" process into the same "wlock" scope Before this patch, there are two distinct "wlock" scopes below in "hgupdaterepo": 1. "merge.update" via original "hg.updaterepo" function 2. "updatelfiles" specific "wlock" scope (to synchronize largefile dirstate) In addition to them, "dirstate.walk" is executed between these "wlock" scopes. But these should be executed in the same "wlock" scope for consistency, because many (indirect) users of "hg.updaterepo" don't get "wlock" explicitly before invocation of it. "hg.clean" is invoked without "wlock" from: - mqrepo.restore in mq - bisect in commands - update in commands "hg.update" is invoked without "wlock" from: - clone in mq - pullrebase in rebase - postincoming in commands (used in "hg pull -u", "hg unbundle") - update in commands This patch puts almost all original "hgupdaterepo" implementation into "_hgupdaterepo" to reduce changes. diff -r d1823cdf8554 -r efc591e8b35c hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Fri Aug 15 14:33:19 2014 +0900 +++ b/hgext/largefiles/overrides.py Fri Aug 15 20:28:51 2014 +0900 @@ -696,6 +696,13 @@ wlock.release() def hgupdaterepo(orig, repo, node, overwrite): + wlock = repo.wlock() + try: + return _hgupdaterepo(orig, repo, node, overwrite) + finally: + wlock.release() + +def _hgupdaterepo(orig, repo, node, overwrite): if not overwrite: # Only call updatelfiles on the standins that have changed to save time oldstandins = lfutil.getstandinsstate(repo)