diff mercurial/patch.py @ 29341:0d83ad967bf8

cleanup: replace uses of util.(md5|sha1|sha256|sha512) with hashlib.\1 All versions of Python we support or hope to support make the hash functions available in the same way under the same name, so we may as well drop the util forwards.
author Augie Fackler <raf@durin42.com>
date Fri, 10 Jun 2016 00:12:33 -0400
parents d48fc6f318a3
children 40d53d4b5925
line wrap: on
line diff
--- a/mercurial/patch.py	Fri Jun 10 00:25:07 2016 -0400
+++ b/mercurial/patch.py	Fri Jun 10 00:12:33 2016 -0400
@@ -12,6 +12,7 @@
 import copy
 import email
 import errno
+import hashlib
 import os
 import posixpath
 import re
@@ -2412,7 +2413,7 @@
         if not text:
             text = ""
         l = len(text)
-        s = util.sha1('blob %d\0' % l)
+        s = hashlib.sha1('blob %d\0' % l)
         s.update(text)
         return s.hexdigest()