diff hgext/largefiles/lfcommands.py @ 31623:8228bc8fed8c

largefiles: avoid redundant standin() invocations There are some code paths, which apply standin() on same value multilpe times instead of using already standin()-ed value. "fstandin" is common name for "path to standin file" in lfutil.py, to avoid shadowing "standin()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 24 Mar 2017 22:29:22 +0900
parents 5c1d3f1b8f44
children 1af4a1641bdb
line wrap: on
line diff
--- a/hgext/largefiles/lfcommands.py	Fri Mar 24 22:29:22 2017 +0900
+++ b/hgext/largefiles/lfcommands.py	Fri Mar 24 22:29:22 2017 +0900
@@ -220,7 +220,8 @@
                 normalfiles.add(f)
 
         if f in lfiles:
-            dstfiles.append(lfutil.standin(f))
+            fstandin = lfutil.standin(f)
+            dstfiles.append(fstandin)
             # largefile in manifest if it has not been removed/renamed
             if f in ctx.manifest():
                 fctx = ctx.filectx(f)
@@ -236,7 +237,7 @@
                 if f not in lfiletohash or lfiletohash[f] != hash:
                     rdst.wwrite(f, ctx[f].data(), ctx[f].flags())
                     executable = 'x' in ctx[f].flags()
-                    lfutil.writestandin(rdst, lfutil.standin(f), hash,
+                    lfutil.writestandin(rdst, fstandin, hash,
                         executable)
                     lfiletohash[f] = hash
         else: