Patchwork [4,of,7] largefiles: omit redundant splitstandin() invocations

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 24, 2017, 1:38 p.m.
Message ID <ae4c9a5c687a7f7a8460.1490362718@speaknoevil>
Download mbox | patch
Permalink /patch/19636/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - March 24, 2017, 1:38 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1490361899 -32400
#      Fri Mar 24 22:24:59 2017 +0900
# Node ID ae4c9a5c687a7f7a8460dac36cd3f5f8404ef06b
# Parent  1b4394709fd87672eefec1730c2f6a058f3e0070
largefiles: omit redundant splitstandin() invocations

There are 3 splitstandin() invocations in updatestandin() for same
"standin" value.

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -343,13 +343,14 @@  def splitstandin(filename):
         return None
 
 def updatestandin(repo, standin):
-    file = repo.wjoin(splitstandin(standin))
-    if repo.wvfs.exists(splitstandin(standin)):
+    lfile = splitstandin(standin)
+    file = repo.wjoin(lfile)
+    if repo.wvfs.exists(lfile):
         hash = hashfile(file)
         executable = getexecutable(file)
         writestandin(repo, standin, hash, executable)
     else:
-        raise error.Abort(_('%s: file not found!') % splitstandin(standin))
+        raise error.Abort(_('%s: file not found!') % lfile)
 
 def readstandin(repo, filename, node=None):
     '''read hex hash from standin for filename at given node, or working