mercurial/utils/hashutil.py
author Matt Harbison <matt_harbison@yahoo.com>
Tue, 28 Feb 2023 18:14:11 -0500
branchstable
changeset 49704 a6b497872b97
parent 48966 6000f5b25c9b
permissions -rw-r--r--
patchbomb: respect the `--git` option I *think* this is the only diffopt exposed on the command line. TortoiseHg had a similar issue creating diffopts, and this was caught by type hints in the next commit.

import hashlib

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

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