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/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�+�b��@s�ddlmZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZmZm
Z
mZmZmZmZddlmZd	Zd
d�Zdd
�Zdd�ZGdd�de�Zdd�Zdd�Zdd�Zdd�Zdd�Z dd�Z!dd�Z"d d!�Z#d"d#�Z$d$d%�Z%d&d'�Z&d(d)�Z'dSd*d+�Z(d,d-�Z)d.d/�Z*e�+d0�Z,d1d2�Z-d3d4�Z.d5d6�Z/dTd8d9�Z0dUd:d;�Z1dVd<d=�Z2d>d?�Z3d@dA�Z4dBdC�Z5dDdE�Z6dFdG�Z7dWdIdJ�Z8dXdKdL�Z9dMdN�Z:dYdOdP�Z;dQdR�Z<dS)Z�)�absolute_importN�)�_)�bin�hex�short)�getattr)�encoding�error�obsutil�pycompat�requirements�scmutil�txnutil�util)�urlutils"bookmarks.active bookmarks.currentcCstj|jvS�N)r
ZBOOKMARKS_IN_STORE_REQUIREMENT��repo�r�9/usr/lib64/python3.9/site-packages/mercurial/bookmarks.py�bookmarksinstore)srcCst|�r|jS|jSr)r�svfs�vfsrrrr�bookmarksvfs-srcCst�|jt|�d�\}}|S)z�Hook so that extensions that mess with the store can hook bm storage.

    For core, this just handles wether we should see pending
    bookmarks or the committed ones. Other extensions (like share)
    may need to tweak this behavior further.
    �	bookmarks)rZ
trypending�rootr)r�fp�pendingrrr�
_getbkfile1s�rc@s�eZdZdZdd�Zedd��Zejdd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zd/dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd0d-d.�ZdS)1�bmstorea�Storage for bookmarks.

    This object should do all bookmark-related reads and writes, so
    that it's fairly simple to replace the storage underlying
    bookmarks without having to clone the logic surrounding
    bookmarks. This type also should manage the active bookmark, if
    any.

    This particular bmstore implementation stores bookmarks as
    {hash}\s{name}\n (the same format as localtags) in
    .hg/bookmarks. The mapping is stored as {name: nodeid}.
    cCs~||_i|_}i|_}d|_d|_|jjj}t}�zt	|���}|D]�}|�
�}|sXqFzr|�dd�\}}	||�}
||
�r�t�
|	�}	|
||	<|�|
�}|dur�|	g||
<n|�|	�|d|	kr�|��WqFttf�yd}t|�r�d}|j�td�|t�|�f�YqF0qFWd�n1�s*0YWn6t�yl}
z|
jtjk�rX�WYd}
~
n
d}
~
00t||�|_dS)NT� r���s
.hg/bookmarkss.hg/store/bookmarkssmalformed line in %s: %r
)�_repo�_refmap�_nodemap�_clean�_aclean�	changelog�index�has_noderr�strip�splitr	�tolocal�get�append�sort�	TypeError�
ValueErrorr�ui�warnrrZbytestr�IOError�errno�ENOENT�_readactive�_active)�selfrZrefmapZnodemapr*ZtonodeZbkfile�lineZshaZrefspec�node�nrefsZ
bookmarkspath�instrrr�__init__LsL






