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 :  /usr/lib64/python3.9/site-packages/hgext/convert/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�+�b�G�@slddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZmZmZmZmZddlmZejZejZdd�ZGd	d
�d
e�Zd%dd�Zejr�ejZejZnej Zej!Zd
d�Z"dd�Z#Gdd�de$�Z%d&dd�Z&Gdd�de$�Z'dZ(Gdd�de�Z)Gdd�de�Z*Gdd�de�Z+Gdd �d e�Z,Gd!d"�d"e-�Z.d#d$�Z/dS)'�)�absolute_importN)�_)�open)�encoding�error�phases�pycompat�util)�procutilcCs|durdS|�d�S)N�latin1)�encode)�d�r�:/usr/lib64/python3.9/site-packages/hgext/convert/common.py�
_encodeornone src@s<eZdZdd�Zdd�Zdd�Zedd��Zed	d
��ZdS)�_shlexpy3proxycCs
||_dS�N��_l)�self�lrrr�__init__'sz_shlexpy3proxy.__init__cCsdd�|jD�S)Ncss|]}t|�VqdSr)r)�.0�vrrr�	<genexpr>+�z*_shlexpy3proxy.__iter__.<locals>.<genexpr>r�rrrr�__iter__*sz_shlexpy3proxy.__iter__cCst|j���Sr)rr�	get_tokenrrrrr-sz_shlexpy3proxy.get_tokencCs|jjp
dS)Ns	<unknown>)r�infilerrrrr0sz_shlexpy3proxy.infilecCs|jjSr)r�linenorrrrr 4sz_shlexpy3proxy.linenoN)	�__name__�
__module__�__qualname__rrr�propertyrr rrrrr&s
rcCs�|dur*tjrt|ddd�}qLt|d�}n"|dur<t�d��tjrL|�d�}tj||dd�}|dur�d|_tjr�|j|�d�7_n|j|7_|dur�tjr�|j	|�d�7_	n|j	|7_	tjr�t
|�S|S)N�rr)rs/shlexer only accepts data or filepath, not bothT)r�posix)r�ispy3rrZProgrammingError�decode�shlexZwhitespace_split�
whitespace�	wordcharsr)�data�filepathr+r*rrrr�shlexer9s.�
r.cCsdd�}t�|�}||�S)NcSs&t|�}dd�t�|�D�}d�|�S)NcSsg|]}|��d�qS)r)�
splitlines)rrrrr�
<listcomp>brz1encodeargs.<locals>.encodearg.<locals>.<listcomp>r)�base64_encodebytesrZiterbytestr�join)�s�linesrrr�	encodearg`szencodeargs.<locals>.encodearg)�pickle�dumps)�argsr5r3rrr�
encodeargs_s
r9cCst|�}t�|�Sr)�base64_decodebytesr6�loads)r3rrr�
decodeargsisr<c@seZdZdS)�MissingToolN�r!r"r#rrrrr=nsr=TcCs6|p|}t�|�s2|rtj}nt}|td�|��dS)Nscannot find required "%s" tool)r
Zfindexer�Abortr=r)Zexe�name�abort�excrrr�	checktoolrs
rCc@seZdZdS)�NoRepoNr>rrrrrD|srDsSKIPc@s(eZdZdddddejddfdd�ZdS)�commitNTc

Cs\|pd|_|pd|_||_||_|p&g|_||_||_|p<i|_||_|	|_	|
|_
||_dS)Nsunknowns0 0)�author�date�desc�parents�
optparents�branch�rev�extra�sortkey�saverev�phase�ctx)
rrFrGrHrIrKrLrMrNrOrPrJrQrrrr�s



zcommit.__init__)r!r"r#rZdraftrrrrrrE�s�rEc@s�eZdZdZd,dd�Zd-dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd.dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd/d*d+�ZdS)0�converter_sourcezConversion source interfaceNcCs"||_||_||_||_d|_dS)zmInitialize conversion source (or raise NoRepo("message")
        exception if path is not a valid repository)�utf-8N)�ui�path�revs�repotyper)rrTrWrUrVrrrr�s
zconverter_source.__init__�	splicemapcCs&t�d|�s"t�td�||f��dS)z{fails if revstr is not a 40 byte hex. mercurial and git both uses
        such format for their revision numbering
        s[0-9a-fA-F]{40,40}$s.%s entry %s is not a valid revision identifierN)�re�matchrr?r�rZrevstrZmapnamerrr�checkhexformat�s��zconverter_source.checkhexformatcCsdSrrrrrr�before�szconverter_source.beforecCsdSrrrrrr�after�szconverter_source.aftercCsdS)z�Returns true if the given targetfile belongs to the source repo. This
        is useful when only a subdirectory of the target belongs to the source
        repo.Tr)rZtargetfilenamerrr�targetfilebelongstosource�sz*converter_source.targetfilebelongstosourcecCsdS)z*set the map of already-converted revisionsNr)r�revmaprrr�	setrevmap�szconverter_source.setrevmapcCst�dS)z(Return a list of this repository's headsN��NotImplementedErrorrrrr�getheads�szconverter_source.getheadscCst�dS)z�Return a pair (data, mode) where data is the file content
        as a string and mode one of '', 'x' or 'l'. rev is the
        identifier returned by a previous call to getchanges().
        Data is None if file is missing/deleted in rev.
        Nrb)rr@rLrrr�getfile�szconverter_source.getfilecCst�dS)aDReturns a tuple of (files, copies, cleanp2).

        files is a sorted list of (filename, id) tuples for all files
        changed between version and its first parent returned by
        getcommit(). If full, all files in that revision is returned.
        id is the source revision id of the file.

        copies is a dictionary of dest: source

        cleanp2 is the set of files filenames that are clean against p2.
        (Files that are clean against p1 are already not in files (unless
        full). This makes it possible to handle p2 clean files similarly.)
        Nrb)r�version�fullrrr�
getchanges�szconverter_source.getchangescCst�dS)z$Return the commit object for versionNrb)rrfrrr�	getcommit�szconverter_source.getcommitcCsdS)zWReturn the number of commits in this source.

        If unknown, return None.
        Nrrrrr�
numcommits�szconverter_source.numcommitscCst�dS)zdReturn the tags as a dictionary of name: revision

        Tag names must be UTF-8 strings.
        Nrbrrrr�gettags�szconverter_source.gettagscCs�|s|jpd}t|tj�r$|�d�Sz|�t�|���d�WSty�z|�d��d�WYSty�|�t�|�d��d�YYS0Yn0dS)NrSzutf-8zlatin-1�replace)r�
isinstancerZunicoderr(Zsysstr�UnicodeError)rr3rrrr�recode�s

�zconverter_source.recodecCst�dS)aJReturn the files changed by rev compared to parent[i].

        i is an index selecting one of the parents of rev.  The return
        value should be the list of files that are different in rev and
        this parent.

        If rev has no parents, i is None.

        This function is only needed to support --filemap
        Nrb)rrL�irrr�getchangedfilessz converter_source.getchangedfilescCsdS)z5Notify the source that a revision has been converted.Nr)rrLZsinkrevrrr�	convertedszconverter_source.convertedcCsdS)z�Return true if this source has a meaningful, native revision
        order. For instance, Mercurial revisions are store sequentially
        while there is no such global ordering with Darcs.
        Frrrrr�hasnativeorderszconverter_source.hasnativeordercCsdS)z7Return true if this source has ability to close branch.Frrrrr�hasnativecloseszconverter_source.hasnativeclosecCsdS)z�If rev is a meaningful revision reference in source, return
        the referenced identifier in the same format used by getcommit().
        return None otherwise.
        Nr�rrLrrr�	lookuprev!szconverter_source.lookuprevcCsiS)zpReturn the bookmarks as a dictionary of name: revision

        Bookmark names are to be UTF-8 strings.
        rrrrr�getbookmarks(szconverter_source.getbookmarkscCsdS)z�revstr is a string that describes a revision in the given
        source control system.  Return true if revstr has correct
        format.
        Trr[rrr�checkrevformat/szconverter_source.checkrevformat)NN)rX)N)rX)r!r"r#�__doc__rr\r]r^r_rardrerhrirjrkrorqrrrsrtrvrwrxrrrrrR�s*





rRc@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�converter_sinkz"Conversion sink (target) interfacecCs||_||_g|_||_dS)z�Initialize conversion sink (or raise NoRepo("message")
        exception if path is not a valid repository)

        created is a list of paths to remove if a fatal error occurs
        laterN)rTrUZcreatedrW)rrTrWrUrrrr:szconverter_sink.__init__cCst�dS)z�Path to a file that will contain lines
        source_rev_id sink_rev_id
        mapping equivalent revision identifiers for each system.Nrbrrrr�
revmapfileEszconverter_sink.revmapfilecCsdS)z�Path to a file that will contain lines
        srcauthor=dstauthor
        mapping equivalent authors identifiers for each system.Nrrrrr�
authorfileKszconverter_sink.authorfilec		Cst�dS)a�Create a revision with all changed files listed in 'files'
        and having listed parents. 'commit' is a commit object
        containing at a minimum the author, date, and message for this
        changeset.  'files' is a list of (path, version) tuples,
        'copies' is a dictionary mapping destinations to sources,
        'source' is the source repository, and 'revmap' is a mapfile
        of source revisions to converted revisions. Only getfile() and
        lookuprev() should be called on 'source'. 'full' means that 'files'
        is complete and all other files should be removed.
        'cleanp2' is a set of the filenames that are unchanged from p2
        (only in the common merge case where there two parents).

        Note that the sink repository is not told to update itself to
        a particular revision (or even what that revision would be)
        before it receives the file data.
        Nrb)	r�filesZcopiesrIrE�sourcer`rgZcleanp2rrr�	putcommitQszconverter_sink.putcommitcCst�dS)z�Put tags into sink.

        tags: {tagname: sink_rev_id, ...} where tagname is an UTF-8 string.
        Return a pair (tag_revision, tag_parent_revision), or (None, None)
        if nothing was changed.
        Nrb)r�tagsrrr�puttagsfszconverter_sink.puttagscCsdS)z�Set the current branch name. Called before the first putcommit
        on the branch.
        branch: branch name for subsequent commits
        pbranches: (converted parent revision, parent branch) tuplesNr)rrKZ	pbranchesrrr�	setbranchoszconverter_sink.setbranchcCsdS)a;Tell the destination that we're using a filemap

        Some converter_sources (svn in particular) can claim that a file
        was changed in a revision, even if there was no change.  This method
        tells the destination that we're using a filemap and that it should
        filter empty revisions.
        Nr)rZactiverrr�setfilemapmodeuszconverter_sink.setfilemapmodecCsdSrrrrrrr]~szconverter_sink.beforecCsdSrrrrrrr^�szconverter_sink.aftercCsdS)z�Put bookmarks into sink.

        bookmarks: {bookmarkname: sink_rev_id, ...}
        where bookmarkname is an UTF-8 string.
        Nr)rZ	bookmarksrrr�putbookmarks�szconverter_sink.putbookmarkscCst�dS)zPReturn False if a rev mentioned in a filemap is known to not be
        present.Nrbrurrr�hascommitfrommap�szconverter_sink.hascommitfrommapcCst�dS)z�This method is for the special needs for splicemap handling and not
        for general use. Returns True if the sink contains rev, aborts on some
        special cases.Nrbrurrr�hascommitforsplicemap�sz$converter_sink.hascommitforsplicemapN)r!r"r#ryrr{r|rr�r�r�r]r^r�r�r�rrrrrz7s		rzc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zd#dd�Z
