ROOTPLOIT
Server: Apache
System: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User: ws67150586 (67150586)
PHP: 8.3.36
Disabled: NONE
Upload Files
File: //kunden/kunden/kunden/lib/python3/dist-packages/mercurial/__pycache__/bookmarks.cpython-313.pyc
�

6�h[����SSKJr SSKrSSKJr SSKJrJrJr SSK	J
r
JrJrJ
r
JrJrJrJr SSKJrJr SrS	rS
rSr"SS
5rSrSrSrSrSrSrSr Sr!Sr"Sr#Sr$Sr%S.Sjr&Sr'Sr(\RR"S5r*Sr+Sr,S r-S/S!jr.S0S"jr/S.S#jr0S$r1S%r2S&r3S'r4S(r5S1S)jr6S2S*jr7S+r8S.S,jr9S-r:g)3�)�annotationsN�)�_)�bin�hex�short)�encoding�error�obsutil�pycompat�requirements�scmutil�txnutil�util)�
stringutil�urlutils"bookmarks.active bookmarks.currentc�<�[RUR;$�N)r
�BOOKMARKS_IN_STORE_REQUIREMENT��repos �5/usr/lib/python3/dist-packages/mercurial/bookmarks.py�bookmarksinstorer(s���6�6�$�:K�:K�K�K�c�R�[U5(aUR$UR$r)r�svfs�vfsrs r�bookmarksvfsr,s��(��.�.�4�9�9�<�D�H�H�<rc�`�[R"UR[U5S5upU$)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)r�
trypending�rootr)r�fp�pendings   r�
_getbkfiler%0s-���$�$��	�	�<��%�|��K�B��Irc���\rSrSrSrSr\S5r\RS5rSr	Sr
SrS	rS
r
SrSrS
rSSjrSrSrSrSrSrSrSrSrSrSSjrSrg)�bmstore�=a�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
�L�Xl0=Uln0=UlnSUlSUlUR
RRn[n[U5nUH�nUR5nU(dMURSS5up�U"U5n
U"U
5(ac[R"U	5n	X�U	'URU
5nUcU	/X:'M{URU	5 USU	:�aUR!5 M�M�M� SSS5 [3X5Ulg!["aV Sn[%U5(aSnUR&R)[+S5U[,R."U54-5 GM%f=f!,(df   N�=f![0a N�f=f)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�
ValueErrorr�ui�warnrr�bytestr�FileNotFoundError�_readactive�_active)
�selfr�refmap�nodemapr3�tonode�bkfile�line�sha�refspec�node�nrefs�
bookmarkspaths
             r�__init__�bmstore.__init__Ks����
� "�"���v�"$�$��
���������>�>�'�'�0�0����"	��D�!�V�"�D��:�:�<�D�� ��'+�z�z�$��':���%�c�{��#�D�>�>�&.�&6�&6�w�&?�G�.2�7�O�$+�K�K��$5�E�$�}�18�	��
� %���W� 5�#(��9�w�#6�$)�J�J�L�$7�*�#�"�D#�4�.����&��)9�
�+�D�1�1�,B�M�������;�<�,�h�.>�.>�t�.D�E�F�����'"�!��@!�	��	�sb�F�F�9AD"�F�*D"�F�	F�"AF�=F�F�F�
F�F�F�
F#�"F#c��UR$r)r@�rAs r�active�bmstore.activexs���|�|�rc�^�UbXR;a[SU-5eXlSUlg)Nsbookmark %s does not exist!F)r-�AssertionErrorr@r0�rA�marks  rrPrQ|s.�����L�L� 8� �!?�$�!F�G�G�����rc�,�[UR5$r)�lenr-rOs r�__len__�bmstore.__len__�s���4�<�<� � rc�,�[UR5$r)�iterr-rOs r�__iter__�bmstore.__iter__�s���D�L�L�!�!rc�6�URR5$r�r-�itemsrOs r�	iteritems�bmstore.iteritems�����|�|�!�!�#�#rc�6�URR5$rr_rOs rr`�
bmstore.items�rcrc�6�URR5$r)r-�keysrOs rrg�bmstore.keys�s���|�|� � �"�"rc�6�URR5$r)r-�valuesrOs rrj�bmstore.values�s���|�|�"�"�$�$rc��XR;$r�r-rTs  r�__contains__�bmstore.__contains__�s���|�|�#�#rc� �URU$rrmrTs  r�__getitem__�bmstore.__getitem__�s���|�|�D�!�!rNc�8�URRX5$r)r-r7)rArU�defaults   rr7�bmstore.get�s���|�|����.�.rc��SUlXR;aURU5 X RU'URR	U5nUcU/URU'gURU5 UR
5 g)NF)r/r-�_delr.r7r8r9�rArUrIrJs    r�_set�bmstore._set�sh������<�<���I�I�d�O�!���T���
�
�!�!�$�'���=�#'�&�D�M�M�$���L�L����J�J�Lrc��XR;agSUlURRU5nURUn[	U5S:XaUSU:XdeURU	gURU5 g)NFrr)r-r/�popr.rW�removerxs    rrw�bmstore._del�sm���|�|�#������|�|����%���
�
�d�#���u�:��?���8�t�#�#�#��
�
�d�#��L�L��rc�:�URRU/5$)z@Return a sorted list of bookmarks pointing to the specified node)r.r7)rArIs  r�names�
bmstore.names�s���}�}� � ��r�*�*rc�:�URRS5nUHiupVURRU5nUcURU5 OUR	XV5 UcMKURU5nUbUSnXv4XE'Mk URU5 g)z$Apply a list of changes to bookmarksr Nr)�changesr7r-rwry�
_recordchange)	rAr�trr��	bmchanges�namerI�old�previouss	         r�applychanges�bmstore.applychanges�s����J�J�N�N�<�0�	�!�J�D��,�,�"�"�4�(�C��|��	�	�$���	�	�$�%��$�$�=�=��.���'�"�1�+�C�#&�+�	��"�	
���2�rc��[UR5(aSOSnURSSURUSS9 SURS'g	)
z|record that bookmarks have been changed in a transaction

The transaction is then responsible for updating the file content.rsplainr )r T)�location�
post_finalize�1sbookmark_movedN)rr,�addfilegenerator�_write�hookargs)rAr�r�s   rr��bmstore._recordchange�sP��+�4�:�:�6�6�3�H��
������K�K���	�	
�*.����%�&rc��URnURUR;aSUlUR5 [	U5(aUR
nUR
5nOURnUR5nU U"SSSSS9nURU5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)zFactored out for extensibilityNr �wT��
atomictemp�
checkambig)
�
_bookmarksrPr-�_writeactiverr�lockr�wlockr�)rAr�rbmrr��fs      r�
_writerepo�bmstore._writerepo�s����o�o���:�:�T�\�\�)��C�J������D�!�!��)�)�C��9�9�;�D��(�(�C��:�:�<�D�
��\�4�D�T�J�a����A��K��T�J�J���T�s$�	
C�B6�%C�6
C	�C�
Cc���UR(agURR5 URbUURR	SSSSS9nUR[R"UR55 SSS5 O%URRRS5 SSS5 SUlg!,(df   N=f!,(df   N'=f)N�bookmarks.currentr�Tr�)	r0r,r�r@r�writer	�	fromlocal�	tryunlink)rAr�s  rr��bmstore._writeactive�s����<�<��
�Z�Z�
�
�
��|�|�'��Z�Z�^�^�(�$�4�D�$����G�G�H�.�.�t�|�|�<�=���
�
�
���(�(�)=�>� ����
��� �
�s#�*C�0C�.C�
C	�C�
C$c��[URR55H8up#URS[	U5[
R"U54-5 M: SUlURR5 g)Ns%s %s
T)
�sortedr-r`r�rr	r�r/r,�invalidatevolatilesets)rAr#r�rIs    rr��bmstore._write�s\�� ����!3�!3�!5�6�J�D��H�H�Z�3�t�9�h�.@�.@��.F�"G�G�H�7�����
�
�)�)�+rc��US:Xa<UR(aUR$[R"[S55eU$)N�.sno active bookmark)rPr
�RepoLookupErrorr)rA�bnames  r�
expandname�bmstore.expandnames6���D�=��{�{��{�{�"��+�+�A�.C�,D�E�E��rc�6�URSR5nXR;Ga�U(Gd�U(Ga�URUU:XaX4:Xa/$URUR5nURRRU/5nURXnURVs/sH@nUR
SS5SUR
SS5S:XdM1URUPMB n	nUR5U;aX9;a[URU/U5$U	Vs/sH,o�RUR5U;dX�:XdM*UPM. n
n[URX�5n[URXpRU5(aLURRR[S5U[UR554-5 U$[R"[S5U-5eXRR5;d'XRR R#5:Xa&U(d[R"[S55e[%U5S:�aaU(dZ[&R("URU5nU(a1URRR-[S
5U-5 /$s snfs snf![R*a S	nN\f=f)aTcheck 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.
r��@rrs%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,rIr-�revr1�	ancestorsr5�divergent2delete�	validdestr;�statusrrr
�Abort�	branchmap�dirstate�branchrWr�isrevsymbol�LookupErrorr<)
rArU�force�target�curr��anc�bmctx�b�divs�
deletefrom�delbms�
shadowhashs
             r�
checkconflict�bmstore.checkconflict	s����j�j���#�#�%���<�<�����<�<��%��/�F�M��I��j�j��(�,�,�.���j�j�*�*�4�4�c�U�;���
�
�4�:�.��"�\�\��)���w�w�t�Q�'��*�d�j�j��q�.A�!�.D�D�$�D�L�L��O�)����9�9�;�c�)�f�n�+�D�J�J���$�G�G� $��#�!�z�z�!�}�'8�'8�':�c�'A�Q�[�A�t���*�$�*�*�j�G���T�Z�Z��
�
�6�0B�C�C��J�J�M�M�(�(��C�D���u�z�z�|�!4�5�6��"�M��+�+��C�D�t�K��
�
�J�J�(�(�*�*��z�z�*�*�1�1�3�3���+�+��J�K��
��t�9�q�=��
#�$�0�0����T�B�
���
�
�
�
�"�"��'��
����	��]����.�$�$�
#�"�
�
#�s*�:0K5�.K5�8)K:�%K:�!K?�?L�L)r0r@r/r.r-r,r)FN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rL�propertyrP�setterrXr\rar`rgrjrnrqr7ryrwr�r�r�r�r�r�r�r��__static_attributes__�rrr'r'=s����+/�Z�����]�]����!�"�$�$�#�
%�$�"�/�
�
�+��".��"�,��Crr'c��URRS5n[R"[R
"U55nUS:XdX1;aSnU$)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
r�rN)r�tryreadr	r6r�	firstline)r�marks�contentrUs    rr?r?OsJ���h�h���3�4�G����J�0�0��9�:�D��s�{�d�'����Krc�X�XRlURR5 g)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�r�rPr��rrUs  r�activater�^s��"�O�O���O�O� � �"rc�Z�SURlURR5 g)z/
Unset the active bookmark in this repository.
Nr�rs r�
deactivater�hs ��"�D�O�O���O�O� � �"rc��URnURnUSR5Vs/sHo3R5PM nnX;=(a X!U;$s snf)ah
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`.
N)�_activebookmarkr��parentsrI)rrUr��pr�s     r�isactivewdirparentr�psX�����D��O�O�E�!%�d��!3�!3�!5�6�!5�A�v�v�x�!5�G�6��=�3�U�[�G�3�3��7s�Ac�.�/nURnUVs/sH2oURSS5SURSS5S:XdM0UPM4 nnUH<nUS:XdSU;aMU(dMXGU;dM$Xr:wdM+URU5 M> U$s snf)zVfind divergent versions of bm on nodes in deletefrom.

the list of bookmark to delete.r�rr)r�r5r8)rr��bm�todeleter�r��	divergentrUs        rr�r�s����H��O�O�E����a�G�G�D�!�,�Q�/�2�8�8�D�!�3D�Q�3G�G��5������4�<�4�t�+���4�E�K�:�-��z�����%�
��O��s�/B�Bc��UR(d[S5eURRSS5Sn/nURR	5H1up4URSS5SU:XdM URU5 M3 U$)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 bookmarkr�rr)r�r:r5r�r`r8)rr��headsrU�ns     r�headsforactiver��s�������H�
�	
����%�%�d�A�.�q�1�D��E��?�?�(�(�*����:�:�d�A��q�!�T�)��L�L��O�+��Lrc��Sup#URn[U5(aUSR5nX#4$U(aUR[	S5U-5 UnX#4$)zReturn a tuple (activemark, movemarkfrom) indicating the active bookmark
and where to move the active bookmark from, if needed.)NNr�supdating to active bookmark %s
)r�r�rIr�r)r;r�checkout�movemarkfrom�
activemarks     r�calculateupdater��sg��(��H��%�%�J��$����D�z���(��
�#�#�
�
�	�	�!�7�8�:�E�F����#�#rc�r�UnURnURnU(dg/nXEU;a�XnUVs/sH8nURSS5SURSS5S:XdM1XUPM: n	nURR	UR5/5n
U	Vs/sH-o�R5U
;dX�:XdMUR
5PM/ nn[XXEU5(a URXWR
545 [XU5HnURUS45 M U(aEUR5 URS5nURXU5 SSS5 SSS5 [U5$s snfs snf!,(df   N+=f!,(df   N4=f)NFr�rr�bookmark)r�rPr5r1r�r�rIr�r8r�r��transactionr��bool)
rr�rIr�r�rPr��newr�r�r�r�r�s
             r�updater��st���J��O�O�E�
�\�\�F����I��}����j���
����w�w�t�Q���"�f�l�l�4��&;�A�&>�>�
�D�q��N��	
�
�
�n�n�&�&����	�{�3��(,�K��1����3��!�(�h�a�f�f�h��
�K��T��
�.��4�4����f�h�h�j�1�2��t��8�����"�d��$�9��
�Y�Y�[�$�*�*�;�7�2����t��3�8�[��	�?���!
��L�8�7��[�[�s;�0F
�)F
�$F�F�
F(�F�2F(�
F%	�!F(�(
F6c�F�SU;=(a URS5(+$)Nr�)�endswith)r�s r�isdivergentr��s���1�9�-�Q�Z�Z��-�-�-rc#��# �[US05nURRnUR5H+up4U"U5(dM[	U5(aM&X44v� M- g7f)Nr�)�getattrr1�hasnoder`r�)rr�r��k�vs     r�listbinbookmarksr��sN���
�D�,��+�E��n�n�$�$�G����
����1�:�:�k�!�n�n��$�J��s�AA&�
A&�
A&c�L�0n[U5Hup#[U5X'M U$r)r�r)r�d�bookrIs    r�
listbookmarksr�s(��
�A�&�t�,�
���d�)���-��Hrc	���[U5(ag[U5(a[R"5nOUR	5nU UR5 UR
S5nURn[URUS55nXr:waXs:waSSS5 SSS5 SSS5 gUS:XaUS4/nO4X0;aSSS5 SSS5 SSS5 gXUR54/nURXU5 SSS5 SSS5 SSS5 g!,(df   O=fSSS5 O!,(df   O=fSSS5 g!,(df   g=f)NFr rT)r�rr�nullcontextmanagerr�r�r�r�rr7rIr�)	r�keyr�r�r�r�r��existingr�s	         r�pushbookmarkr�s����3���������'�'�)���
�
���	��	�	��T�-�-�l�;�r������u�y�y��c�*�+���?�x���	<����
�#�:��T�{�m�G����<�����#�Y�^�^�-�.�/�G�
���4�W�-��<����;�;���������sf�
E�D?�-3D%� D?�(E�9D%�D?�E�$(D%�D?�E�%
D3�/D?�6	E�?
E
	�	E�
E'c�v�U(a[U5nO[U5n[U5nXV-n////////4nUSRnUSRn	USRn
USRnUSRnUSRn
USRnUSRn[U5H�nUU;a#UU;aU	"US	UU45 MU"US	S	45 M,UU;aU"UUUS	45 MBUUnUUnUU:Xa
U"UUU45 M_UU;a�UU;a�UUnUUnUR5UR5:a,[	UUU5(a
U"UUU45 M�U"UUU45 M�[	UUU5(a
U
"UUU45 M�U"UUU45 M�U
"UUU45 M� U$)
aCCompare 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�r�����N)�setr8r�r�r�)r�srcmarks�dstmarks�targets�bset�
srcmarkset�
dstmarkset�results�addsrc�adddst�advsrc�advdst�diverge�differ�invalid�samer��scid�dcid�sctx�dctxs                     r�comparebookmarksr#s���4��7�|����]�
���]�
��&���2�r�2�r�2�r�2�.�G�
�Q�Z�
�
�F�
�Q�Z�
�
�F�
�Q�Z�
�
�F�
�Q�Z�
�
�F��a�j���G�
�Q�Z�
�
�F��a�j���G��1�:���D�
�D�\���H���H�}���4��!��-�.���D�$��(�
�h�
��A�x��{�D�)�*��A�;�D��A�;�D��t�|��a��t�_�%����$�$�,��D�z���D�z���8�8�:����
�*� ��t�T�2�2���4���/���D�$��0� ��t�T�2�2���4���/���D�$��0���4���'�9�<�Nrc��US:XaSnURS5(a [R"U5Rn[R"U5HTupVUR
nURS5(a [R"U5RnX':XdMNSX4-s $ [
SS5HnSX4-n	X�;d
X9U:XdMU	s $ g)	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``.
r�rsfile:s%s@%sr�ds%s@%dN)�
startswithr�url�path�
list_paths�rawloc�range)
r;r�r(�
localmarks�
remotenoder�r��loc�xr�s
          r�_diverger0Ms���	�D�y������x� � ��{�{�4� �%�%���%�%�b�)����h�h���>�>�(�#�#��+�+�c�"�'�'�C��;��q�i�'�'�*��1�c�]����v�����*�-�:�"=��H��
rc�V�0nUR5Hup#[U5X'M U$r)r`r)r��binremotemarksr�rIs    r�unhexlifybookmarksr3ls+���N��k�k�m�
��"�4�y���$��rs>20sHc	��/nUHaup4U(dURRnUR[R	U[U555 URU5 Mc SR
U5$)aQencode 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�wdiridr8�_binaryentry�packrW�join)r�	bookmarks�
binarydatarrIs     r�binaryencoder<vsg���J��
����%�%�,�,�D����,�+�+�D�#�d�)�<�=����$��	 �
�8�8�J��rc���[Rn/nURU5n[U5U:a)U(a[R
"[
S55eU$[RU5upVURU5n[U5U:a&U(a[R
"[
S55eXPRR:XaSnURXu45 M�)aSdecode 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)r7�size�readrWr
r�r�unpackr5r6r8)r�stream�	entrysize�books�entryrI�length�bookmarks        r�binarydecoderG�s����!�!�I��E�
����I�&���u�:�	�!���k�k�!�$:�";�<�<���L�$�*�*�5�1����;�;�v�&���x�=�6�!���k�k�!�$:�";�<�<��%�%�,�,�,��D�
���h�%�&�rc	�Z�/nURnUR5HMupVXdRUS5:wdMXa;dM#URXVUR[S5U-45 MO UH5nXR;dM
URUSUR[S5U-45 M7 U$)zIcomputes the bookmark changes that set the local bookmarks to
remotemarksN�updating bookmark %s
sremoving bookmark %s
)r�r`r7r8�debugr)r;r�remotemarks�changedr,r��ids       r�mirroring_remoterN�s����G����J��"�"�$���
����4�(�(�R�Z��N�N�A�2�8�8�Q�/H�-I�A�-M�N�O�%������N�N��D�"�(�(�A�&?�$@�1�$D�E�
��
�Nrc	��URn[XU5unnnn	n
nnn
URnURnUR	SS5(a
UR
=p�[
U5n/nUHtunnnUU;a#URUUU[S5U-45 M0UU;dM8URU5 UR[S5U[U5SS4-5 Mv UH(unnnURUUU[S5U-45 M* URSU55 U
H�unnnUU;a4URU5 URUUU[S	5U-45 MA[UUX5U5nU(a%URUUU[S
5UU4-45 M{U"[S5U-5 M� Xy-HAunnnUU;dMURU5 URUUU[S	5U-45 MC UHKunnnUU;dMURU5 UR[S5U[U5SS4-5 MM U$)zmcomputes 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�rIc3�*# �UH	oSv� M g7f)rNr�)�.0rs  r�	<genexpr>�&merging_from_remote.<locals>.<genexpr>�s���5�W���t�W�s�simporting bookmark %s
s#divergent bookmark %s stored as %s
sAwarning: failed to assign numbered name to divergent bookmark %s
)r�r#r�r<�
configboolrJrr8rr}r�difference_update�discardr0)r;rrKr(�explicitr,rrrrrrrrr�r<rLr�rr �dbs                     r�merging_from_remoterZ�s�����J�	��J�7�	����������Y�Y�F�
�7�7�D�	�}�}�U�0�1�1���� ���8�}�H��G��
��4���4�<��N�N��D�&�!�$B�"C�a�"G�H�
��(�]��O�O�A���G�G��F�G��c�$�i���n�%�&�
� � �
��4������4���+D�)E��)I�J�K� �
���5�W�5�5� �
��4����=����Q���N�N�A�t�V�Q�/I�-J�Q�-N�O�P��"�a��4�8�B���������A�B�a��W�L�	����6���	��!!�. ��
��4����=����Q���N�N�A�t�V�Q�/I�-J�Q�-N�O�P�)� �
��4����=��O�O�A���G�G��F�G��c�$�i���n�%�&�
� ��Nrc�.�US:XagURS5 US:Xa
[XU5nO
[XX#U5nU(aVU"5n/n	Sn
[XzS9H up�p�U	R	X�45 U
"U5 M" UR
R
XU	5 gg)N�ignoreschecking for updated bookmarks
�mirrorc�(�USUS=(d S4$)Nrrrr�)�ts r�<lambda>�"updatefromremote.<locals>.<lambda>s���1��q��t�{�s�+r)r)rJrNrZr�r8r�r�)r;rrKr(�trfuncrX�moderLr�r�rr�rI�writer�msgs               r�updatefromremoterfs����y����H�H�
0�1��y��"�2�[�9��%�b��8�L���
�X����+��$*�7�$<� �A�V��N�N�A�9�%��3�K�%=�	
���$�$�T�w�7�rc�^^�US:XaUR[S55 gUR[S55 UR5n[UR	SSS05R55nSSS5 /mUR(aS	mOS
mUR(aUU4SjnOUU4SjnUS
:Xa�URn[WR55[UR55-n[U5H�n	URU	5n
URU	5nX�:XaM,U
cU"U	[U5[S55 MMUc(U"U	[UR5[S55 MxU"U	[U5[S55 M� O�[UWUR5nUup�nnnnnnU
H#un	nnU"U	[U5[S55 M% UH#un	nnU"U	[U5[S55 M% UH#un	nnU"U	[U5[S55 M% UH#un	nnU"U	[U5[S55 M% T(dUR[S55 g[T5HnUR!U5 M g!,(df   GN==f)z*Show bookmarks incoming from other to repor\s+bookmarks exchange disabled with this path
r� searching for changed bookmarks
�listkeys�	namespacer Nc��U$rr��rMs rr`�incoming.<locals>.<lambda>1���2rc��USS$�NrPr�rls rr`rm3�
��2�c�r�7rc�@>�TRSUT"U5U4-5 g�Ns   %-25s %s %s
�r8�r�rM�st�getid�	incomingss   ��r�add�incoming.<locals>.add6�"������0�A�u�R�y�"�3E�E�Frc�>>�TRSUT"U54-5 g�Ns   %-25s %s
rtrus   ��rryrz;�������-��E�"�I��>�?rr]�addedsremoved�changed�advanced�diverged�no changed bookmarks found
r)r�r�commandexecutorr3�callcommand�result�	debugflag�verboser�rrgr�r7r�nullidr#r�)r;r�peerrc�erKryr,�allmarksr�r.�rem�rrrrrrrrrrr �srwrxs                        @@r�incomingr�sR����y��
�	�	�!�C�D�E���I�I�a�4�5�6�	
�	�	�	�1�(�
�M�M�� �,��
�
�f�h�

��
 ��I�	�|�|���"��	�z�z�	G�
	@��y���_�_�
��{�'�'�)�*�S����1B�-C�C����!�A��.�.��#�C��/�/�!�$�C��z�����A�s�3�x��8��-����A�s�4�;�;�'��:��7��A�s�3�x��:��/�"�
�T�;����@��IJ�F�������$�#�M�A�t�T���3�t�9�a��k�*�$�$�M�A�t�T���3�t�9�a��n�-�$�%�M�A�t�T���3�t�9�a��n�-�%�$�M�A�t�T���3�t�9�a�
�m�,�$��
�	�	�!�3�4�5��
�I�
��
������
�
 �	�s�,J0�0
J?c�&^^�UR[S55 [URS55n[	XR
U5nUupVpxp�p�/mUR(aSmOSmUR(aUU4Sjn
OUU4Sjn
UH"up�nU
"U[U5[S55 M$ UHup�nU
"US[S	55 M UH"up�nU
"U[U5[S
55 M$ U	H"up�nU
"U[U5[S55 M$ U
H"up�nU
"U[U5[S55 M$ T(dUR[S
55 g[T5HnURU5 M g)z*Show bookmarks outgoing from repo to otherrhr c��U$rr�rls rr`�outgoing.<locals>.<lambda>qrnrc��USS$rpr�rls rr`r�srqrc�@>�TRSUT"U5U4-5 grsrt�r�rMrvrw�	outgoingss   ��rry�outgoing.<locals>.addvr{rc�>>�TRSUT"U54-5 gr}rtr�s   ��rryr�{r~rrs(                                        sdeletedr�r�r�r�rr)r�rr3�listkeysr#r�r�r�rr�r�)r;r�otherrKr�rrrrrrrrryr�rr r�rwr�s                  @@r�outgoingr�gsX����I�I�a�4�5�6�$�U�^�^�L�%A�B�K������<�A�EF�B�F�F�G�W��I�	�|�|���"��	�z�z�	G�
	@� �
����A�s�4�y�!�H�+�&� � �
����A�y�!�J�-�(� � �
����A�s�4�y�!�K�.�)� �!�
����A�s�4�y�!�K�.�)�!� �
����A�s�4�y�!�J�-�(� ��
�	�	�!�3�4�5��
�I�
��
������
rc��UR5n[URSSS05R55nSSS5 [	UWUR
5nUupVpxp�p�[
U5[
U54$!,(df   NB=f)zwCompare bookmarks between repo and other for "hg summary" output

This returns "(# of incoming, # of outgoing)" tuple.
rirjr N)r�r3r�r�r#r�rW)
rr�r�rKr�rrrrrrrrs
             r�summaryr��s���

�	�	�	�1�(�
�M�M�� �,��
�
�f�h�

��
 �	��{�D�O�O�<�A�EF�B�F�F�G�W���K��V��%�%�
 �	�s�,A9�9
Bc���UR5nX:XagU(dgUR(a6UR5[R"XR5/5;$URU5$)z?Is the new bookmark destination a valid update from the old oneFT)�
unfiltered�obsstorerIr�
foreground�isancestorof)rr�r�s   rr�r��s\���?�?��D�
�z��
��	
����x�x�z�W�/�/��x�x�z�l�C�C�C�����$�$rc��UR5nU(d[R"[S55e[R
"XS5 U$)znreturn 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�)r4r
�
InputErrorrr�
checknewlabelr�s  r�checkformatr��sE��
�:�:�<�D�����
�E�F�
�	
����$�k�2��Krc��URn/nUHWnXS;a"[R"[S5U-5eXPR:Xa[U5 UR
US45 MY URXU5 g)zUremove a mark from the bookmark store

Raises an abort error if mark does not exist.
�bookmark '%s' does not existN)r�r
r�rr�r�r8r�)rr�r�r�r�rUs      r�deleter��st��

�O�O�E��G������"�"�1�%D�#E��#L�M�M��'�'�'��t������d�|�$��
���t��)rc�x�URn[X5nX&;a"[R"[	S5U-5e/nURXt5Hn	UR
U	S45 M URXvU4US4/5 URXU5 URU:XaU(d[X5 ggg)z�rename 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)r�r�r
r�rr�r8�extendr�r�r�)
rr�r�r�r��inactiver�rUr�r�s
          r�renamer��s���
�O�O�E��t�!�D�
�����q�!@�A�C�G�H�H��G��!�!�$�.������D�z�"�/��N�N�T��:�&��d��4�5�	���t��)����s�"�8����,4�"rc�Z�URnUSR5nSn/n	U(a[R"X/S5n[R"XS5n
U(+=(a U
R5SLnU
R5cU
R
5n
U
R5nU(deUHtn
[X
5n
UcU
nU(aX�R:Xa
[U5 M6URX�U5HnU	RUS45 M U	RX�45 Mv U	(dgU
R5(a�URR[S5U
R!5SS-5 U
R#5(aF[$R&"X
R!5SSU
5nURRSU-5 UR)XU	5 U(aXvU:Xa[+X5 gX|:waX�R:Xa[U5 ggg)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.
r�Nsnowarns bookmarking hidden changeset %s
rPs(%s)
)r�rIr�unhidehashlikerevs�	revsingler��p1r�r�r�r�r8�hiddenr;r<rr�obsoleter�_getfilteredreasonr�r�)rr�r�r�r�r�r�r��newactr��ctx�activatenew�tgtrUr�res                r�addbookmarksr��s���
�O�O�E�
�t�*�/�/�
�C�
�F��G���)�)�$��y�A��
�
�
�D�t�
,�C��,�4�3�7�7�9��#4�K�
�x�x�z���f�f�h��

�(�(�*�C��J�3����4�&���>��F��� 4� 4�4��t����%�%�d�3�7�B��N�N�B��:�&�8�����{�#����
�z�z�|�|������Q�;�<�s�w�w�y��"�~�M�N��<�<�>�>��,�,�T�7�7�9�S�b�>�3�G�C��G�G�L�L��S��)�	���t��)��s�F�m�+����	���"6�"6�6��4��7�rc
��URn[U5S:Xa/UR5(aUR[	S55 [UR
55H�unupgnUR5 URUS9 UR(dURSU-US9 URSSXXS9 SS	[R"U5-
-n	URUR(+S
U	S-URR!U5U"U5US9 UR#[$U;S9 URS
5 M� g)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)rP�
N)�hexfuncrW�isplainr�rr�r`�	startitem�context�quiet�plainr�r	�colwidth�	condwriter1r��data�activebookmarklabel)
r;r�fm�bmarks�hexfn�bmarkr��prefixr��pads
          r�_printbookmarksr�+s��
�J�J�E�
�6�{�a��B�J�J�L�L�
�	�	�!�)�*�+�%+�F�L�L�N�%;�!��!��5�
����
�
�
��
���x�x��H�H�W�v�%�U�H�3�
����e�U��8��b�8�,�,�U�3�3�4��
������L���)�O��N�N���q�!��!�H��
	�	
�	���+�u�4��6�
�����!&<rc���URn0nU=(d UHOnXd;a"[R"[S5U-5eURnXg:XaS[
p�OSup�XFX�4XV'MQ [
XX%5 g)zlprint bookmarks by the given formatter

Provides a way for extensions to control how bookmarks are printed.
r��*)r*rN)r�r
r�rr�r�r�)
r;rr�r�r�r�r�rPr�r�s
          r�printbookmarksr�Gs}��

�O�O�E�
�F���%������"�"�1�%D�#E��#M�N�N��%�%���?� �"5�E�%�M�F���v�5��
� ��B�b�)rc�F�UcSnUcSnU[U5[U5S.$)Nr)r�snodesoldnode)r)r�r�r�s   r�preparehookargsr�[s+��
�{���
�{�����C��c�#�h�G�Grr)r�)r�N)FF)NFF);�
__future__r�struct�i18nrrIrrr�r	r
rrr
rrr�utilsrrr�rrr%r'r?r�r�r�r�r�r�r�r�r�rrr#r0r3�Structr7r<rGrNrZrfr�r�r�r�r�r�r�r�r�r�r�r�rr�<module>r�s��#�
����
	�	�	��<��L�=�
�O�O�d�#�#�4��&�0
$��:.�	�
��,I�X�>��}�}�X�&�� �,�@
� I�Z<@�8�,F
�R.
�b&�(%�"�
*� �.6�r�8*�(Hr