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__/journal.cpython-39.opt-1.pyc
a

�+�b�O�@szdZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZmZddlmZmZmZiZe�e�ZdZ dZ!d	Z"d
Z#e"ej$iZ%dd�Z&d
d�Z'dd�Z(dd�Z)dd�Z*dd�Z+dd�Z,dd�Z-dd�Z.dd�Z/dd �Z0Gd!d"�d"e�1d"d#��Z2Gd$d%�d%e3�Z4d&Z5ed'd(d)gd*d+�ej6D�d,ej7d-�d.d/��Z8dS)0z�track previous positions of bookmarks (EXPERIMENTAL)

This extension adds a new command: `hg journal`, which shows you where
bookmarks were previously located.

�)�absolute_importN)�_)�bin�hex)
�	bookmarks�cmdutil�dispatch�encoding�error�
extensions�hg�	localrepo�lock�
logcmdutil�pycompat�	registrar�util)�dateutil�procutil�
stringutilsships-with-hg-coresbookmarks
wdirparentcCsNt�tdt�t�tjdt�t�tj	dt
�t�tdt�t�tdt
�dS)Ns
runcommands_write�dirstates	postshares	copystore)rZwrapfunctionr�
runcommandr�bmstore�recordbookmarksZ
wrapfilecacher
Zlocalrepository�wrapdirstater�
wrappostshare�unsharejournal)�ui�r�3/usr/lib64/python3.9/site-packages/hgext/journal.py�extsetupFs�r cCs@|��r<t|�|_|j�d�t�|d�\}}|r<t||�dS)N�namejournalr)�local�journalstorage�journalZ_wlockfreeprefix�addr
Zisfilecached�_setupdirstate)r�repo�dirstate�cachedrrr�	reposetupPs
r*cGs tj|�|||||g|�R�S)z;Track the command line options for recording in the journal)r#�
recordcommand)�origZluir'�cmd�fullargs�argsrrrr]s
rcCs|j|_|�dt�dS�N�journal)r$r#Zaddparentchangecallback�recorddirstateparents)r'r(rrrr&csr&cCs"||�}t�|d�rt||�|S)z5Make journal storage available to the dirstate objectr$)r�safehasattrr&)r,r'r(rrrris
rcCsrt|�}t|�}t�|d�rn|d|jjkr8|dd�n|}|d|jjkrX|dd�n|}|j�td||�dS)z3Records all dirstate parent changes in the journal.r#�N�.)�listrr3Z_nodeconstants�nullidr#�record�wdirparenttype)r(�old�new�	oldhashes�	newhashesrrrr2qs  �r2cCsb|j}t�|d�rXt�|�}t�|�D]0\}}|�||j�}||kr&|j	�
t|||�q&|||�S)z,Records all bookmark changes in the journal.r$)Z_reporr3rrrZ	iteritems�getr7r$r8�bookmarktype)r,�store�fpr'ZoldmarksZmark�valueZoldvaluerrrrs
rc
CsTzt|j�d����WStyN}z |jtjkr4�t�WYd}~Sd}~00dS)z,A set of shared features for this repository�sharedN)�set�vfs�read�
splitlines�IOError�errno�ENOENT)r'�instrrr�_readsharedfeatures�srLc	os�|�dt�}dd�|D�}i}t|�D]2\}}zt|�||g||<Wq&tyVYq&0q&|r�|t�|��\}}}|Vzt|�||d<WqZty�||=YqZ0qZdS)z�Given a set of sorted iterables, yield the next entry in merged order

    Note that by default entries go from most recent to oldest.
    �ordercSsg|]}t|��qSr)�iter)�.0�itrrr�
<listcomp>��z%_mergeentriesiter.<locals>.<listcomp>rN)�pop�max�	enumerate�next�
StopIterationrZ
itervalues)�	iterables�kwargsrMZiterable_map�keyrPrBrrr�_mergeentriesiter�sr[c	Kst|���X|||fi|��|�dd��}|�d�Wd�n1sH0YWd�n1sf0YdS)z<Mark this shared working copy as sharing journal informationrC�asjournal
N)ZwlockrE�write)r,Z
sourcerepoZdestreporYrArrrr�s
rc
s�|j|kr�|��r�t�|d�r�t�|�}t|��|r��dhkr�|j�d�rf|j�	d�}t�
||d�|j}|j|jddd�}�fdd	�|j|jdd
�D�}t
||td�D]}	|�|j|	�q�||||�S)z9Copy shared journal entries into this repo when unsharingr$r1r!s.baksnamejournal.bakF)�filename�_newestfirstc3s"|]}t�|j��vr|VqdS�N)�sharednamespacesr>�	namespace�rO�e��sharedfeaturesrr�	<genexpr>�s�z!unsharejournal.<locals>.<genexpr>)r_)rM)�path�sharedrr3r�sharedreposourcerLrE�exists�join�renamer$�_openr[�min�_write)
r,rr'Zrepopath�
sharedrepoZjournalpathZstorager"ri�entryrrerr�s,��
�
�
�rc@s.eZdZdZedd��Zdd�Ze�e�Z	dS)�journalentrya�Individual journal entry

    * timestamp: a mercurial (time, timezone) tuple
    * user: the username that ran the command
    * namespace: the entry namespace, an opaque string
    * name: the name of the changed item, opaque string with meaning in the
      namespace
    * command: the hg command that triggered this record
    * oldhashes: a tuple of one or more binary hashes for the old location
    * newhashes: a tuple of one or more binary hashes for the new location

    Handles serialisation from and to the storage format. Fields are
    separated by newlines, hashes are written out in hex separated by commas,
    timestamp and timezone are separated by a space.

    cCs~|�d�\}}}}}}}|��\}	}