dd�Zdd�Zedd��Zdd�Zd d!�Zd"S)$�commandlinecCs||_||_dSr)rT�command)rrTr�rrrr�szcommandline.__init__cCsdSrrrrrr�prerun�szcommandline.preruncCsdSrrrrrr�postrun�szcommandline.postrunc	Os�t�|�}|j|gt|�}t�|�D]�\}}t|�dkrJ|�d|�n|�d|�dd��z4t|�dkr~|�d|�n|dd|7<Wq&ty�Yq&0q&dd	�|D�}|j	j
s�|d
t�tj
�g7}d�|�}|S)N��-s--�_r����=cSsg|]}t�|��qSr)r
Z
shellquote)r�argrrrr0�rz(commandline._cmdline.<locals>.<listcomp>s2>� )rZbyteskwargsr��listZ	iteritems�len�appendrl�	TypeErrorrTZ	debugflagZbytestr�os�devnullr2)r�cmdr8�kwargs�cmdline�krrrr�_cmdline�s"

zcommandline._cmdlinecOs"dd�}|j||g|�Ri|��S)NcSs"tjt�|�ddtjtjd�}|S)NTr�)�shell�bufsizeZ	close_fds�stdout)�
subprocess�Popenr
ZtonativestrZclosefds�PIPE)r��prrr�popen�s�zcommandline._run.<locals>.popen)�_dorun)rr�r8r�r�rrr�_run�s
zcommandline._runcOs|jtj|g|�Ri|��Sr)r�r
Zpopen2�rr�r8r�rrr�_run2�szcommandline._run2cOs|jtj|g|�Ri|��Sr)r�r
Zpopen3r�rrr�_run3�szcommandline._run3cOsT|j|g|�Ri|��}|j�d|f�|��z||�W|��S|��0dS)Nsrunning: %s
)r�rT�debugr�r�)rZopenfuncr�r8r�r�rrrr��s�zcommandline._doruncOs:|j|g|�Ri|��}|��d}|j�|�||jfS)Nr)r�ZcommunicaterTr��
returncode�rr�r8r�r��outputrrr�run�szcommandline.runcOsF|j|g|�Ri|��}|j��}|��|j�d�|��||jfS�Nr)r�r��	readlines�waitrTr�r2r�r�rrr�runlines�s

