/
lib64
/
python3.9
/
site-packages
/
hgext
/
git
/
__pycache__
/
Upload File
HOME
a �+�bU � @ sb d Z ddlmZ ddlmZmZmZ ddlmZ da dd� Z dd � Zd d� Zdd � Z eej�ZdS )z*utilities to assist in working with pygit2� )�absolute_import)�bin�hex�sha1nodeconstants)�pycompatNc C s6 t d u r2zdd la t j W n ttfy0 Y n0 t S )Nr )� pygit2_moduleZpygit2ZInvalidSpecError�ImportError�AttributeError� r r �7/usr/lib64/python3.9/site-packages/hgext/git/gitutil.py� get_pygit2 s r c C s: t � } d}| r,z | j}W n ty* Y n0 d|�d� S )NzN/As (pygit2 %s)zutf-8)r �__version__r �encode)�mod�vr r r �pygit2_version s r c C s t | �dksJ �t�t| ��S )z�Wrapper to convert a Mercurial binary node to a unicode hexlified node. pygit2 and sqlite both need nodes as strings, not bytes. � )�lenr Zsysstrr ��nr r r � togitnode$ s r c C s, t | �dksJ �tjr$t| �d��S t| �S )zOpposite of togitnode.�( �ascii)r r Zispy3r r r r r r �fromgitnode- s r )�__doc__Z __future__r Zmercurial.noder r r Z mercurialr r r r r r ZnullidZnullgitr r r r �<module> s