Patchwork [04,of,11] subrepo: remove "_calcfilehash" referred by no other code paths

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Nov. 19, 2014, 9:41 a.m.
Message ID <0db575d944ee18c3614b.1416390109@juju>
Download mbox | patch
Permalink /patch/6790/
State Accepted
Commit 568ae89797c6c3ba07fdeb2b708c6487bd9cdb75
Headers show

Comments

Katsunori FUJIWARA - Nov. 19, 2014, 9:41 a.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1416389714 -32400
#      Wed Nov 19 18:35:14 2014 +0900
# Node ID 0db575d944ee18c3614b68741c2a7dc45fd38920
# Parent  1afed68c6dfb8f6609adc40c5abd78047e21f4cb
subrepo: remove "_calcfilehash" referred by no other code paths

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -32,16 +32,6 @@  def _getstorehashcachename(remotepath):
     '''get a unique filename for the store hash cache of a remote repository'''
     return util.sha1(_expandedabspath(remotepath)).hexdigest()[0:12]
 
-def _calcfilehash(filename):
-    data = ''
-    if os.path.exists(filename):
-        fd = open(filename, 'rb')
-        try:
-            data = fd.read()
-        finally:
-            fd.close()
-    return util.sha1(data).hexdigest()
-
 class SubrepoAbort(error.Abort):
     """Exception class used to avoid handling a subrepo error more than once"""
     def __init__(self, *args, **kw):