File: //usr/lib/python3/dist-packages/hgext/__pycache__/win32text.cpython-310.pyc
o
�]Lb� � @ s* d Z ddlmZ ddlZddlmZ ddlmZ ddlm Z m
Z
mZmZ ddl
mZ dZi Ze�e�Zed d
dd� e�d
ej�Zddd�Zddd�Zd2dd�Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zeeeeeeeed%�Z d&d'� Z!d(d)� Z"d*d+� Z#d,d-� Z$d.d/� Z%d0d1� Z&dS )3a perform automatic newline conversion (DEPRECATED)
Deprecation: The win32text extension requires each user to configure
the extension again and again for each clone since the configuration
is not copied when cloning.
We have therefore made the ``eol`` as an alternative. The ``eol``
uses a version controlled file for its configuration and each clone
will therefore use the right settings from the start.
To perform automatic newline conversion, use::
[extensions]
win32text =
[encode]
** = cleverencode:
# or ** = macencode:
[decode]
** = cleverdecode:
# or ** = macdecode:
If not doing conversion, to make sure you do not commit CRLF/CR by accident::
[hooks]
pretxncommit.crlf = python:hgext.win32text.forbidcrlf
# or pretxncommit.cr = python:hgext.win32text.forbidcr
To do the same check on a server to prevent CRLF/CR from being
pushed or pulled::
[hooks]
pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
# or pretxnchangegroup.cr = python:hgext.win32text.forbidcr
� )�absolute_importN)�_)�short)�cmdutil�
extensions�pycompat� registrar)�
stringutils ships-with-hg-core� win32text� warnT)�defaults (^|[^
])
s CRLFs CR)�
�
s clevers macc C sL || v r|r |r"|r$|� td�|t| |j�d�f � d S d S d S d S d S )Ns� WARNING: %s already has %s line endings
and does not need EOL conversion by the win32text plugin.
Before your next commit, please reconsider your encode/decode settings in
Mercurial.ini or %s.
s hgrc)�warnr �
newlinestr�vfs�join)�s�newline�ui�repo�filename� r �1/usr/lib/python3/dist-packages/hgext/win32text.py�checknewlineO s ����r c K s t | dfi |�� t�d| �S )Nr
s \1
)r �re_single_lf�sub�r �cmd�kwargsr r r �
dumbdecode` s r c C � | � dd�S )Nr
�
��replace�r r r r r �
dumbencodef � r&