��0zbmstore.__init__cCs|jSr)r9�r:rrr�activezszbmstore.activecCs.|dur||jvrtd|��||_d|_dS)Nsbookmark %s does not exist!F)r$�AssertionErrorr9r'�r:�markrrrrA~scCs
t|j�Sr)�lenr$r@rrr�__len__�szbmstore.__len__cCs
t|j�Sr)�iterr$r@rrr�__iter__�szbmstore.__iter__cCst�|j�Sr)r�	iteritemsr$r@rrrrI�szbmstore.iteritemscCs
|j��Sr)r$�itemsr@rrrrJ�sz
bmstore.itemscCs
|j��Sr)r$�keysr@rrrrK�szbmstore.keyscCs
|j��Sr)r$�valuesr@rrrrL�szbmstore.valuescCs
||jvSr�r$rCrrr�__contains__�szbmstore.__contains__cCs
|j|SrrMrCrrr�__getitem__�szbmstore.__getitem__NcCs|j�||�Sr)r$r.)r:rD�defaultrrrr.�szbmstore.getcCs\d|_||jvr|�|�||j|<|j�|�}|durF|g|j|<n|�|�|��dS)NF)r&r$�_delr%r.r/r0�r:rDr<r=rrr�_set�s



zbmstore._setcCs^||jvrdSd|_|j�|�}|j|}t|�dkrP|d|ksFJ�|j|=n
|�|�dS)NFrr)r$r&�popr%rE�removerRrrrrQ�s


zbmstore._delcCs|j�|g�S)z@Return a sorted list of bookmarks pointing to the specified node)r%r.)r:r<rrr�names�sz
bmstore.namesc	Cs�|j�d�}|D]b\}}|j�|�}|dur8|�|�n|�||�|dur|�|�}|durf|d}||f||<q|�|�dS)z$Apply a list of changes to bookmarksrNr)�changesr.r$rQrS�
_recordchange)	r:r�trrW�	bmchanges�namer<�oldZpreviousrrr�applychanges�s
zbmstore.applychangescCs6t|j�rdnd}|jdd|j|dd�d|jd<d	S)
z�record that bookmarks have been changed in a transaction

        The transaction is then responsible for updating the file content.�splainr)rT)�locationZ
post_finalize�1sbookmark_movedN)rr#Zaddfilegenerator�_writeZhookargs)r:rYr_rrrrX�s�zbmstore._recordchangec	Cs�|j}|j|jvr d|_|��t|�r8|j}|��}n|j}|��}|�J|ddddd��}|�	|�Wd�n1s|0YWd�n1s�0YdS)zFactored out for extensibilityNr�wT�Z
atomictempZ
checkambig)
�
_bookmarksrAr$�_writeactiverr�lockr�wlockra)r:rZrbmrrf�frrr�
_writerepo�s
zbmstore._writerepoc	Cs�|jr
dS|j���p|jdurh|jjddddd��"}|�t�|j��Wd�qv1s\0Yn|jj�d�Wd�n1s�0Yd|_dS)N�bookmarks.currentrbTrc)	r'r#rgr9r�writer	�	fromlocalZ	tryunlink)r:rhrrrre�s
�2,zbmstore._writeactivecCsJtt�|j��D]$\}}|�dt|�t�|�f�qd|_|j	�
�dS)Ns%s %s
T)�sortedrrIr$rkrr	rlr&r#Zinvalidatevolatilesets)r:rr[r<rrrra�szbmstore._writecCs&|dkr"|jr|jSt�td���|S)N�.sno active bookmark)rAr
ZRepoLookupErrorr)r:Zbnamerrr�
expandnames
zbmstore.expandnameFcs��jd��}��jv�r|�s��r�j��kr@�|kr@gS�j���}�jj�|g���j��}��fdd��jD�}|���vr��|vr�t�j�g��S���fdd�|D�}t�j|��}	t�j|�j���r�jj�	t
d��t|���f�|	St�
t
d������j��v�s:��jj��k�rN|�sNt�
t
d���t��dk�r�|�s�zt��j��}
Wntj�y�d	}
Yn0|
�r��jj�t
d
���gS)a�check repo for a potential clash of mark with an existing bookmark,
        branch, or hash

        If target is supplied, then check that we are moving the bookmark
        forward.

        If force is supplied, then forcibly move the bookmark to a new commit
        regardless if it is a move forward.

        If divergent bookmark are to be deleted, they will be returned as list.
        rncs6g|].}|�dd�d��dd�dkr�j|�qS��@rr)r,r$��.0�b)rDr:rr�
