Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 23366:568ae89797c6
subrepo: remove "_calcfilehash" referred by no other code paths
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 19 Nov 2014 18:35:14 +0900 |
parents | 2ff394bbfa74 |
children | 115af8de76a4 |
comparison
equal
deleted
inserted
replaced
23365:2ff394bbfa74 | 23366:568ae89797c6 |
---|---|
29 return path | 29 return path |
30 | 30 |
31 def _getstorehashcachename(remotepath): | 31 def _getstorehashcachename(remotepath): |
32 '''get a unique filename for the store hash cache of a remote repository''' | 32 '''get a unique filename for the store hash cache of a remote repository''' |
33 return util.sha1(_expandedabspath(remotepath)).hexdigest()[0:12] | 33 return util.sha1(_expandedabspath(remotepath)).hexdigest()[0:12] |
34 | |
35 def _calcfilehash(filename): | |
36 data = '' | |
37 if os.path.exists(filename): | |
38 fd = open(filename, 'rb') | |
39 try: | |
40 data = fd.read() | |
41 finally: | |
42 fd.close() | |
43 return util.sha1(data).hexdigest() | |
44 | 34 |
45 class SubrepoAbort(error.Abort): | 35 class SubrepoAbort(error.Abort): |
46 """Exception class used to avoid handling a subrepo error more than once""" | 36 """Exception class used to avoid handling a subrepo error more than once""" |
47 def __init__(self, *args, **kw): | 37 def __init__(self, *args, **kw): |
48 error.Abort.__init__(self, *args, **kw) | 38 error.Abort.__init__(self, *args, **kw) |