mercurial/utils/hashutil.py
author Raphaël Gomès <rgomes@octobus.net>
Tue, 05 Apr 2022 17:11:36 +0200
branchstable
changeset 49006 5bd6bcd31dd1
parent 46785 521ac0d7047f
child 48875 6000f5b25c9b
permissions -rw-r--r--
relnotes: add notes for 6.1.1 This also fixes the header for 6.1 from 6.1rc0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44059
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     1
from __future__ import absolute_import
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
import hashlib
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     5
try:
46785
521ac0d7047f typing: disable import error warnings that are already handled
Matt Harbison <matt_harbison@yahoo.com>
parents: 44059
diff changeset
     6
    from ..thirdparty import sha1dc  # pytype: disable=import-error
44059
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
    sha1 = sha1dc.sha1
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
except (ImportError, AttributeError):
7126d8b8e0e6 hashutil: new package for hashing-related features
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
    sha1 = hashlib.sha1