store: use hashlib.sha1 directly instead of through util
authorAugie Fackler <raf@durin42.com>
Fri, 10 Jun 2016 00:10:06 -0400
changeset 29338 81c38cb9c1a1
parent 29337 f72d0c2148da
child 29339 a9e010cd66e1
store: use hashlib.sha1 directly instead of through util Also remove module-local alias to _sha, since it's not used that much.
mercurial/store.py
--- a/mercurial/store.py	Fri Jun 10 00:14:43 2016 -0400
+++ b/mercurial/store.py	Fri Jun 10 00:10:06 2016 -0400
@@ -8,6 +8,7 @@
 from __future__ import absolute_import
 
 import errno
+import hashlib
 import os
 import stat
 
@@ -19,8 +20,6 @@
     util,
 )
 
-_sha = util.sha1
-
 # This avoids a collision between a file named foo and a dir named
 # foo.i or foo.d
 def _encodedir(path):
@@ -211,7 +210,7 @@
 _maxshortdirslen = 8 * (_dirprefixlen + 1) - 4
 
 def _hashencode(path, dotencode):
-    digest = _sha(path).hexdigest()
+    digest = hashlib.sha1(path).hexdigest()
     le = lowerencode(path[5:]).split('/') # skips prefix 'data/' or 'meta/'
     parts = _auxencode(le, dotencode)
     basename = parts[-1]