changeset 31736:dd2079fae003

largefiles: add copytostore() fstandin argument to replace readstandin() (API) copyalltostore(), only one caller of copytostore(), already knows standin file name of the target largefile. Therefore, passing it to copytostore() is more efficient than calculating it in copytostore() or readstandin().
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 01 Apr 2017 02:32:48 +0900
parents 3e37b479ce2f
children c03af6b44846
files hgext/largefiles/lfutil.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Sat Apr 01 02:32:47 2017 +0900
+++ b/hgext/largefiles/lfutil.py	Sat Apr 01 02:32:48 2017 +0900
@@ -245,9 +245,9 @@
         return False
     return True
 
-def copytostore(repo, revorctx, file, uploaded=False):
+def copytostore(repo, revorctx, file, fstandin, uploaded=False):
     wvfs = repo.wvfs
-    hash = readstandin(repo, file, revorctx)
+    hash = readasstandin(repo[revorctx][fstandin])
     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, realfile)
+            copytostore(repo, ctx, realfile, filename)
 
 def copytostoreabsolute(repo, file, hash):
     if inusercache(repo.ui, hash):