zcommandline.runlinesrcCsL|rH|r*|j�td�|j�|j�|�t�|�}t�d|j|f��dS)Ns
%s error:
s%s %s)rT�warnrr�r
Zexplainexitrr?)r�statusr��msgrrr�	checkexit�s
zcommandline.checkexitcOs,|j|g|�Ri|��\}}|�||�|Sr)r�r��rr�r8r�r�r�rrr�run0�szcommandline.run0cOs2|j|g|�Ri|��\}}|�|d�|��|Sr�)r�r�r2r�rrr�	runlines0�szcommandline.runlines0c	Cs6d}zt�d�}Wnttfy(Yn0|ddS)Ni�
SC_ARG_MAX�r�)r��sysconf�AttributeError�
ValueError)r�argmaxrrrr��s	zcommandline.argmaxcos�t|j|g|�Ri|���}|j|}d}g}|D]L}	t|	�d}
||
|ksZt|�dkrn|�|	�||
7}q2|V|	g}|
}q2|r�|VdS)Nr�)r�r�r�r�)r�arglistr�r8r�Zcmdlen�limitZnumbytesZfl�fn�brrr�_limit_arglists


zcommandline._limit_arglistcOsD|j||g|�Ri|��D]$}|j|gt|�|�Ri|��qdSr)r�r�r�)rr�r�r8r�rrrr�xargsszcommandline.xargsN)r)r!r"r#rr�r�r�r�r�r�r�r�r�r�r�r��
propertycacher�r�r�rrrrr��s"
	