t|	�t|
�}	}
tdd�|�d�D��}tdd�|�d�D��}||	|
f||||||�S)N�
css|]}t|�VqdSr`�r�rO�hashrrrrg�rRz+journalentry.fromstorage.<locals>.<genexpr>�,css|]}t|�VqdSr`rurvrrrrg�rR)�split�float�int�tuple)�cls�line�time�user�commandrb�namer<r=�	timestampZtzrrr�fromstorage�s,
��zjournalentry.fromstoragec	Cs`d�ttj|j��}d�dd�|jD��}d�dd�|jD��}d�||j|j|j	|j
||f�S)z bytes representation for storage� rxcSsg|]}t|��qSr�rrvrrrrQ
rRz*journalentry.__bytes__.<locals>.<listcomp>cSsg|]}t|��qSrr�rvrrrrQrRrt)rl�mapr�bytestrr�r<r=r�r�rbr�)�selfrr<r=rrr�	__bytes__
s��zjournalentry.__bytes__N)
�__name__�
__module__�__qualname__�__doc__�classmethodr�r�r	Z	strmethod�__str__rrrrrs�s

rsz9timestamp user command namespace name oldhashes newhashesc@steZdZdZdZdZdd�Zedd��Ze	dd	��Z
d
d�Zdd
�Zdd�Z
dd�Zddd�Zdd�Zddd�ZdS)r#aeStorage for journal entries

    Entries are divided over two files; one with entries that pertain to the
    local working copy *only*, and one with entries that are shared across
    multiple working copies when shared using the share extension.

    Entries are stored with NUL bytes as separators. See the journalentry
    class for the per-entry structure.

    The file format starts with an integer version, delimited by a NUL.

    This storage uses a dedicated lock; this makes it easier to avoid issues
    with adding entries that added when the regular wlock is unlocked (e.g.
    the dirstate).

    rNcCsbt��|_|j|_|j|_d|_|_|��r^t|�}t	�
|�}|dur^d|vr^|j|_||_dSr0)rZgetuserr�rrErf�	sharedvfsrirLrrj)r�r'Zfeaturesrqrrr�__init__3s

zjournalstorage.__init__cCs2d�ttjtj��}d|vr.|�d�dd}|S)Nr�rtrs ...)rlr�rZ
shellquoter#�_currentcommand�	partition)r�Z
commandstrrrrr�Bs�zjournalstorage.commandcGs
||_dS)z:Set the current hg arguments, stored with recorded entriesN)r�)r}r.rrrr+Lszjournalstorage.recordcommandcCs(|durdS|�}|dus |js$dS|S)zoReturns the lock if it's held, or None if it's not.

        (This is copied from the localrepo class)
        N)Zheld)r�Zlockref�lrrr�_currentlockSszjournalstorage._currentlockc
Cs�|�|j�durt�td���td�|j}ztj|dd|d�}Wnrtjy�}zX|j�	td�||j
f�tj|d|j�dd	�|d�}|j�	td
�|j�WYd}~n
d}~00t
�|�|_|S)z"Create a lock for the journal fileNs%journal lock does not support nestings
journal of %ssnamejournal.lockr)�descs"waiting for lock on %s held by %r
suistimeoutsgot lock after %s seconds
)r��_lockrefr
�Abortr�baserZLockHeldr�warnZlockerZ	configintZdelay�weakref�ref)r�rEr�r�rKrrr�jlock_s$��,zjournalstorage.jlockcCsrt|t�s|g}t|t�s |g}tt��|j|j||||�}|j}|jdurbt	�
|�|jvrb|j}|�||�dS)a�Record a new journal entry

        * namespace: an opaque string; this can be used to filter on the type
          of recorded entries.
        * name: the name defining this entry; for bookmarks, this is the
          bookmark name. Can be filtered on when retrieving entries.
        * oldhashes and newhashes: each a single binary hash, or a list of
          binary hashes. These represent the old and new position of the named
          item.

        N)
�
isinstancer6rsrZmakedater�r�rEr�rar>rfrp)r�rbr�r<r=rrrErrrr8us$

�

zjournalstorage.recordc	Cs�|�|���|ddd���}|�dtj�|�d��d�d}|r||dtkr||j�t	d�|�Wd�Wd�dS|s�|�
dtd�|�dtj�|�
t|�d�Wd�n1s�0YWd�n1s�0YdS)	Nr!sa+b)�moder���%ds&unsupported journal file version '%s'
)
r��seek�os�SEEK_SETrFr��storageversionrr�rr]�SEEK_END�bytes)r�rErr�f�versionrrrrp�s
�zjournalstorage._writeccsh|durt�|�d}|dur,t�|�d}|D]2}|durH||j�sHq0|dur\||j�s\q0|Vq0dS)aUYield all journal entries with the given namespace or name

        Both the namespace and the name are optional; if neither is given all
        entries in the journal are produced.

        Matching supports regular expressions by using the `re:` prefix
        (use `literal:` to match names or namespaces that start with `re:`)

        N���)rZ
stringmatcherrbr�)r�rbr�rrrrr�filtered�s
zjournalstorage.filteredcs>���j�}�jdur|S�fdd����j�D�}t||�S)zlIterate over the storage

        Yields journalentry instances for each contained journal record.

        Nc3s$|]}t�|j��jvr|VqdSr`)rar>rbrfrc�r�rrrg�s�z*journalstorage.__iter__.<locals>.<genexpr>)rnrEr�r[)r�r"rirr�r�__iter__�s


