Mercurial > hg
comparison mercurial/exchange.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 | 9dc27a334fb1 |
children | 113d0b23321a |
comparison
equal
deleted
inserted
replaced
29340:ae92c3eee88e | 29341:0d83ad967bf8 |
---|---|
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from __future__ import absolute_import | 8 from __future__ import absolute_import |
9 | 9 |
10 import errno | 10 import errno |
11 import hashlib | |
11 | 12 |
12 from .i18n import _ | 13 from .i18n import _ |
13 from .node import ( | 14 from .node import ( |
14 hex, | 15 hex, |
15 nullid, | 16 nullid, |
1644 """check if the heads of a repo have been modified | 1645 """check if the heads of a repo have been modified |
1645 | 1646 |
1646 Used by peer for unbundling. | 1647 Used by peer for unbundling. |
1647 """ | 1648 """ |
1648 heads = repo.heads() | 1649 heads = repo.heads() |
1649 heads_hash = util.sha1(''.join(sorted(heads))).digest() | 1650 heads_hash = hashlib.sha1(''.join(sorted(heads))).digest() |
1650 if not (their_heads == ['force'] or their_heads == heads or | 1651 if not (their_heads == ['force'] or their_heads == heads or |
1651 their_heads == ['hashed', heads_hash]): | 1652 their_heads == ['hashed', heads_hash]): |
1652 # someone else committed/pushed/unbundled while we | 1653 # someone else committed/pushed/unbundled while we |
1653 # were transferring data | 1654 # were transferring data |
1654 raise error.PushRaced('repository changed while %s - ' | 1655 raise error.PushRaced('repository changed while %s - ' |