##// END OF EJS Templates
store: use hashlib.sha1 directly instead of through util...
Augie Fackler -
r29338:81c38cb9 default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import errno
10 import errno
11 import hashlib
11 import os
12 import os
12 import stat
13 import stat
13
14
@@ -19,8 +20,6 b' from . import ('
19 util,
20 util,
20 )
21 )
21
22
22 _sha = util.sha1
23
24 # This avoids a collision between a file named foo and a dir named
23 # This avoids a collision between a file named foo and a dir named
25 # foo.i or foo.d
24 # foo.i or foo.d
26 def _encodedir(path):
25 def _encodedir(path):
@@ -211,7 +210,7 b' def _auxencode(path, dotencode):'
211 _maxshortdirslen = 8 * (_dirprefixlen + 1) - 4
210 _maxshortdirslen = 8 * (_dirprefixlen + 1) - 4
212
211
213 def _hashencode(path, dotencode):
212 def _hashencode(path, dotencode):
214 digest = _sha(path).hexdigest()
213 digest = hashlib.sha1(path).hexdigest()
215 le = lowerencode(path[5:]).split('/') # skips prefix 'data/' or 'meta/'
214 le = lowerencode(path[5:]).split('/') # skips prefix 'data/' or 'meta/'
216 parts = _auxencode(le, dotencode)
215 parts = _auxencode(le, dotencode)
217 basename = parts[-1]
216 basename = parts[-1]
General Comments 0
You need to be logged in to leave comments. Login now