Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.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 | 92d37fb3f1aa |
children | 98e8313dcd9e |
comparison
equal
deleted
inserted
replaced
29340:ae92c3eee88e | 29341:0d83ad967bf8 |
---|---|
7 # GNU General Public License version 2 or any later version. | 7 # GNU General Public License version 2 or any later version. |
8 | 8 |
9 from __future__ import absolute_import | 9 from __future__ import absolute_import |
10 | 10 |
11 import errno | 11 import errno |
12 import hashlib | |
12 import os | 13 import os |
13 import shutil | 14 import shutil |
14 | 15 |
15 from .i18n import _ | 16 from .i18n import _ |
16 from .node import nullid | 17 from .node import nullid |
478 'remote appears to be empty)\n')) | 479 'remote appears to be empty)\n')) |
479 except error.RepoLookupError: | 480 except error.RepoLookupError: |
480 ui.status(_('(not using pooled storage: ' | 481 ui.status(_('(not using pooled storage: ' |
481 'unable to resolve identity of remote)\n')) | 482 'unable to resolve identity of remote)\n')) |
482 elif sharenamemode == 'remote': | 483 elif sharenamemode == 'remote': |
483 sharepath = os.path.join(sharepool, util.sha1(source).hexdigest()) | 484 sharepath = os.path.join( |
485 sharepool, hashlib.sha1(source).hexdigest()) | |
484 else: | 486 else: |
485 raise error.Abort('unknown share naming mode: %s' % sharenamemode) | 487 raise error.Abort('unknown share naming mode: %s' % sharenamemode) |
486 | 488 |
487 if sharepath: | 489 if sharepath: |
488 return clonewithshare(ui, peeropts, sharepath, source, srcpeer, | 490 return clonewithshare(ui, peeropts, sharepath, source, srcpeer, |