<listcomp> s �z)bmstore.checkconflict.<locals>.<listcomp>cs*g|]"}�j|���vs"|�kr|�qSr)r#�revrr)�ancr:�targetrrru,ss%moving bookmark '%s' forward from %s
s.bookmark '%s' already exists (use -f to force)s5a bookmark cannot have the name of an existing branch�Fs[bookmark %s matches a changeset hash
(did you leave a -r out of an 'hg bookmark' command?)
)r#r<r$rvr(�	ancestors�divergent2delete�	validdestr3�statusrrr
�AbortZ	branchmapZdirstate�branchrErZisrevsymbol�LookupErrorr4)r:rD�forcerx�currvZbmctx�divs�
deletefromZdelbmsZ
shadowhashr)rwrDr:rxr�
checkconflictsd�	���
�����
���zbmstore.checkconflict)N)FN)�__name__�
__module__�__qualname__�__doc__r?�propertyrA�setterrFrHrIrJrKrLrNrOr.rSrQrVr]rXrireraror�rrrrr >s2
.



r cCs<|j�d�}t�|��pdgd�}|dks4||vr8d}|S)z�
    Get the active bookmark. We can have an active bookmark that updates
    itself as we commit. This function returns the name of that bookmark.
    It is stored in .hg/bookmarks.current
    rjr^rN)rZtryreadr	r-�
