mercurial/utils/hashutil.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 01 Aug 2024 13:10:09 +0200
changeset 51781 a891347058e7
parent 48875 6000f5b25c9b
child 51863 f4733654f144
permissions -rw-r--r--
manifest: introduce a `read_delta_parents` method This new method have a clearer semantic and can be used by code that need this semantic. This should avoid bugs, allow for more targeted optimisation, and provide a clearer API. Users will be updated in subsequent changesets. This is also part of the wider effort to clarify and fix this API. one more method coming.

import hashlib

try:
    from ..thirdparty import sha1dc  # pytype: disable=import-error

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