�zjournalstorage.__iter__r!Tc	cs�|�|�sdS||��}|��}Wd�n1s40Y|�d�}|oR|d}|dtkr~|pjtd�}t�td�|��|dd�}|r�t|�}|D]}|s�q�t�	|�Vq�dS)Nr�rr�s
not availables!unknown journal file version '%s'r4)
rkrFryr�rr
r��reversedrsr�)	r�rEr^r_r��raw�linesr�r~rrrrn�s 

&
zjournalstorage._open)NN)r!T)r�r�r�r�r�r�r��propertyr�r�r+r�r�r8rpr�r�rnrrrrr#s
	
$
r#)s	no-mergessgraphr1)rR�allNsshow history for all names)�c�commitsNsshow commit metadatacCsg|]}|dtvr|�qS)r4)�_ignoreopts)rO�optrrrrQ�rRrQs[OPTION]... [BOOKMARKNAME])Zhelpcategorycs2t�|�}d}|�d�r.|r*t�td���d}|r:|d}|�d|���fdd�}|�d	�d
kr�|durrtd�}nd|}|�td
�|�t�	|�}d}|�
d�t|jj
|d��D�]T\}	}|	|kr��q�����|jdd||j����dd||j����|jdd|j���|�d��p.|�d�dd|j���|jdd��|jd����dd|j�|�d�r�����r�t�|||�}
ntj||��d�|d�}
|jD]Z}z||}|
�|�Wn<tj�y�}
z �� d t�!|
��WYd}
~
n
d}
~
00�q�|
�"�q���#�|du�r.|�td!��dS)"azshow the previous position of bookmarks and the working copy

    The journal is used to see the previous commits that bookmarks and the
    working copy pointed to. By default the previous locations for the working
    copy.  Passing a bookmark name will show all the previous positions of
    that bookmark. Use the --all switch to show previous locations for all
    bookmarks and the working copy; each line will then include the bookmark
    name, or '.' for the working copy, as well.

    If `name` starts with `re:`, the remainder of the name is treated as
    a regular expression. To match a name that actually starts with `re:`,
    use the prefix `literal:`.

    By default hg journal only shows the commit hash and the command that was
    running at that time. -v/--verbose will show the prior hash, the user, and
    the time at which it happened.

    Use -c/--commits to output log information on each commit hash; at this
    point you can use the usual `--patch`, `--git`, `--stat` and `--template`
    switches to alter the log output for these.

    `hg journal -T json` can be used to produce machine readable output.

    r5r�s/You can't combine --all and filtering on a nameNrr1cs�jt�j|�ddd�S)Nsnoderx)r��sep)Z
formatlistr�Zhexfunc)Znodes�Zfmrr�formatnodes'szjournal.<locals>.formatnodesstemplatesjsonsthe working copy and bookmarkss'%s'sprevious locations of %s:
)r�soldnodess%s -> snewnodess%ssusers %-8ssre:snames  %-8ssdates %ss%Y-%m-%d %H:%M %1%2scommands  %s
r�s
changesets)Zdiffoptss%s

sno recorded locations
)$rZbyteskwargsr>r
r�r�	formatter�statusrZgetlimitZpagerrUr$r�Z	startitemZ	condwrite�verboser<r]r=r��
startswithr�Z
formatdater�r�ZisplainZchangesetdisplayerZchangesetformatter�nestedZshowZRepoLookupErrorZplainr��close�end)rr'r/Zoptsr�r�Zdisplayname�limitrr�countZ	displayerrw�ctxrdrr�rr$�st#

�


���

�
.

r$)9r�Z
__future__r�collectionsrIr�r�Zmercurial.i18nrZmercurial.noderrZ	mercurialrrrr	r
rrr
rrrrrZmercurial.utilsrrrZcmdtabler�Z
testedwithr�r?r9Zsharedbookmarksrar r*rr&rr2rrLr[rr�
namedtuplers�objectr#r�ZlogoptsZCATEGORY_CHANGE_ORGANIZATIONr$rrrr�<module>s`<
�




��DW���

Youez - 2016 - github.com/yon3zu
LinuXploit