Patchwork [06,of,12,misc,largefiles] largefiles: use more reasonable locking for update

login
register
mail settings
Submitter Mads Kiilerich
Date April 13, 2014, 4:59 p.m.
Message ID <7f7c85566142e478ceb9.1397408349@localhost.localdomain>
Download mbox | patch
Permalink /patch/4322/
State Accepted
Commit 278bd08a2902440e71b81464aec0a370c4f58ed9
Headers show

Comments

Mads Kiilerich - April 13, 2014, 4:59 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1367097592 -7200
#      Sat Apr 27 23:19:52 2013 +0200
# Node ID 7f7c85566142e478ceb91f24b2cc1d6e44a3022a
# Parent  f7e77352686aed959769854280c95d146e6fec6a
largefiles: use more reasonable locking for update

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -297,15 +297,15 @@  def overridedebugstate(orig, ui, repo, *
 # will get the new files. Filemerge is also overridden so that the merge
 # will merge standins correctly.
 def overrideupdate(orig, ui, repo, *pats, **opts):
-    lfdirstate = lfutil.openlfdirstate(ui, repo)
-    s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False,
-        False, False)
-    (unsure, modified, added, removed, missing, unknown, ignored, clean) = s
-
     # Need to lock between the standins getting updated and their
     # largefiles getting updated
     wlock = repo.wlock()
     try:
+        lfdirstate = lfutil.openlfdirstate(ui, repo)
+        s = lfdirstate.status(match_.always(repo.root, repo.getcwd()),
+            [], False, False, False)
+        (unsure, modified, added, removed, missing, unknown, ignored, clean) = s
+
         if opts['check']:
             mod = len(modified) > 0
             for lfile in unsure:
@@ -322,9 +322,9 @@  def overrideupdate(orig, ui, repo, *pats
         if not opts['clean']:
             for lfile in unsure + modified + added:
                 lfutil.updatestandin(repo, lfutil.standin(lfile))
+        return orig(ui, repo, *pats, **opts)
     finally:
         wlock.release()
-    return orig(ui, repo, *pats, **opts)
 
 # Before starting the manifest merge, merge.updates will call
 # _checkunknown to check if there are any files in the merged-in