splitlines)r�marksZcontentrDrrrr8Qs
r8cCs||j_|j��dS)z�
    Set the given bookmark to be 'active', meaning that this bookmark will
    follow new commits that are made.
    The name is recorded in .hg/bookmarks.current
    N�rdrAre�rrDrrr�activate`sr�cCsd|j_|j��dS)z7
    Unset the active bookmark in this repository.
    Nr�rrrr�
deactivatejsr�cCs6|j}|j}dd�|d��D�}||vo4|||vS)a�
    Tell whether the 'active' bookmark (the one that follows new commits)
    points to one of the parents of the current working directory (wdir).

    While this is normally the case, it can on occasion be false; for example,
    immediately after a pull, the active bookmark can be moved to point
    to a place different than the wdir. This is solved by running `hg update`.
    cSsg|]}|���qSr)r<)rs�prrrru}r^z&isactivewdirparent.<locals>.<listcomp>N)�_activebookmarkrd�parents)rrDr�r�rrr�isactivewdirparentrs	r�cs^g}|j}�fdd�|D�}|D]8}|dks d|vr6q |r |||vr |�kr |�|�q |S)zZfind divergent versions of bm on nodes in deletefrom.

    the list of bookmark to delete.cs0g|](}|�dd�d��dd�dkr|�qSrp�r,rr��bmrrru�sz$divergent2delete.<locals>.<listcomp>rq)rdr/)rr�r�Ztodeleter�Z	divergentrDrr�rr{�s
�r{cCs\|jstd��|j�dd�d}g}t�|j�D]&\}}|�dd�d|kr0|�|�q0|S)avGiven a repo with an active bookmark, return divergent bookmark nodes.

    Args:
      repo: A repository with an active bookmark.

    Returns:
      A list of binary node ids that is the full list of other
      revisions with bookmarks divergent from the active bookmark. If
      there were no divergent bookmarks, then this list will contain
      only one entry.
    s9headsforactive() only makes sense with an active bookmarkrqrr)r�r2r,rrIrdr/)rr[ZheadsrD�nrrr�headsforactive�s�r�cCsFd\}}|j}t|�r$|d��}n|r>|�td�|�|}||fS)z�Return a tuple (activemark, movemarkfrom) indicating the active bookmark
    and where to move the active bookmark from, if needed.)NNrnsupdating to active bookmark %s
)r�r�r<r}r)r3rZcheckoutZmovemarkfromZ
activemarkrrr�calculateupdate�sr�c	s"|}�j��j��sdSg}��|vr��|����fdd��D�}�j����g����fdd�|D�}t������r�|�����f�t�|��D]}|�|df�q�|�r��	��H��
d��}���||�Wd�n1s�0YWd�n1�s0Yt|�S)NFcs8g|]0}|�dd�d��dd�dkr��|�qSrpr�rr)rAr�rrrru�s �zupdate.<locals>.<listcomp>cs(g|] }|���vs|�kr|���qSr)rvr<rr)rw�newrrru�r^�bookmark)
rdrAr(rzrvr|r/r<r{rf�transactionr]�bool)rr�r<r�rZr�r�rYr)rArwr�r�rr�update�s*�Lr�cCsd|vo|�d�S)Nrq)�endswith)rtrrr�isdivergent�sr�ccsFt|di�}|jj}t�|�D]"\}}||�rt|�s||fVqdS)Nrd)rr(�hasnoderrIr�)rr�r��k�vrrr�listbinbookmarks�s
r�cCs&i}t|�D]\}}t|�||<q|Sr)r�r)r�d�bookr<rrr�
listbookmarks�sr�c	
Csvt|�rdSt|�rt��}n|��}|��4|����|�d���}|j}t|�	|d��}||kr�||kr�Wd�Wd�Wd�dS|dkr�|dfg}nB||vr�Wd�Wd�Wd�dS|||�
�fg}|�|||�Wd�Wd�Wd�dS1�s(0YWd�n1�sH0YWd�n1�sh0YdS)NFrr^T)r�rrZnullcontextmanagerrgrfr�rdrr.r<r])	r�keyr\r�rgrYr��existingrWrrr�pushbookmark�s"
 ((r�cCs�|rt|�}nt|�}t|�}||B}ggggggggf}|dj}|dj}	|dj}
|dj}|dj}|dj}
|dj}|dj}t|�D�]}||vr�||vr�|	|d	||f�n||d	d	f�q�||vr�||||d	f�q�||}||}||k�r||||f�q�||v�r�||v�r�||}||}|��|��k�rvt|||��rf||||f�n||||f�n,t|||��r�|
|||f�n||||f�q�|
|||f�q�|S)
a�Compare bookmarks between srcmarks and dstmarks

    This returns tuple "(addsrc, adddst, advsrc, advdst, diverge,
    differ, invalid)", each are list of bookmarks below:

    :addsrc:  added on src side (removed on dst side, perhaps)
    :adddst:  added on dst side (removed on src side, perhaps)
    :advsrc:  advanced on src side
    :advdst:  advanced on dst side
    :diverge: diverge
    :differ:  changed, but changeset referred on src is unknown on dst
    :invalid: unknown on both side
    :same:    same on both side

    Each elements of lists in result tuple is tuple "(bookmark name,
    changeset ID on source side, changeset ID on destination
    side)". Each changeset ID is a binary node or None.

    Changeset IDs of tuples in "addsrc", "adddst", "differ" or
     "invalid" list may be unknown for repo.

    If "targets" is specified, only bookmarks listed in it are
    examined.
    rr�ry����N)�setr/rmrvr|)rZsrcmarksZdstmarks�targetsZbsetZ
srcmarksetZ
dstmarkset�results�addsrc�adddst�advsrc�advdst�diverge�differ�invalid�samert�scid�dcidZsctxZdctxrrr�comparebookmarkssJ









r�c
Cs�|dkrd}|�d�r"t�|�j}t�|�D]<\}}|j}|�d�rPt�|�j}||kr,d||fSq,tdd�D],}d||f}	|	|vs�||	|krt|	SqtdS)	z�Return appropriate diverged bookmark for specified ``path``

    This returns None, if it is failed to assign any divergent
    bookmark name.

    This reuses already existing one with "@number" suffix, if it
    refers ``remotenode``.
    rqr^sfile:s%s@%sr�ds%s@%dN)�
startswithr�url�pathZ
list_pathsZrawloc�range)
r3rtr��
localmarksZ
remotenoder[r��loc�xr�rrr�_divergeOs	


r�cCs&i}|��D]\}}t|�||<q|Sr)rJr)r�Zbinremotemarksr[r<rrr�unhexlifybookmarksnsr�s>20sHcCsHg}|D]4\}}|s|jj}|�t�|t|���|�|�qd�|�S)amencode a '(bookmark, node)' iterable into a binary stream

    the binary format is:

        <node><bookmark-length><bookmark-name>

    :node: is a 20 bytes binary node,
    :bookmark-length: an unsigned short,
    :bookmark-name: the name of the bookmark (of length <bookmark-length>)

    wdirid (all bits set) will be used as a special value for "missing"
    r^)�
nodeconstants�wdiridr/�_binaryentry�packrE�join)rZ	bookmarksZ
binarydatar�r<rrr�binaryencodexs
r�cCs�tj}g}|�|�}t|�|kr4|r�t�td���q�t�|�\}}|�|�}t|�|krj|rjt�td���||jj	krzd}|�
||f�q
|S)aodecode a binary stream into an '(bookmark, node)' iterable

    the binary format is:

        <node><bookmark-length><bookmark-name>

    :node: is a 20 bytes binary node,
    :bookmark-length: an unsigned short,
    :bookmark-name: the name of the bookmark (of length <bookmark-length>))

    wdirid (all bits set) will be used as a special value for "missing"
    sbad bookmark streamN)r��size�readrEr
r~r�unpackr�r�r/)r�streamZ	entrysizeZbooks�entryr<�lengthZbookmarkrrr�binarydecode�s 


r�cCs�g}|j}t�|�D]<\}}||�|d�kr||vr|�|||jtd�|f�q|D](}||vrV|�|d|jtd�|f�qV|S)zMcomputes the bookmark changes that set the local bookmarks to
    remotemarksN�updating bookmark %s
sremoving bookmark %s
)rdrrIr.r/�debugr)r3r�remotemarks�changedr�rt�idrrr�mirroring_remote�s�r�rc	Cs|j}t|||�\}}}}	}
}}}
|j}|j}|�dd�rD|j}}t|�}g}|D]b\}}}||vr�|�|||td�|f�qT||vrT|�	|�|�td�|t
|�dd�f�qT|D]$\}}}|�|||td�|f�q�|�dd	�|D��|
D]�\}}}||v�r4|�|�|�|||td
�|f�q�t
|||||�}|�rj|�|||td�||ff�q�|td�|�q�||	D]:\}}}||v�r�|�|�|�|||td
�|f��q�|D]B\}}}||v�r�|�	|�|�td�|t
|�dd�f��q�|S)
zqcomputes the bookmark changes that merge remote bookmarks into the
    local bookmarks, based on comparebookmarkssuisquietbookmarkmovesadding remote bookmark %s
s0remote bookmark %s points to locally missing %s
N�r�css|]}|dVqdS)rNr)rsr�rrr�	<genexpr>�r^z&merging_from_remote.<locals>.<genexpr>simporting bookmark %s
s#divergent bookmark %s stored as %s
sAwarning: failed to assign numbered name to divergent bookmark %s
)rdr�r}r4Z
configboolr�r�r/rrUr�difference_update�discardr�)r3rr�r��explicitr�r�r�r�r�r�r�r�r�r}r4r�rtr�r�Zdbrrr�merging_from_remote�s�

�
�
��

��	���



��r�cCs�|dkrdS|�d�|dkr,t|||�}nt|||||�}|r�|�}g}	dd�}
t||
d�D]"\}}}
}|	�||f�|
|�q^|j�|||	�dS)N�ignoreschecking for updated bookmarks
�mirrorcSs|d|dpdfS)Nrrr^r)�trrr�<lambda>r^z"updatefromremote.<locals>.<lambda>)r�)r�r�r�rmr/rdr])r3rr�r�Ztrfuncr��moder�rYrWr�rtr<�writer�msgrrr�updatefromremote
s

r�csF|dkr|�td��dS|�td��|���(}t|�dddi����}Wd�n1s^0Yg�|jr|d	d
��ndd
��|jr���fdd
�}n��fdd
�}|dk�rV|j}t	|�
��t	|�
��B}t|�D]z}	|�|	�}
|�|	�}|
|kr�q�q�|
du�r||	t
|�td��q�|du�r>||	t
|j�td��q�||	t
|�td��q�n�t|||j�}|\}
}}}}}}}|
D] \}	}}||	t
|�td���q||D] \}	}}||	t
|�td���q�|D] \}	}}||	t
|�td���q�|D] \}	}}||	t
|�td���q��s(|�td��dSt��D]}|�|��q0dS)z*Show bookmarks incoming from other to repor�s+bookmarks exchange disabled with this path
r� searching for changed bookmarks
�listkeys�	namespacerNcSs|Srr�r�rrrr�3r^zincoming.<locals>.<lambda>cSs|dd�S�Nr�rr�rrrr�5r^cs��d|�|�|f�dS�Ns   %-25s %s %s
�r/�rtr��st��getidZ	incomingsrr�add8szincoming.<locals>.addcs��d|�|�f�dS�Ns   %-25s %s
r�r�r�rrr�=sr��addedsremoved�changed�advanced�diverged�no changed bookmarks found
r)r}r�commandexecutorr��callcommand�result�	debugflag�verboserdr�rKrmr.rZnullidr�rk)r3r�peerr��er�r�r�Zallmarksrtr�Zrem�rr�r�r�r�r�r�r�r�r�r��srr�r�incoming s`
���"	





