comparison hgext/fsmonitor/__init__.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 a0939666b836
children d5883fd055c6
comparison
equal deleted inserted replaced
29340:ae92c3eee88e 29341:0d83ad967bf8
89 # The issues related to nested repos and subrepos are probably not fundamental 89 # The issues related to nested repos and subrepos are probably not fundamental
90 # ones. Patches to fix them are welcome. 90 # ones. Patches to fix them are welcome.
91 91
92 from __future__ import absolute_import 92 from __future__ import absolute_import
93 93
94 import hashlib
94 import os 95 import os
95 import stat 96 import stat
96 import sys 97 import sys
97 98
98 from mercurial.i18n import _ 99 from mercurial.i18n import _
139 If this information changes between Mercurial invocations, we can't 140 If this information changes between Mercurial invocations, we can't
140 rely on Watchman information anymore and have to re-scan the working 141 rely on Watchman information anymore and have to re-scan the working
141 copy. 142 copy.
142 143
143 """ 144 """
144 sha1 = util.sha1() 145 sha1 = hashlib.sha1()
145 if util.safehasattr(ignore, 'includepat'): 146 if util.safehasattr(ignore, 'includepat'):
146 sha1.update(ignore.includepat) 147 sha1.update(ignore.includepat)
147 sha1.update('\0\0') 148 sha1.update('\0\0')
148 if util.safehasattr(ignore, 'excludepat'): 149 if util.safehasattr(ignore, 'excludepat'):
149 sha1.update(ignore.excludepat) 150 sha1.update(ignore.excludepat)