view mercurial/utils/hashutil.py @ 47894:226c7dbeea11

rust-dirstatemap: temporarily use `from_v1_data` in `addfile` We are about to change the `__init__` for `DirstateItem`. To make the transition easier, we move existing caller to `DirstateItem.from_v1_data`. The Rust dirstate map will need an overall once the durst settle anyway. Differential Revision: https://phab.mercurial-scm.org/D11319
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 20 Aug 2021 22:35:52 +0200
parents 521ac0d7047f
children 6000f5b25c9b
line wrap: on
line source

from __future__ import absolute_import

import hashlib

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

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