mercurial/utils/hashutil.py
author Joerg Sonnenberger <joerg@bec.de>
Tue, 19 Jan 2021 00:18:39 +0100
changeset 46357 72f5280e33b6
parent 44059 7126d8b8e0e6
child 46785 521ac0d7047f
permissions -rw-r--r--
commit: look-up new revision once Look-up by node is slightly more expensive, so since it is necessary more than once, do it explicitly. Differential Revision: https://phab.mercurial-scm.org/D9830

from __future__ import absolute_import

import hashlib

try:
    from ..thirdparty import sha1dc

    sha1 = sha1dc.sha1
except (ImportError, AttributeError):
    sha1 = hashlib.sha1