hgext/largefiles/lfutil.py
changeset 31616 10561eb97c7f
parent 31615 f0f316cb8259
child 31617 1f6c932862e5
--- a/hgext/largefiles/lfutil.py	Fri Mar 24 22:24:59 2017 +0900
+++ b/hgext/largefiles/lfutil.py	Fri Mar 24 22:26:34 2017 +0900
@@ -245,9 +245,9 @@
         return False
     return True
 
-def copytostore(repo, rev, file, uploaded=False):
+def copytostore(repo, revorctx, file, uploaded=False):
     wvfs = repo.wvfs
-    hash = readstandin(repo, file, rev)
+    hash = readstandin(repo, file, revorctx)
     if instore(repo, hash):
         return
     if wvfs.exists(file):
@@ -263,7 +263,7 @@
     for filename in ctx.files():
         realfile = splitstandin(filename)
         if realfile is not None and filename in ctx.manifest():
-            copytostore(repo, ctx.node(), realfile)
+            copytostore(repo, ctx, realfile)
 
 def copytostoreabsolute(repo, file, hash):
     if inusercache(repo.ui, hash):
@@ -485,6 +485,11 @@
     lfdirstate.write()
 
     # As part of committing, copy all of the largefiles into the cache.
+    #
+    # Using "node" instead of "ctx" implies additional "repo[node]"
+    # lookup while copyalltostore(), but can omit redundant check for
+    # files comming from the 2nd parent, which should exist in store
+    # at merging.
     copyalltostore(repo, node)
 
 def getlfilestoupdate(oldstandins, newstandins):