403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/__pycache__/eol.cpython-39.pyc
a

�+�b�@�@s8dZddlmZddlZddlZddlmZddlmZm	Z
mZmZm
Z
mZmZmZddlmZdZiZe�e�Zedd	d
d�edde
jd�edd
dd�e�d�Zdd�Zdd�Zdd�Zdd�Zeeeeed�ZGdd�de�Zdd�Z dd�Z!dd �Z"d!d"�Z#d#d$�Z$e$Z%d%d&�Z&d'd(�Z'd)d*�Z(d+d,�Z)dS)-a6automatically manage newlines in repository files

This extension allows you to manage the type of line endings (CRLF or
LF) that are used in the repository and in the local working
directory. That way you can get CRLF line endings on Windows and LF on
Unix/Mac, thereby letting everybody use their OS native line endings.

The extension reads its configuration from a versioned ``.hgeol``
configuration file found in the root of the working directory. The
``.hgeol`` file use the same syntax as all other Mercurial
configuration files. It uses two sections, ``[patterns]`` and
``[repository]``.

The ``[patterns]`` section specifies how line endings should be
converted between the working directory and the repository. The format is
specified by a file pattern. The first match is used, so put more
specific patterns first. The available line endings are ``LF``,
``CRLF``, and ``BIN``.

Files with the declared format of ``CRLF`` or ``LF`` are always
checked out and stored in the repository in that format and files
declared to be binary (``BIN``) are left unchanged. Additionally,
``native`` is an alias for checking out in the platform's default line
ending: ``LF`` on Unix (including Mac OS X) and ``CRLF`` on
Windows. Note that ``BIN`` (do nothing to line endings) is Mercurial's
default behavior; it is only needed if you need to override a later,
more general pattern.

The optional ``[repository]`` section specifies the line endings to
use for files stored in the repository. It has a single setting,
``native``, which determines the storage line endings for files
declared as ``native`` in the ``[patterns]`` section. It can be set to
``LF`` or ``CRLF``. The default is ``LF``. For example, this means
that on Windows, files configured as ``native`` (``CRLF`` by default)
will be converted to ``LF`` when stored in the repository. Files
declared as ``LF``, ``CRLF``, or ``BIN`` in the ``[patterns]`` section
are always stored as-is in the repository.

Example versioned ``.hgeol`` file::

  [patterns]
  **.py = native
  **.vcproj = CRLF
  **.txt = native
  Makefile = LF
  **.jpg = BIN

  [repository]
  native = LF

.. note::

   The rules will first apply when files are touched in the working
   directory, e.g. by updating to null and back to tip to touch all files.

The extension uses an optional ``[eol]`` section read from both the
normal Mercurial configuration files and the ``.hgeol`` file, with the
latter overriding the former. You can use that section to control the
overall behavior. There are three settings:

- ``eol.native`` (default ``os.linesep``) can be set to ``LF`` or
  ``CRLF`` to override the default interpretation of ``native`` for
  checkout. This can be used with :hg:`archive` on Unix, say, to
  generate an archive where files have line endings for Windows.

- ``eol.only-consistent`` (default True) can be set to False to make
  the extension convert files with inconsistent EOLs. Inconsistent
  means that there is both ``CRLF`` and ``LF`` present in the file.
  Such files are normally not touched under the assumption that they
  have mixed EOLs on purpose.

- ``eol.fix-trailing-newline`` (default False) can be set to True to
  ensure that converted files end with a EOL character (either ``\n``
  or ``\r\n`` as per the configured patterns).

The extension provides ``cleverencode:`` and ``cleverdecode:`` filters
like the deprecated win32text extension does. This means that you can
disable win32text and enable eol and your filters will still work. You
only need to these filters until you have prepared a ``.hgeol`` file.

The ``win32text.forbid*`` hooks provided by the win32text extension
have been unified into a single hook named ``eol.checkheadshook``. The
hook will lookup the expected line endings from the ``.hgeol`` file,
which means you must migrate to a ``.hgeol`` file first before using
the hook. ``eol.checkheadshook`` only checks heads, intermediate
invalid revisions will be pushed. To forbid them completely, use the
``eol.checkallhook`` hook. These hooks are best used as
``pretxnchangegroup`` hooks.

