changeset 22193:efc591e8b35c

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 15 Aug 2014 20:28:51 +0900
parents d1823cdf8554
children 216942807308
files hgext/largefiles/overrides.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)