r�cs<eZdZ�fdd�Z�fdd�Z�fdd�Zdd�Z�ZS)	�mapfilecs2tt|���||_||_d|_g|_|��dSr)�superr�rrTrU�fp�order�_read)rrTrU��	__class__rrrszmapfile.__init__c
s�|js
dSzt|jd�}Wn4tyN}z|jtjkr8�WYd}~dSd}~00tt�|��D]�\}}|��d�	�}|s|q^z|�
dd�\}}Wn.ty�t�
td�|j|df��Yn0||vr�|j�|�tt|��||�q^|��dS)Nsrbrr�r�s/syntax error in %s(%d): key/value pair expected)rUr�IOError�errno�ENOENT�	enumerater	Ziterfiler/�rstrip�rsplitr�rr?rr�r�r�r��__setitem__�close)rr��errrp�line�key�valuer�rrr�#s0��
z
mapfile._readc
s�|jdurbzt|jd�|_WnDty`}z,t�td�|jt�|j	�f��WYd}~n
d}~00|j�
t�d||f��|j�
�tt|��||�dS)Nsabscould not open map file %r: %ss%s %s
)r�rrUr�rr?rrZ
strtolocal�strerror�writer	Ztonativeeol�flushr�r�r�)rr�r�r�r�rrr�=s
��
zmapfile.__setitem__cCs|jr|j��d|_dSr)r�r�rrrrr�Js
z
mapfile.close)r!r"r#rr�r�r��
__classcell__rrr�rr�s
r�cCs0tj�|�tj�|�}|jd|j}||fS)z?Like dateutil.makedate() but for time t instead of current timei�Q)�datetimeZutcfromtimestampZ
fromtimestampZdaysZseconds)�tZdeltaZtzrrr�makedatetimestampPs�
�r�)NNNN)NT)0Z
__future__r�base64r�r�r�rYr)r�Zmercurial.i18nrZmercurial.pycompatrZ	mercurialrrrrr	Zmercurial.utilsr
r6r�r�objectrr.r'Zencodebytesr1Zdecodebytesr:ZencodestringZdecodestringr9r<�	Exceptionr=rCrDZSKIPREVrErRrzr��dictr�r�rrrr�<module>sF



`6

Youez - 2016 - github.com/yon3zu
LinuXploit