rcsf|�td��t|�d��}t||j|�}|\}}}}}	}
}}g�|jrRdd��ndd��|jrp��fdd�}
n��fdd�}
|D]\}}}|
|t|�td	��q�|D]\}}}|
|d
td��q�|D]\}}}|
|t|�td��q�|	D]\}}}|
|t|�td
��q�|
D] \}}}|
|t|�td���q��sH|�td��dSt	��D]}|�
|��qPdS)z*Show bookmarks outgoing from repo to otherr�rcSs|Srrr�rrrr�sr^zoutgoing.<locals>.<lambda>cSs|dd�Sr�rr�rrrr�ur^cs��d|�|�|f�dSr�r�r��r�Z	outgoingsrrr�xszoutgoing.<locals>.addcs��d|�|�f�dSr�r�r�rrrr�}sr�s(                                        sdeletedr�r�r�r�rr)r}rr�Zlistkeysr�rdrrrrmrk)r3r�otherr�rr�r�r�r�r�r�r�r�r�rtr�r�rrrr�outgoingis6
r	c
Csr|���(}t|�dddi����}Wd�n1s60Yt|||j�}|\}}}}}	}
}}t|�t|�fS)zCompare bookmarks between repo and other for "hg summary" output

    This returns "(# of incoming, # of outgoing)" tuple.
    r�r�rN)r�r�r�r�r�rdrE)