See :hg:`help patterns` for more information about the glob patterns
used.
�)�absolute_importN)�_)�config�error�
extensions�match�pycompat�	registrar�scmutil�util)�
stringutilsships-with-hg-core�eol�fix-trailing-newlineF)�default�native�only-consistentTs	(^|[^
])
cCsd|vot�|�S)N�
)�singlelf�search)�data�r�//usr/lib64/python3.9/site-packages/hgext/eol.py�inconsistenteol�srcKsRt�|�r|S|�dd�r&t|�r&|S|�dd�rH|rH|�d�sH|d}t�|�S)zFilter to convert to LF EOLs.r
rr�
)r�binary�
configboolr�endswithr�tolf��s�params�ui�kwargsrrrr�s

���rcKsRt�|�r|S|�dd�r&t|�r&|S|�dd�rH|rH|�d�sH|d}t�|�S)zFilter to convert to CRLF EOLs.r
rrr)rrrrrr�tocrlfrrrrr#�s

���r#cKs|S)z#Filter to do nothing with the file.rrrrr�isbinary�sr$)�to-lf�to-crlf�	is-binarys
cleverencode:s
cleverdecode:c@s$eZdZdd�Zdd�Zdd�ZdS)�eolfilecCsdddd�|_dddd�|_t��|_|j�dddd�|j�d	|�|j�d
d�dk}|r`dpbd|jd
<|�dd�dv}|r�dp�d|jd
<g}g}g|_|j�d�D]P\}}	|	�	�}
|
dkr�|�
|�n
|�
|�t�|d|g�}|j�
||
|f�q�t�|dg||�|_dS)Nr%r&r')�LF�CRLF�BIN�patternss.hg*r+r
�.hgeols
repositoryrr*sNATIVE)r)r�)�_decode�_encoder�cfg�set�parse�get�patterns�items�upper�appendr)�selfr!�rootrZisrepolfZiswdlfZincludeZexclude�patternZstyle�key�mrrr�__init__�s4��

zeolfile.__init__cCs�dd�|jD�}dD]@}|�|�D]0\}}||vr"|�||�dkr"|�||dd�q"q|jD]n\}}}z0|�d||j|d�|�d||j|d�Wq\ty�|�td�||j	�
d	|�f�Yq\0q\|j	�d�D]\}	}
|�d|	|
d�q�dS)
NcSsh|]\}}}|�qSrr)�.0r;r<r=rrr�	<setcomp>�r.z#eolfile.copytoui.<locals>.<setcomp>)�decode�encoder
�!rArBs(ignoring unknown EOL style '%s' from %s
r,)r5ZconfigitemsZconfigsource�	setconfigr/r0�KeyError�warnrr1�sourcer6)r9r!Znewpatterns�sectionZ
oldpattern�_filterr;r<r=�k�vrrr�copytoui�s$��zeolfile.copytouicCs�g}|p|��D]z}||vrq|jD]d\}}}||�s8q$|j|}	||��}
|	dkr^d|
vsp|	dkr�t�|
�r�|�||	t|�f�qq$q|S)Nr%rr&)�filesr5r0rrrr8�bytes)r9�repo�ctxrM�failed�fr;r<r=�targetrrrr�checkrev�s(
����zeolfile.checkrevN)�__name__�
__module__�__qualname__r>rLrTrrrrr(�s'r(c
Cs�zd|D]Z}z>|dur$|�d���}n||d��}t||j|�WWSttfy^Yq0qWn@tjy�}z&|�	t
d�|j|jf�WYd}~n
d}~00dS)Nr-s;warning: ignoring .hgeol file due to parse error at %s: %s
)
�wvfs�readrr(r:�IOError�LookupError�errormodZConfigErrorrFr�location�message)r!rO�nodes�noder�instrrr�parseeols$�
��rbcCs2d|jvrdS|jddddd�t�|dg�dS)a/make sure the extension is enabled when used as hook

    When eol is used through hooks, the extension is never formally loaded and
    enabled. This has some side effect, for example the config declaration is
    never loaded. This function ensure the extension is enabled when running
    hooks.
    r
Ns
extensionsr.sinternal)rG)Z_knownconfigrDrZloadall�r!rrr�
ensureenabled&s
rdcCst|�t�}t�}t�||��t|��D]D}|�|�|r,||}|�|���|�	�D]}|�
|���q\q,g}	|D]6}||}t|||��g�}
|
rz|	�
|
�|||��qz|	�rddd�}g}t|	�D]&\}
}}|�td�|
|||f�q�t�td�d�|���dS)Nr*r))r%r&s*  %s in %s should not have %s line endingssend-of-line check failed:
r)rdr2rZxrange�rev�len�add�updaterM�parents�discardrbr`�extendrT�sortedr8rr\�Abort�join)r!rOr`Z	headsonlyrMZrevsrerPZpctxrQ�eolZeolsZmsgsrRrSrrr�
_checkhook4s8

���rpcKst|||d�dS)�$verify that files have expected EOLsFN�rp�r!rOr`�hooktyper"rrr�checkallhookTsrucKst|||d�dS)rqTNrrrsrrr�checkheadshookYsrvcCst�||�}|�|g�dS)NF)r
Zresolvehexnodeidprefix�loadeol)r!rOrtZparent1Zparent2Zp1noderrr�	preupdatebsrxcCs|�ddtd�dS)Nshookss
preupdate.eolr
)rDrxrcrrr�uisetuphsrycCs4zt�d�|�td��Wnty.Yn0dS)Ns	win32texts?the eol extension is incompatible with the win32text extension
)r�findrFrrErcrrr�extsetupls
��r{csnt|j�|��sdSt�t�D]\}}|�||�q |�dddd�G�fdd�d|j���|_|�	�dS)Nspatchr
sautocs0eZdZdd�Zdd�Zd	��fdd�	Z�ZS)
zreposetup.<locals>.eolrepocSs,t|j||�}|durdS|�|j�|jS)N)rbr!rLr)r9r_rorrrrw�s
z"reposetup.<locals>.eolrepo.loadeolcSs"|�dg�|_|js tj|_dSd}ztj�|j�d��}Wnt	yRd}Yn"0|j�
d�}|rtt|j|j
|�}ztj�|�d��}Wnt	y�d}Yn0||k�r|dk�r|j�d�|j�
d�}t|j|j
|�}d}�z$z�|��}|jD]�}|j�|�j�sq�|du�r�|�|��s0|�|��s0q�d}	|jD] \}
}}||��r:|}	�q\�q:d}
|jD] \}
}}||��rf|}
�q��qf|	|
k�r�q�|j�|�q�|�dd��}|�|�Wd�n1�s�0YWntj�y�Yn0W|du�r|��n|du�r|��0dS)Ns	eol.cacherr-seol: detected change in .hgeol
�w)rw�	_eolmatchr�never�os�path�getmtimeZvfsrn�OSErrorrYr(r!r:Zwjoin�debugrX�wlockZdirstateZ	get_entryZmaybe_cleanrr5Zset_possibly_dirty�writer\ZLockUnavailable�release)r9ZoldeolZ
cachemtimeZolddataZeolmtimeZ	hgeoldataZneweolr�rRZoldkeyr;r<r=Znewkeyrrr�_hgcleardirstate�sd








.

�
z+reposetup.<locals>.eolrepo._hgcleardirstateFNcszt|��|���D]P}|�|�s$q||}|dur6q|��}t�|�rJqt|�rt�	t
d�|��qt�|��|||�S)Ns!inconsistent newline style in %s
)
rlZaddedZmodifiedr}rrrrr\rmr�super�	commitctx)r9rPrZorigctxrRZfctxr)�	__class__�eolreporrr��s


�z$reposetup.<locals>.eolrepo.commitctx)FN)rUrVrWrwr�r��
__classcell__r�r�)r�rr��sAr�)
ryr!�localrZ	iteritems�filtersZ
adddatafilterrDr�r�)r!rO�name�fnrr�r�	reposetupys
\r�)*�__doc__Z
__future__rr�reZmercurial.i18nrZ	mercurialrrr\rrrr	r
rZmercurial.utilsrZ
testedwithZconfigtableZ
configitemZ	oslinesep�compilerrrr#r$r��objectr(rbrdrprurv�hookrxryr{r�rrrr�<module>s\](

���
�
Q 

Youez - 2016 - github.com/yon3zu
LinuXploit