Patchwork [6,of,7] largefiles: replace hashrepofile by hashfile (API)

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 24, 2017, 1:38 p.m.
Message ID <b0176fef06b79d8e4364.1490362720@speaknoevil>
Download mbox | patch
Permalink /patch/19638/
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 1490362162 -32400
#      Fri Mar 24 22:29:22 2017 +0900
# Node ID b0176fef06b79d8e4364bf2befa2522635c4d3ff
# Parent  d8e91cf37cc9409c79c5d97969c1e63d0dbe8908
largefiles: replace hashrepofile by hashfile (API)

There is only one user for the former, and repo.wjoin()-ed value is
alread known by that user.

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -370,9 +370,6 @@  def copyandhash(instream, outfile):
         outfile.write(data)
     return hasher.hexdigest()
 
-def hashrepofile(repo, file):
-    return hashfile(repo.wjoin(file))
-
 def hashfile(file):
     if not os.path.exists(file):
         return ''
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1400,7 +1400,7 @@  def mergeupdate(orig, repo, node, branch
             lfileabs = repo.wvfs.join(lfile)
             if not repo.wvfs.exists(lfileabs):
                 continue
-            lfhash = lfutil.hashrepofile(repo, lfile)
+            lfhash = lfutil.hashfile(lfileabs)
             standin = lfutil.standin(lfile)
             lfutil.writestandin(repo, standin, lfhash,
                                 lfutil.getexecutable(lfileabs))