changeset 22194:216942807308

largefiles: put whole "hgmerge" process into the same "wlock" scope Before this patch, there are two distinct "wlock" scopes below in "hgmerge": 1. "merge.update" via original "hg.merge" function 2. "updatelfiles" specific "wlock" scope (to synchronize largefile dirstate) But these should be executed in the same "wlock" scope for consistency, because users of "hg.merge" don't get "wlock" explicitly before invocation of it. - merge in commands This patch puts almost all of the original "hgmerge" implementation into "_hgmerge" to reduce changes.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 15 Aug 2014 20:28:51 +0900
parents efc591e8b35c
children 1dad76c0afb7
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 20:28:51 2014 +0900
+++ b/hgext/largefiles/overrides.py	Fri Aug 15 20:28:51 2014 +0900
@@ -717,6 +717,13 @@
     return result
 
 def hgmerge(orig, repo, node, force=None, remind=True):
+    wlock = repo.wlock()
+    try:
+        return _hgmerge(orig, repo, node, force, remind)
+    finally:
+        wlock.release()
+
+def _hgmerge(orig, repo, node, force, remind):
     result = orig(repo, node, force, remind)
     lfcommands.updatelfiles(repo.ui, repo)
     return result