rrrr�rr�r�r�r�r�r�r�r�rrr�summary�s
���"	r
cCsJ|��}||krdS|sdS|jr<|��t�||��g�vS|�|�SdS)z?Is the new bookmark destination a valid update from the old oneFTN)Z
unfilteredZobsstorer<rZ
foregroundZisancestorof)rr\r�rrrr|�sr|cCs,|��}|st�td���t�||d�|S)zvreturn a valid version of a potential bookmark name

    Raises an abort error if the bookmark name is not valid.
    s4bookmark names cannot consist entirely of whitespacer�)r+r
�
InputErrorrrZ
checknewlabelr�rrr�checkformat�s�rcCs`|j}g}|D]>}||vr,t�td�|��||jkr>t|�|�|df�q|�|||�dS)z]remove a mark from the bookmark store

    Raises an abort error if mark does not exist.
    �bookmark '%s' does not existN)rdr
rrr�r�r/r])rrYrVr�rWrDrrr�delete�s
rFc
Cs�|j}t||�}||vr*t�td�|��g}|�||�D]}	|�|	df�q:|�|||f|dfg�|�|||�|j	|kr�|s�t
||�dS)arename a bookmark from old to new

    If force is specified, then the new name can overwrite an existing
    bookmark.

    If inactive is specified, then do not activate the new bookmark.

    Raises an abort error if old is not in the bookmark store.
    r
N)rdrr
rrr�r/�extendr]r�r�)
rrYr\r�r��inactiver�rDrWr�rrr�rename�s

rcCs�|j}|d��}d}g}	|r.t�||gd�}t�||d�}
|oL|
��du}|
��durb|
��}
|
��}|srJ�|D]b}
t||
�}
|dur�|
}|r�|
|jkr�t	|�qv|�
|
||�D]}|	�|df�q�|	�|
|f�qv|	s�dS|
���r@|j
�td�|
��dd��|
���r@t�||
��dd�|
�}|j
�d|�|�|||	�|�rn|||k�rnt||�n||k�r�||jk�r�t	|�dS)a$add a list of bookmarks

    If force is specified, then the new name can overwrite an existing
    bookmark.

    If inactive is specified, then do not activate any bookmark. Otherwise, the
    first bookmark is activated.

    Raises an abort error if old is not in the bookmark store.
    rnNsnowarns bookmarking hidden changeset %s
r�s(%s)
)rdr<rZunhidehashlikerevsZ	revsinglervZp1rr�r�r�r/Zhiddenr3r4rrZobsoleterZ_getfilteredreasonr]r�)rrYrVrvr�rr�r�ZnewactrW�ctxZactivatenewZtgtrDr�r�rrr�addbookmarks�sD

 
rc
	Cs�|j}t|�dkr(|��r(|�td��tt�|��D]�\}\}}}|��|j	|d�|j
sp|jd||d�|jdd||d�dd	t
�|�}	|j|j
d
|	d|j�|�||�|d�|jt|vd�|�d
�q6dS)z�private method to print bookmarks

    Provides a way for extensions to control how bookmarks are printed (e.g.
    prepend or postpend names)
    rsno bookmarks set
rs %s )�labelr�s%sr!�srev nodes %d:%s)rA�
N)ZhexfuncrEZisplainr}rrmrrIZ	startitem�context�quietZplainrkr	ZcolwidthZ	condwriter(rv�data�activebookmarklabel)
r3r�fm�bmarksZhexfn�bmarkr��prefixrZpadrrr�_printbookmarks-s(
�rc
Csx|j}i}|p|D]R}||vr0t�td�|��|j}||krJdt}}	nd\}}	||||	f||<qt||||�dS)ztprint bookmarks by the given formatter

    Provides a way for extensions to control how bookmarks are printed.
    r
�*)r!r^N)rdr
rrr�rr)
r3rrrVr�rrrArrrrr�printbookmarksIsr!cCs,|durd}|durd}|t|�t|�d�S)Nr^)r�snodesoldnode)r)r[r\r�rrr�preparehookargs]s
r")N)r)rN)N)FF)NFF)N)=Z
__future__rr6�structZi18nrr<rrrrr�r	r
rr
rrrZutilsrrrrr�objectr r8r�r�r�r{r�r�r�r�r�r�r�r�r�r��Structr�r�r�r�r�r�rr	r
r|rrrrrr!r"rrrr�<module>s^(




L
 
M�

I1

9


Youez - 2016 - github.com/yon3zu
LinuXploit