403Webshell
Server IP : 217.160.0.64  /  Your IP : 216.73.216.58
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67269618 ( 67269618)
PHP Version : 8.4.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/kunden/usr/lib/python3/dist-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/kunden/usr/lib/python3/dist-packages/hgext/__pycache__/phabricator.cpython-313.pyc
�

6�h�C���	�SrSSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
r
SSKJrJr SSKJr SSKJr \
R*(aSSKrSSKJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r0J1r1 SSK2J3r3J4r4J5r5 S	S
K6J7r7 Sr8\R8"5r9\9Rtr:\9Rvr;\9Rxr<\9Rzr=\9R|r?\9R�SS
SS9 \9R�SSSS9 \9R�SSSS9 \9R�SSSS9 \9R�SSSS9 \9R�SSSS9 \9R�SSS	S9 \9R�SSSS9 \9R�SSSS9 \9R�SSSS9 \9R�SSSS9 SSSSS S!SS"S#S#S$.
rAS%S&S%\"S'54/rB\9R�\ S(5S)5rDS�S*jrES+rFS,rGS-rHS.rI\E"S//\"S05S1S29S35rJS4rK\R�"S55rM\R�"S6\R�5rOS7rPS8rQS9rR"S:S;5rS"S<S=5rT\R�"S>S?\V55rW\R�"S@SA55rX\R�"SBSC55rYSDrZSEr[SFr\SGr]SHr^SISJSKSL.r_SMr`SNraSOrbSPrcSQrdSRreS�SSjrfSTrgSUrhSVri\E"SSWSX/\"SY5\"SZ54S%S[S1\"S\54S%S]/\"S^54S%S_/\"S`54SaSbS%\"Sc54S%SS\"Sd54S%SeS\"Sf54/\"Sg5\;R�Sh9Si5rk\1R�"/SjQ5rmSkrn1SlkroSmrpSnSoSpSqSrSsStSsSu.rqSvrrSwrsSxrtSyruSzrvS{rwS|rxS}ryS~rzSr{S�r|\E"S�S%S�S\"S�54/\"S�5\;R�S1S�9S�5r}\E"SS%S�S\"S�54/\"S�5\;R�Sh9S�5r~\E"S�S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54S%S�S\"S�54SaSbS%\"S�54SWSXS%\"S�5\"SZ54/\"S�5\;R�S1S�9S�5r\9R{S�S�1S�9S�5r�\9R{S�1S�kS�9S�5r�\7GR"S�S�S�9S�5r�g)�asimple Phabricator integration (EXPERIMENTAL)

This extension provides a ``phabsend`` command which sends a stack of
changesets to Phabricator, and a ``phabread`` command which prints a stack of
revisions in a format suitable for :hg:`import`, and a ``phabupdate`` command
to update statuses in batch.

A "phabstatus" view for :hg:`show` is also provided; it displays status
information of Phabricator differentials associated with unfinished
changesets.

By default, Phabricator requires ``Test Plan`` which might prevent some
changeset from being sent. The requirement could be disabled by changing
``differential.require-test-plan-field`` config server side.

Config::

    [phabricator]
    # Phabricator URL
    url = https://phab.example.com/

    # Repo callsign. If a repo has a URL https://$HOST/diffusion/FOO, then its
    # callsign is "FOO".
    callsign = FOO

    # curl command to use. If not set (default), use builtin HTTP library to
    # communicate. If set, use the specified curl command. This could be useful
    # if you need to specify advanced options that is not easily supported by
    # the internal library.
    curlcmd = curl --connect-timeout 2 --retry 3 --silent

    # retry failed command N time (default 0). Useful when using the extension
    # over flakly connection.
    #
    # We wait `retry.interval` between each retry, in seconds.
    # (default 1 second).
    retry = 3
    retry.interval = 10

    # the retry option can combine well with the http.timeout one.
    #
    # For example to give up on http request after 20 seconds:
    [http]
    timeout=20

    [auth]
    example.schemes = https
    example.prefix = phab.example.com

    # API token. Get it from https://$HOST/conduit/login/
    example.phabtoken = cli-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
�)�annotationsN)�bin�short)�_)�attr)�cmdutil�context�copies�encoding�error�	exthelper�graphmod�httpconnection�	localrepo�
logcmdutil�match�mdiff�obsutil�parser�patch�phases�pycompat�rewriteutil�scmutil�smartset�tags�templatefilters�templateutil�url�util)�procutil�
stringutil�urlutil�)�showsships-with-hg-core�phabricator�	batchsize���default�callsign�curlcmd�debugF�repophid�retry�retry.interval�url�phabsend�confirm�
phabimport�secret�obsoletesgreensmagentasboldsmagenta dims
green boldsyellowsred)
sphabricator.action.createdsphabricator.action.skippedsphabricator.action.updated�phabricator.drevsphabricator.status.abandonedsphabricator.status.acceptedsphabricator.status.closedsphabricator.status.needsreviews phabricator.status.needsrevisions!phabricator.status.changesplanned�stest-vcrs�Path to a vcr file. If nonexistent, will record a new vcr transcript, otherwise will mock all http requests using the specified vcr file. (ADVANCED)�loadhgrcc��Sn0n[R"URS55n	[R"S[R
"U	55nSn[R"5n
SU;aUSU
S'SU;aUSU
S	'U
(aURX�RS5S
9 U"XX4/UQ70UD6=(d U$![a/ UR[S5URS5-5 N�[a N�f=f)zBLoad ``.arcconfig`` content into a ui instance on repository open.Fs
.arcconfigc�\�[U[5(a[R"U5$U$�N��
isinstance�strr�
unitolocal��xs �3/usr/lib/python3/dist-packages/hgext/phabricator.py�<lambda>�_loadhgrc.<locals>.<lambda>�s#��
�1�c�0B�0B�h�)�)�!�,�I��Ir8Tsinvalid JSON in %s
srepository.callsign)r&r+sphabricator.uri�r&r1)�source)r�unifromlocal�readr�rapply�
json_loads�
ValueError�warnr�join�OSErrorr �sortdict�applyconfig)�orig�ui�wdirvfs�hgvfs�requirements�args�opts�result�	arcconfig�	rawparams�cfgs           rC�	_loadhgrcr]�s���F��I�

��)�)�'�,�,�}�*E�F�	��O�O�I����	�*�
�	�
���-�-�/�C���*�-6�7M�-N��)�*��Y�&�(1�2D�(E��$�%�
�
���s�<�<�
�#>��?�	
�R�%�=��=��=�G����!�J�
����)�*�W�\�\�-�-H�H�I��
��
�s�AC�6D	�=	D	�D	c�T^^^^^^^^	�U[-mSmSmSm	UUUUUUU	U4SjnU$)Nc�&�URUR:wdURUR:wag[RR	UR
5n[RR	UR
5nUH�nXC;a gX$SnUR
S5(aPURS5(a:[R"U5n[R"X4S5nXg:wa gMwX4SU:wdM� g g)NFr�{�}T)
�uri�methodr �urlreq�parseqs�body�
startswith�endswithrrK)�r1�r2�r1params�r2params�key�value�r1json�r2jsons        rC�	hgmatcher�vcrcommand.<locals>.hgmatchers���
�6�6�R�V�V��r�y�y�B�I�I�5���;�;�&�&�r�w�w�/���;�;�&�&�r�w�w�/���C��"���M�!�$�E�����%�%�%�.�.��*>�*>�!�,�,�U�3��!�,�,�X�]�1�-=�>���#� �$���q�!�U�*���r8c�T�[R"SSUR5UlU$)Ns
cli-[a-z0-9]+scli-hahayouwish)�re�subrf)�requests rC�sanitiserequest�#vcrcommand.<locals>.sanitiserequests%���v�v��2�G�L�L�
����r8c�$�SUS;aUSS	U$)Nz
set-cookie�headers�)�responses rC�sanitiseresponse�$vcrcommand.<locals>.sanitiseresponses!���8�I�.�.���#�L�1��r8c�>^�UUUU	4Sjn[R"USS9nTRUlTRUl[	TTT
TTS9"U5$)Nc
��>�URS5nU(a�[R"U5nSSKnUR	5 SSKnSSKJn URST	T
[SUR4[SUR4/S9nURST5 URUS/S9 T"U0UD6sSSS5 sSSS5 $T"U0UD6$!,(df   O=fSSS5 M$!,(df   N2=f)	N�test_vcrr�jsonr�httpsconnection)�
serializer�before_record_request�before_record_response�custom_patchesrq)�match_on)�popr�fsdecode�hgdemandimport�deactivated�vcr�	vcr.stubs�stubs�VCR�urlmod�VCRHTTPConnection�VCRHTTPSConnection�register_matcher�use_cassette)rW�kwargsr��cassetter��vcrmodr��fnrqrwr}s       ����rC�inner�+vcrcommand.<locals>.decorate.<locals>.inner!s�����*�*�Z�(�C��#�,�,�S�1��%�#�/�/�1�(�-�!�*�*�#)�.=�/?�!'� 0� %� 7� 7��!'� 1� %� 8� 8��
(�	%��C�"�(�(��i�@��)�)�(�k�]�)�K�!�4�2�6�2�L�K�32�1�6�t�&�v�&�&�L�K��K�32�1�1�s%�A$C'�(C�0	C'�
C	�C'�'
C5�)�depth��helpcategory�optionalrepo)r �checksignature�__name__�__doc__�command)r�r��cmd�	fullflagsr�rq�namer�rwr}�specs`  ��������rC�decorate�vcrcommand.<locals>.decorate s^���!	'�!	'�F�!�!�%�q�1���{�{����j�j�������%�%�
��
�	r8)�
_VCR_FLAGS)
r��flagsr�r�r�r�r�rqrwr}s
` ``` @@@@rC�
vcrcommandr��s.����
�"�I��&��
.�.�`�Or8c��URSS5(a-URnSUlUR"U0UD6 X0lgg!X0lf=f)z�write debug output for Phabricator if ``phabricator.debug`` is set

Specifically, this avoids dumping Conduit and HTTP auth chatter that is
printed with the --debug argument.
r&r-TN)�
configbool�	debugflag�write)rS�msgrX�flags    rC�_debugr�SsN��
�}�}�^�X�.�.��|�|��	 ��B�L��H�H�c�"�T�"��L�
/�� �L�s�A�Ac�^^�[R"5mSUU4SjjmT"SU5 [RR	T5$)a
like urlencode, but works with nested parameters.

For example, if params is {'a': ['b', 'c'], 'd': {'e': 'f'}}, it will be
flattened to {'a[0]': 'b', 'a[1]': 'c', 'd[e]': 'f'} and then passed to
urlencode. Note: the encoding is consistent with PHP's http_build_query.
c�>�[U[5(aSSS.UnSn[U[S0R	[U55nUcUTU'gU"U5H#upEU(aT"SX4-U5 MT"XE5 M% g)Nstruesfalse)TFc�X�[U5VVs/sHupSU-U4PM snn$s snnf)N�%d)�	enumerate)�l�k�vs   rCrD�2urlencodenested.<locals>.process.<locals>.<lambda>ns$��y��|�D�|�t�q�U�Q�Y��N�|�D��Ds�&c�"�UR5$r<)�itemsrAs rCrDr�qs
��q�w�w�yr8s%s[%s])r>�bool�list�dict�get�type)�prefix�obj�listerr�r�r��
flatparams�processs      ��rCr�� urlencodenested.<locals>.processks~����c�4� � � ��2�3�7�C�D���v�t�%8�9�=�=�d�3�i�H���=�!$�J�v���c�
�����I���3�Q�7��A�M�	#r8r8)r��bytes)r rPr#rd�	urlencode)�paramsr�r�s @@rC�urlencodenestedr�bs;�������J�"�"�"�C����>�>�#�#�J�/�/r8c��URSS5nU(d"[R"[S5S-5e[R
"X[R"U5R5nSnU(a)UupEURSU-5 URS5nU(d#[R"[S5U4-5eX4$)	z�return conduit url, token and make sure they exist

Currently read from [auth] config section. In the future, it might
make sense to read from .arcconfig and .arcrc as well.
r&r1sconfig %s.%s is requiredrFNs#using auth.%s.* for authentication
s	phabtokens)Can't find conduit token associated to %s)�configr�Abortr�httpconnectionmod�readauthforurir#r�user�debugr�)rSr�res�token�group�auths      rC�readurltokenr��s���
�)�)�N�F�
+�C���k�k�
�)�*�-E�E�
�	
��
*�
*�2�G�K�K��4D�4I�4I�
J�C��E�
����
���8�5�@�A�����&����k�k�
�;�<��v�E�
�	
��:�r8c�"�[U5up4[R"SRUSU/55R	5upVURSU[R"U54-5 UR5nSU0US'[R"U5SSS.n[U5nURS	S
5n	U	(ac[R"SU	[R"U54-5up�U
R!U5 U
R#5 UR%5nO�[&R("X5n
[*R,R/[R0"U5US9nUR3S	S
5S-nUR5[6SS5n[9U5HAn[:R<"U
R?UUS95nUR%5nSSS5  O URSW-5 [RH"S[RJ"[LRN"U555nURQS5(a,[SS5USUS4-n[TRV"U5eUS$!,(df   N�=f![*R@RBaXnUUS-
:XaeURSUS-UU4-5 UR3S	S5n[DRF"U5 SnAGMbSnAff=f)zEcall Conduit API, params is a dict. return json.loads result, or None�/sapisConduit Call: %s %s
stoken�__conduit__sjsonr$)sparamssoutputr�r&r,s%s -d @- %s)�datar/shttpstimeout)�timeoutNs'Conduit Request failed (try %d/%d): %r
r0sConduit Response: %s
c�\�[U[5(a[R"U5$U$r<r=rAs rCrD�callconduit.<locals>.<lambda>��#��J�q�#�,>�,>�(�%�%�a�(�E�A�Er8s
error_codesConduit Error (%s): %ss
error_infosresult),r�r#rrN�authinfor�r�byterepr�copyrr�r�r�r!�popen2�
shellquoter��closerIr��openerr rdrv�strurl�	configint�
configwith�float�range�
contextlib�closing�open�urlerr�urlerror�time�sleeprJrKrrHr�rrr�)rSr�r��hostr�rr��rawdatar��curlcmd�sin�soutrf�	urlopenerrv�max_tryr��	try_count�rsp�err�retry_interval�parsedr�s                       rC�callconduitr�s����r�"�K�D��K�K��	�	�4���*>� ?�@�I�I�K�M�C��H�H�
%��h�.?�.?��.G�(H�
H�I�
�[�[�]�F��%��F�>��#�'�'��/����G�
�7�#�D��i�i��
�3�G���O�O��g�x�':�':�3�'?�@�@�
�	��	�	�	�$���	�	���y�y�{���M�M�"�/�	��+�+�%�%�h�o�o�c�&:��%�F���,�,�~�x�8�1�<���-�-��w�
�;���w��I�
+��'�'��N�N�7�G�N�<����8�8�:�D���
(�"�H�H�
&��
-�.�
�_�_�E����H�1�1�$�7�8��F�
�z�z�-� � ��)�*��=�!��=�!�.
�
���k�k�#����)���7���
�;�;�'�'�	
+���!��+�����?� �1�}�g�s�3�4��
"$���n�>O�!P���
�
�>�*�*��	
+�s1�+$J�J� J�
J	�J�L�6AL	�	LsdebugcallconduitsMETHODT)r�c�z�[R"URR55n[R
"S[R"U55n[R
"S[XU55n[R"USSSS9nURS[R"U5-5 g)	zwcall Conduit API

Call parameters are read from stdin as a JSON blob. Result will be written
to stdout as a JSON blob.
c�\�[U[5(a[R"U5$U$r<r=rAs rCrD�"debugcallconduit.<locals>.<lambda>�r�r8c�\�[U[5(a[R"U5$U$r<)r>r�rrHrAs rCrDr�s#��j��E�.B�.B�(�'�'��*�I��Ir8Tr�)�,z: )�	sort_keys�indent�
separatorss%s
N)rrH�finrIrrJrKrr��dumpsr�r@)rS�repor�r[r�rY�ss       rC�debugcallconduitr�s����%�%�b�f�f�k�k�m�4�I�
�_�_�E����I�&��F�
�_�_�I��B�f�%��F�	
�
�
�6�T�!��L�A��H�H�W�x�*�*�1�-�
-�.r8c�F�URRSS5nU(aU$URRSS5nU(dg[URSSSU/005n[US5S	:XagUSS	S
nURR	SSU5 U$)z.given callsign, return repository PHID or Noner&r.r+Nsdiffusion.repository.search�constraintss	callsigns�datar�phid)rSr�r�len�	setconfig)r
�repophid�callsign�querys    rC�getrepophidr�s����w�w�~�~�n�k�:�H�����w�w�~�~�n�k�:�H�������&�	�,��
�3�4�
�E�
�5��>��a����W�~�a� ��)�H��G�G���n�k�8�<��Or8s\AD([1-9][0-9]*)\Zs>^Differential Revision:\s*(?P<url>(?:.*)D(?P<id>[1-9][0-9]*))$c�l�UR5nURRRn0n[R
"5nUGHnX&n[
[R"URU/55nUHsn	U"U	5(dMURU	5HIn
[RU
5nU(dM!S[U5[URS554XV' O Mr M� [ R#UR%55nU(dM�S[U5[URS554XV'GM U(Ga�UR'5VV
Vs/sHup�o�PM	 nn
nn[)UR*SSU05nSnUR-5GHoununnnUR'5Vs/sHn[US5U:XdMUPM nnUVV	s1sHnU"UU5Ho�iM M nnn	U(dYU(dRSU-n[.R0"UUUR2S	S	S	S
S9 UR*R5[7S5U-5 M�S	=nnU(a�[9US
S9nU"UU5n[;UR*S[=U5[>R@"[CU5V	s/sHn	[=U	5PM sn	54-5 [EU5S:XaUSnU(aU"U5(dS	nUUU4UU'GMr U$s snn
nfs snfs sn	nfs sn	f)a�find previous nodes that has been sent to Phabricator

return {node: (oldnode, Differential diff, Differential Revision ID)}
for node in nodelist with known previous sent versions, or associated
Differential Revision IDs. ``oldnode`` and ``Differential diff`` could
be ``None``.

Examines commit messages like "Differential Revision:" to get the
association information.

If such commit message line is not found, examines all precursors and their
tags. Tags with format like "D1234" are considered a match and the node
with that tag, and the number after "D" (ex. 1234) will be returned.

The ``old node``, if not None, is guaranteed to be the last diff of
corresponding Differential Revision, and exist in the repo.
rr$�id�differential.querydiffssrevisionIDsc�R�[U5Vs/sHo"U;dM
UPM sn$s snfr<)�getlocalcommits)�d�precset�ns   rC�getnodes�#getoldnodedrevmap.<locals>.getnodes@s'�� /�q�1�B�1�!�'�\�A�1�B�B��Bs�	$�$s
revisionID�D%dNT��messager��date�locals=D%d: local tag removed - does not match Differential history
c��[US5$)N�id��int)rs rCrD�#getoldnodedrevmap.<locals>.<lambda>gs��C��%��Mr8)rms%s mapped to old nodes %s
)#�
unfiltered�	changelog�index�has_noder rPr�r�allpredecessors�obsstore�nodetags�_differentialrevisiontagrer�setr,r��_differentialrevisiondescre�search�description�valuesrrSr�r�tag�nullidrMr�maxr�rr"�pprint�sortedr)r
�nodelist�unfir1rY�	toconfirm�node�ctx�	precnodesr!r;�m�force�precs�drev�drevs�alldiffsr"�newnoder r�diffs�	phprecset�tagname�oldnode�lastdiff�oldnodess                           rC�getoldnodedrevmaprSs���$�?�?��D��~�~�#�#�,�,�H�
�F��
�
��I����j����0�0������G�H�	��A���{�{��=�=��+�C�2�8�8��=�A��q�+,�c�)�n�c�!�'�'�!�*�o�*N�	���	,����,�2�2�3�?�?�3D�E�A��q�#$�c�)�n�c�!�'�'�$�-�6H�"I�	��%�,�09�0@�0@�0B�C�0B�,�%���0B��C���G�G�/�.�%�1H�
��	C�
09���/@�+�G�+�e�W�d�#�?�?�,��,�a��A�m�4D�0E��0M��,�
��
%*�H�E�q�8�A�w�3G�a��3G��E�I�H��� �4�-��������K�K� �����������2���	���"&�%�G�h���u�*A�B��#�H�g�6����G�G�2��g��"�)�)�V�H�=M�*N�=M��5��8�=M�*N�O����.�x�=�A�%�&�q�k�G��8�G�#4�#4�"�G�&��$�7�F�7�O�C0A�F�M��[D����
I��H+Os�+L�L&� L&�-L+�L1c�~�0nUH�nSX#'Xn[RUR55nU(a[UR	S55X#'MSURUR
55H>n[RU5nU(dM![UR	S55X#' M� M� U$)zTReturn a dict mapping each rev in `revs` to their Differential Revision
ID or None.
Nrr$)	r7r8r9r,r�r4rCr5r)r
�revsrY�revrDrFr;s       rC�
getdrevmaprW�s����F�������i��'�.�.�s���/@�A����a�g�g�d�m�,�F�K���=�=�����,�C�*�0�0��5�A��q�!�!�'�'�!�*�o����	-���Mr8c� �[R"5n[R"UR	5UR5R
5UR
5SUS9HupEURU5 M UR5$)z:plain-text diff without header (user, commit message, etc)N�rX)	r �stringior�diffuir
�p1rCr��getvalue)�basectxrD�diffopts�output�chunk�_labels      rC�getdiffrc�se��
�]�]�_�F�������
�G�J�J�L�%�%�'�����T���
��	���U����?�?��r8c�4�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rg)�DiffChangeTypei�r$r�������r{N)
r��
__module__�__qualname__�__firstlineno__�ADD�CHANGE�DELETE�	MOVE_AWAY�	COPY_AWAY�	MOVE_HERE�	COPY_HERE�	MULTICOPY�__static_attributes__r{r8rCrere�s*��
�C�
�F�
�F��I��I��I��I��Ir8rec� �\rSrSrSrSrSrSrg)�DiffFileTypei�r$r�rfr{N)r�rlrmrn�TEXT�IMAGE�BINARYrwr{r8rCryry�s���D�
�E�
�Fr8ryc��\rSrSrSr\R"SS9r\R"SS9r\R"SS9r	\R"SS9r
\R"SS9r\R"SS9r\R"SS9r
Srg)�phabhunki�zGRepresents a Differential hunk, which is owned by a Differential changerr)r8r{N)r�rlrmrnr�r�ib�	oldOffset�	oldLength�	newOffset�	newLength�corpus�addLines�delLinesrwr{r8rCr~r~�sg��Q�����"�I�����"�I�����"�I�����"�I�
�W�W�S�
!�F��w�w�q�!�H��w�w�q�!�Hr8r~c�x�\rSrSrSr\R"SS9r\R"SS9r\R"\R"\
5S9r\R"\R"\5S9r
\R"\R"\5S9r\R"\R"\5S9r\R"\R"S9r\R"\R(S9r\R"SS9r\R"SS9r\R"SS9r\R"\R"\
5S9rSrSrSrS	rS
rg)�
phabchangei�z�Represents a Differential change, owns Differential hunks and owned by a
Differential diff.  Each one represents one file in a diff.
Nr)rc��[URR55H1nURSS5nURUURU'M3 g)Nsnew:sold:)r��metadata�keys�replace)�selfrm�newkeys   rC�copynewmetadatatoold�phabchange.copynewmetadatatoold�sE����
�
�*�*�,�-�C��[�[��'�2�F�$(�M�M�#�$6�D�M�M�&�!�.r8c� �XRS'g�Ns
unix:filemode)�
oldProperties�r�rns  rC�
addoldmode�phabchange.addoldmode����/4���+�,r8c� �XRS'gr�)�
newPropertiesr�s  rC�
addnewmode�phabchange.addnewmode�r�r8c�\�[U[5(d[R"S5eURR[R"[R"U555 U=RUR-
sl
U=RUR-
slg)Ns'phabchange.addhunk only takes phabhunks)r>r~rr��hunks�appendr�byteskwargsr�asdictr�r�)r��hunks  rC�addhunk�phabchange.addhunk�sk���$��)�)��+�+�H�I�I��
�
���(�.�.�t�{�{�4�/@�A�B�	
�
�
����&�
��
�
����&�
r8r{)r�rlrmrnr�rr�currentPath�oldPath�Factoryr��	awayPathsr�r�r�r�rerpr�ryrz�fileType�
commitHashr�r�r�r�r�r�r�rwr{r8rCr�r��s�����'�'�$�'�K��g�g�d�#�G�������T� 2�3�I��w�w�t�|�|�D�1�2�H��G�G�D�L�L��$6�7�M��G�G�D�L�L��$6�7�M��7�7�>�0�0�1�D��w�w�|�0�0�1�H�����&�J��w�w�q�!�H��w�w�q�!�H��G�G�D�L�L��.�/�E�7�
5�5�'r8r�c��\rSrSrSr\R"SS9r\R"SS9r\R"SS9r	\R"SS9r
\R"SS9r\R"SS9r\R"S	S9r
\R"S
S9r\R"SS9r\R"SS9r\R"\R""\5S9r\R"S	S9rSrS
rg	)�phabdiffi�zURepresents a Differential diff, owns Differential changes.  Corresponds
to a commit.
r8r)r�s(0000000000000000000000000000000000000000shgsdefaultNr2snonec���[U[5(d[R"S5e[R
"[R"U55URUR'g)Ns)phabdiff.addchange only takes phabchanges)
r>r�rr�rr�rr��changesr�)r��changes  rC�	addchange�phabdiff.addchangesJ���&�*�-�-��+�+�J�K�K�+3�+?�+?��K�K���,
����V�'�'�(r8r{)r�rlrmrnr�rr�
sourceMachine�
sourcePath�sourceControlBaseRevision�sourceControlPath�sourceControlSystem�branch�bookmark�creationMethod�
lintStatus�
unitStatusr�r�r��repositoryPHIDr�rwr{r8rCr�r��s����
�G�G�C�(�M�����&�J� $���	� :������-���'�'�%�0��
�W�W�Z�
(�F��w�w�t�$�H��W�W�[�1�N�����)�J�����)�J��g�g�d�l�l�4�0�1�G��W�W�T�*�N�
r8r�c�&�UR5n[R"U/5n[R"SSS9n[[R"XAR5X%US95upxp�U
H�nUuup�p�nSRUSS5n[U	5nURU5 [R"[R"[R"U555unnnnnUR![#UU
UUUUU55 M� g)z'populate the phabchange for a text fileT���gitr	rYr8r$N)r
r�exactrr_�nextr�	diffhunksr\rNr��extend�diffstatsum�diffstatdatar �	iterlinesr�r~)�pchanger^rD�fnamer
�fmatcherr_�_pfctx�_fctx�header�fhunks�fhunkr�r�r�r��linesr��shunk�_mf�_mtr�r��_hbs                        rC�maketextr�s����8�8�:�D��{�{�E�7�#�H��~�~�$��6�H�$(�
����j�j�l�C��I�%�!�F�6���>C�;�4��y�e����%���)�$���V���
���U��,1�,=�,=����t�~�~�e�4�5�-
�)��S�(�H�c�	�����������
�
	
�r8c
���UR5Rn[USSU05nUR[	S5[	S5[U5S9nUHqnUR
5 US(aM[US5n[US5n[US	UU[R"UR5Xg5S
S.5 Ms SSS5 g!,(df   g=f)
zlupload large binary files as separate chunks.
Phab requests chunking over 8MiB, and splits into 4MiB chunks
sfile.querychunks�filePHIDsuploading file chunksschunks)�unit�totalscomplete�	byteStartsbyteEndsfile.uploadchunksbase64)r�r�rsdataEncodingN)r
rSr�makeprogressrr�	incrementr,�base64�	b64encoder�)�fctx�fphidrS�chunks�progressra�bstart�bends        rC�uploadchunksr�.s���
������B�
��0�;��2F�
G�F�	���	�
"�#�!�I�,�c�&�k�
�
�	��E���� ��[�!����|�,�-�F��u�Z�(�)�D���#�!&�"(�#�-�-�d�i�i�k�&�.F�G�%.�	�	
�
�
�
�
�s
�A8C�
C%c��UR5nURnUR5nUR5n[R
"[R"UR55R55nUUUS.n[USU5nUSnUS(anUR[S5[U5-5 U(d5U[R"UR55S.n	[USU	5nO)[!X5 OUR#S[U5-5 U(d"[$R&"S	[U5-5eU$)
z"upload binary files to Phabricator)�names
contentLengthscontentHashs
file.allocater�suploads
uploading %s
)r�sdata_base64sfile.uploadsserver already has %s
sUpload of %s failed.)r
rS�path�sizer�bytestr�hashlib�sha256r��	hexdigestrr�rr�r�r�r�r�rr�)
r�r
rSr�r��fhash�allocateparams�	fileallocr��uploadparamss
          rC�
uploadfiler�Is���9�9�;�D�	
���B��I�I�K�E��9�9�;�D����W�^�^�D�I�I�K�8�B�B�D�E�E�
����N�
�B� 0�.�A�I��k�"�E����
����$�%��d��3�4��� &� 0� 0����� =��L� ��N�L�A�E���%�
���+�e�D�k�9�:���k�k�1�E�$�K�?�@�@��Lr8c��U(aURU5(a�UR5URS'[R"[
R"UR555up4U(a#[R"U5URS'[U5nXPRS'g[RUl
UR5 g)z�add the metadata for the previous version of a binary file to the
phabchange for the new version

``oldfctx`` is the previous version of the file; ``fctx`` is the new
version of the file, or None if the file is being removed.
s
old:file:sizesold:file:mime-typesold:binary-phidN)�cmpr�r��	mimetypes�
guess_typerrHr�rr�r�ryrzr�r�)r��oldfctxr��	mimeguess�_encr�s      rC�addoldbinaryr�ns����4�8�8�G�$�$�-4�\�\�^����)�*�#�.�.��!�!�'�,�,�.�1�
��	��6>�6F�6F��7�G���2�3��7�#��/4���+�,�(�,�,����$�$�&r8c��[RUl[U5nX RS'UR5URS'[R"[R"UR555up4U(aQ[R"U5nX0RS'URS5(a[RUlggg)z)populate the phabchange for a binary filesnew:binary-phids
new:file:sizesnew:file:mime-typesimage/N)ryr|r�r�r�r�r�r�rrHr�rr�rgr{)r�r�r�r�r�s     rC�
makebinaryr��s���#�*�*�G���t��E�+0���'�(�)-����G���%�&��*�*�8�+@�+@�����+M�N�O�I���$�$�Y�/�	�2;���.�/����	�*�*�+�1�1�G��+�r8s120000s100755s100644)�l�xr8c���UR5RS5 g![aF UR5RR[
S5UR5-5 gf=f)zSdetect non-UTF-8 text files since Phabricator requires them to be marked
as binary
zutf-8Fs0file %s detected as non-UTF-8, marked as binary
T)r��decode�UnicodeDecodeErrorr
rSr�rr�)r�s rC�notutf8r�sa����	�	����7�#������	�	������
�B�C��i�i�k�
�	
���s�"�A
A2�1A2c�<�UH�n[XD[RS9nUR5UnUR	[
UR
55 UR5(d[U5(d[XQX$5 URU5 M� g)z:add removed files to the phabdiff. Shouldn't include moves)r�r�r�N)r�rerqr\r��gitmoder��isbinaryrr�r�)�pdiffr^rD�removedr�r�r�s       rC�
addremovedr�s{������>�3H�3H�
���*�*�,�u�%�����7�7�=�=�?�3�4�� � �"�"�g�g�&6�&6��W�s�2�
���� �r8c��UH�nX$nUR5Un[XDS9n[UR5n[UR5n	X�:wa"UR	U	5 URU5 UR
5(d5[U5(d%UR
5(d[U5(a[Xu5 [XvU5 O[XqX$5 URU5 M� g)z"add modified files to the phabdiff)r�r�N)r\r�rr�r�r�rrr�r�r�r�)
rr^rD�modifiedr�r�r�r��filemode�originalmodes
          rC�addmodifiedr�s������z���*�*�,�u�%����>���4�:�:�<�(���w�}�}��/���#����|�,����x�(�
�M�M�O�O��t�}�}����!�!��w����w�%���4�0��W�s�2�
���� �+r8c�0�0n0n0nX:wa%[R"UR5U5nUGH�nX(n	Sn
[US9n[U	R5nU(aUR
X�5n
O*Un
U	R5(aU	R5Sn
X�:gnU(GaHUR5U
n
[U
R5nX�lX�;aF[U
U
[RU/S9nUXm'URU
5 [RUl
O�X�;aJ[RXml
XmRR!U5 [R"Ul
OVX�;a[U
[R$S9nUX]'OX]nURR!U5 [R"Ul
X�:wa"UR'U5 UR)U5 O;UR)[U	R55 [R*Ul
U	R-5(d<[/U	5(d,U
(aDU
R-5(d[/U
5(a[1X�5 U(a[3X�U	5 O[5X�X(5 UR7U5 GM� UR95HunnUR7U5 M UR95HunnUR7U5 M g)z>add file adds to the phabdiff, both new files and copies/movesN)r�r)r�r�r�r�)r�r�)r
�
pathcopiesr\r�rr�r��renamedr�rerr�removertr�rvr�r�rursr�r�rorrr�r�r�r�r�)rr^rD�addedr�
copiedchanges�movedchangesr�r�r�r�r�r
�
originalfnamerr�origpchange�_path�copiedchange�movedchanges                    rC�addaddedr�s����M��L�
�D��~�� � �����s�3�����z������/���4�:�:�<�(��� �H�H�U�2�M�!�M��|�|�~�~� $����q� 1�
��(����j�j�l�=�1�G�"�7�=�=�?�3�L�+�O��'�(� -�)�'�1�1�$�g�	��/:��+����}�-�-�7�7����.�3A�3K�3K��+�0��+�5�5�<�<�U�C�-�7�7��� �5�",�$1��8P�8P�#�K�4?�M�0�"/�">�K��%�%�,�,�U�3�-�7�7����'��"�"�<�0��"�"�8�,�����w�t�z�z�|�4�5�)�-�-�G�L�
�M�M�O�O��t�}�}��W�-�-�/�/�7�7�3C�3C��w�%���W�t�4���W�s�2�
���� �A�D -�2�2�4���|�
����%� 5�*�0�0�2���{�
����$�3r8c	�Z�UR5n[U5n[SUR5R	5-SUR5-S9nUR5R
U5upVpxp�n[X@XU5 [X@X5 [X@X5 U(aX4l
[URS[R"[R "U555nU(d9X:wa[#S5X4-n
O[#S5U-n
[$R&"U
5eU$)zcreate a Differential Diffs%s)r�r�sdifferential.creatediffscannot create diff for %s::%sscannot create diff for %s)r
rr�r\�hexr��statusrrrr�rrSrr�rr�rrr�)r^rDr
rrr	rr�_d�_u�_i�_c�diffr�s              rC�
creatediffr"#s����8�8�:�D��4� �H��"'�'�*�*�,�*:�*:�*<�"<��s�z�z�|�#�
�E�07�z�z�|�/B�/B�3�/G�,�H�W�"�"�
�U�S��1����.��u�s�,��'������"����T�[�[��/�0��D�
��>��4�5���F�C��0�1�C�7�C��k�k�#����Kr8c
��URSURS55nUSnUSnUS[R"UR5SUR	5-UR5UR
5UR5R
5S.5S.n[UR5RS	U5 0nUH�n[R"UR55[R"UR55[UR	5S5UR
5UR5R
5/UR5S
.XgR
5'M� US[R"U5S.n[UR5RS	U5 g)
z�write metadata to diff so patches could be applied losslessly

``ctxs`` is the list of commits that created the diff, in ascending order.
The list is generally a single commit, but may be several when using
``phabsend --fold``.
sdiffidr*r����hg:metas%d %d)�user�date�branch�node�parent)sdiff_idr�rsdifferential.setdiffproperty)�author�authorEmail�time�commit�parentsr(�
local:commitsN)r�rr�r�r'r�rr\rr
rSr"�person�emailr,)�ctxsr!�diffidr^�tipctxr��commitsrDs        rC�writediffpropertiesr7Bs[���X�X�i����%��
1�F��1�g�G�
�"�X�F��� �%�%�����!�F�K�K�M�1�!�=�=�?�����"�:�:�<�+�+�-�
�
��F������!�!�#B�F�K��G���!�(�(�����4�&�,�,�S�X�X�Z�8������A��'��w�w�y��������(��z�z�|�

����	����!� �%�%�g�.��F�
�����!�!�#B�F�Kr8c
���USnUSn	UR5n
U(aG[R"SSS9nU
R5nX�n
X�n[	X�U5[	X�U5:gnOSn/nU(a>[X�5nUR
SUSS.5 U(aUR
S	US.5 OU(deUn[UU5 U(aUR
S
U/S.5 U(aUU-
n[R"5n[U5H�unnUR5n[U
RSSU05nS
H�nUSRU5nU(dM US:XaUR5UU'M;US:XaSnSR![#SURU5UR5/55UU'M� M� UR%5HunnUR
UUS.5 M SU0nUbUUS'[U
RSU5nU(dC['U5S:Xa[)S5U-nO[)S5X�4-n[*R,"U5eUU4$)a�create or update a Differential Revision

If revid is None, create a new Differential Revision, otherwise update
revid. If parentrevphid is not None, set it as a dependency.

If there is a single commit for the new Differential Revision, ``ctxs`` will
be a list of that single context.  Otherwise, it is a list that covers the
range of changes for the differential, where ``ctxs[0]`` is the first change
to include and ``ctxs[-1]`` is the last.

If oldnode is not None, check if the patch content (without commit message
and metadata) has changed before creating another diff.  For a Revision with
a single commit, ``oldbasenode`` and ``oldnode`` have the same value.  For a
Revision covering multiple commits, ``oldbasenode`` corresponds to
``ctxs[0]`` the previous time this Revision was posted, and ``oldnode``
corresponds to ``ctxs[-1]``.

If actions is not None, they will be appended to the transaction.
r$rTr�r�supdater�stypesvalue�commentsparents.setsdifferential.parsecommitmessagescorpus)�title�summary�testPlan�fieldsr;r<�

N�transactions�objectIdentifier�differential.revision.editr$scannot create revision for %ss!cannot create revision for %s::%s)r
rr_r.rcr"r�r7r rPr�r9rrSr��rstriprN�filterr�rrrr�)r3�revid�
parentrevphid�oldbasenoderP�olddiff�actions�commentrDr^r
r_rA�oldctx�
oldbasectx�neednewdiff�transactionsr!�fields�i�_ctx�desc�infor�r�r��revisionr�s                            rC�createdifferentialrevisionrUos^��:�r�(�C��1�g�G��8�8�:�D���>�>�d�E�:����� ������&�
��g�H�5����:
�
�����L���'�'�����i�4��=�I�J�����*�� H�I��
��w�����d�#�����$���@�	
�������]�]�_�F��T�?���4����!����G�G�7�)�T�9J�
��5�A��Y��#�#�A�&�A����A�v��H�H�J��q�	���h���� ���V�D�6�:�:�a�=�!�(�(�*�2M�%N�O�F�1�I�!5�#�2������1����a�1�5�6���|�
,�F���&+��"�#��4�7�7�$A�6�J�H���t�9��>��4�5��;�C��8�9�W�N�J�C��k�k�#����T�>�r8c��UVs/sHo"R5PM nnSSU00n[USU5nUSnUVs1sHofSSR5iM nn[U5U-
nU(a:[R"[S5SR
[U55-5eUVs/sHofS	PM	 sn$s snfs snfs snf)
zconvert user names to PHIDsrs	usernamessuser.searchrr>susernamesunknown username: %s� r)�lowerrr6rr�rrNr?)	rS�namesr�rrYr��entry�resolved�
unresolveds	         rC�	userphidsr]�s���&+�,�e�d�Z�Z�\�e�E�,�
�l�E�2�3�E�
��^�U�
3�F��'�?�D�CG�H�4�%�i� ��-�3�3�5�4�H�H��U��h�&�J���k�k�
�%�&����6�*�3E�)F�F�
�	
�)-�-��u�'�N��-�-��
-��I��.s�C�C�0Cc��UR[S5[S5[S5S.USU-5nURSU-S5n[R"XS5nUR	[S	5XTU4-5 g
)z�print the ``action`` that occurred when posting ``ctx`` for review

This is a utility function for the sending phase of ``phabsend``, which
makes it easier to show a status for all local commits with `--fold``.
�created�skipped�updated)r_r`rasphabricator.action.%sr$r7r2s
%s - %s - %s
N)�labelrr�format_changeset_summaryr�)rSrD�newrevid�action�
actiondesc�drevdesc�summarys       rC�_print_phabsend_actionri�s�������*�
��*�
��*�
�	
��		�
	!�6�)�
�J��x�x���)�+>�?�H��.�.�r��D�G��H�H�Q� �
!�X�7�$C�
C�Dr8c�j�[URS[R"UVs/sHn[	U5PM sn5-5 [UVs/sHoPUPM	 snU5 gs snfs snf![RRa! URRSU-5 gf=f)z�update the local commit list for the ``diff`` associated with ``drevid``

This is a utility function for the amend phase of ``phabsend``, which
converts failures to warning messages.
snew commits: %s
s"Failed to update metadata for D%d
N)
r�rSr"r>rr7r r�r��
warnnoi18n)rA�drevid�newnodesr!r!rLs      rC�_amend_diff_propertiesrns��������z�0�0�H�1M�H�q�%��(�H�1M�N�N��
L��(�C�(�w�'�]�(�C�T�J��	2N��D���;�;���L�	
�����A�F�J�K�L�s)�A)�		A3�A.� A3�.A3�3<B2�1B2�r�revsrevisions to sendsREV�amendsupdate commit messages�reviewersspecify reviewers�blockersspecify blocking reviewers�mr:s1add a comment to Revisions with new/updated Diffss#ask for confirmation before sending�folds%combine the revisions into one reviews
REV [OPTIONS])r�c�@^�[R"U5n[U5URS/5-n[R
"TU5nUR
5 U(d[R"[S55eURS5(a[R"T5 UVs/sHnTUPM
 nn[SU55(a[R"[S55eU4SjnTRSU5n[U5S:�a	U"US	5 TRS
U5n[U5S:�a	U"US5 URS5n	U	(a�[U5S:Xa[R"[S
55eURS5(d[R"[S55eUV
s/sH&n
[R!U
R#55PM( nn
[UVs1sHo�(dMUR%S5iM sn5S:�a[R"[S55e['TUV
s/sHn
TU
R)5PM sn
5nUR+SS5nU[-URS55-nU(a2[/TX.5nU(d[R"[S55e/nURS/5nURS/5n/nU(a%UR1[3TR4U55 U(a0UR1[7S[3TR4U555 U(aUR9SUS.5 /n0nSnUGH}n
U	(a6UR;SU
R=5USR=54-5 O"UR;SU
R=5-5 URU
R)5S5unnnUUUnnnU	(a'URUSR)5S5unnnUU
R)5:wdURS5(Ga[?U	(aUOU
/UUUUUUURS55unnU	(aUHn
UUU
R)5'M OUUU
R)5'[AUSS 5n USS!n!U(aS"n"OS#n"U	(du[R!U
R#55nU(a[AUR%S$55U :wa-S%U -n#[BRD"TU#U
R)5SSSS&S'9 O#[GTR4S(U-5S)S!n!Un S*n"UR9U 5 U!nU	(aFUH>n$URU$R)5S5S+(aS"n"OS#n"[IUU$U U"5 M@  O[IX
U U"5 GM� URS5(Ga�TRK5n%[MUS,S-U05n&TRO5 TRQ5 TRSS5 TRUS.UU5V$s/sHn$U$PM n'n$U%S/R)5n(0n)/n*US)n+[WU5GH�un,nU%Un-U	(dUU,n+U&V.s/sHn.[AU.S 5U+:XdMU.PM sn.S)n/[YU/U-U	5n0U-R#5U0:wdEU-R[5R)5U);d#U-R]5R)5U);Ga�U-R_5[`Rb:Xa3URe[S05[fRh"U-5-5 M�U)RU-R[5R)5U-R[545S)U)RU-R]5R)5U-R]545S)/n1[jRl"TU0U)5n0[nRp"TU-U1U0U-Rs5U-Ru5U-Rw5S19n2U2Ry5n3U3/U)U-R)5'U	(aU*R9U35 GM[{U%U+U3/UU-R)55 S%U+-n#U#TRC5;a'[BRD"TU#TR|SSSS&S'9 GMxGM{U	(dGM�U*R9U-R)55 GM� U	(agU*(a`UW-R)5nW(a[UU*5[U5:wa[�US2U+-5 [{U%U+U*U5 O#[�US3U+-5 OU	(a[�US45 U'GH~n-U)RU-R[5R)5U-R[545S)U)RU-R]5R)5U-R]545S)/n1[nRp"TU-U1[jRl"TU-R#5U)5U-Rs5U-Ru5U-Rw5S19n2U2Ry5n3U3U-R)5:waHU3/U)U-R)5'[�US5[�U-R)55[�U354-5 GMX[�US6[�U-R)55-5 GM� [fR�"TU)SS&S79 U(U);aU%R�U)U(S)5 SSS5 SSS5 SSS5 ggs snfs sn
fs snfs sn
fs sn$fs sn.f!,(df   N>=f!,(df   NG=f!,(df   g=f)8a�upload changesets to Phabricator

If there are multiple revisions specified, they will be send as a stack
with a linear dependencies relationship using the order specified by the
revset.

For the first time uploading changesets, local tags will be created to
maintain the association. After the first time, phabsend will check
obsstore and tags information so it can figure out whether to update an
existing Differential Revision, or create a new one.

If --amend is set, update commit messages so they have the
``Differential Revision`` URL, remove related tags. This is similar to what
arcanist will do, and is more desired in author-push workflows. Otherwise,
use local tags to record the ``Differential Revision`` association.

The --confirm option lets you confirm changesets before sending them. You
can also add following to your configuration file to make it default
behaviour::

    [phabsend]
    confirm = true

By default, a separate review will be created for each commit that is
selected, and will have the same parent/child relationship in Phabricator.
If ``--fold`` is set, multiple commits are rolled up into a single review
as if diffed from the parent of the first revision to the last.  The commit
messages are concatenated in the summary field on Phabricator.

phabsend will check obsstore and the above association to decide whether to
update an existing Differential Revision, or create a new one.
rps(phabsend requires at least one changesetrqc3�R# �UHoR5(dMUv� M g7fr<)�obsolete)�.0�cs  rC�	<genexpr>�phabsend.<locals>.<genexpr>^s���
+�d��j�j�l�1�1�d�s�'�	's,obsolete commits cannot be posted for reviewc��>�UVs/sHnTUR5PM nn[R"[S5U[R
"TU54-[S5S9es snf)Ns)cannot phabsend multiple %s revisions: %ss&the revisions must form a linear chain)�hint)rCrr�rr�
nodesummaries)rU�revtype�r�badnodesr
s    �rC�_fail_nonlinear_revs�&phabsend.<locals>._fail_nonlinear_revsesc���,0�1�D�q�D��G�L�L�N�D��1��k�k�
�:�;���-�-�d�H�=�>�
?��<�=�
�	
��2s�A&s
heads(%ld)r$sheads
roots(%ld)srootruscannot fold a single revisionscannot fold with --no-amendrs0cannot fold revisions with different DREV valuesr2r3sphabsend cancelledrrrsc��SU-$)Nsblocking(%s)r{)�phids rCrD�phabsend.<locals>.<lambda>�s	��_�t�3r8s
reviewers.addr9Nssending rev %d::%d
r$ssending rev %d
�NNNr:sobjectr*rrar_rr$Tr%r�rr`r��differential.query�idss4(%ld::) - (%ld) - unstable() - obsolete() - public()�.s'warning: not updating public commit %s
)�parents�textr�r'�extras#updating local commit list for D%d
s0local commit list for D%d is already up-to-date
sno newnodes to update
srestabilizing %s as %s
snot restabilizing unchanged %s
)�fixphase)Drr�r�r�r�revrange�sortrr�rr�checkunfinished�anyrUrr7r8r9r�rSrCr�r��_confirmbeforesendr�r]rS�mapr�r�rVrUr,rr;�	querydrevrir.r�wlock�lock�transactionr6r��get_amended_descr\�p2�phaser�publicrMr�formatchangeidr�update_hash_refsr	�metadataonlyctxr�r'r��commitrnr<rr�r�cleanupnodes�
setparents)4rSr
rUrXrVr3r��heads�roots�foldrD�drevmatchersrFr��oldmap�confirm�	confirmedrI�	reviewers�blockers�phids�drevids�diffmap�lastrevphidrPrHrErG�oldbasediff�oldbaserevidrTr!rd�
newrevphidrerOrzrArJ�restack�wnode�mappingrmrlrP�oldrrI�newdescr��newrLs4 `                                                  rC�phabsendr�s$
���h����%�D���:������,�,�D����t�T�*�D��I�I�K���k�k�!�G�H�I�I��x�x��������%�!%�&��#�D��I��D�&�
�
+�d�
+�+�+��k�k�!�K�L�M�M�
�
�I�I�m�T�*�E�
�5�z�A�~��U�G�,��I�I�m�T�*�E�
�5�z�A�~��U�G�,��8�8�G��D���t�9��>��+�+�a� @�A�B�B��x�x��!�!��+�+�a� >�?�@�@��
���
(�.�.�s���/@�A��	�
���:��1���������:�;�a�?��+�+��E�F��
�
�t�d�%C�d��d�1�g�l�l�n�d�%C�
D�F��m�m�K��4�G��t�D�H�H�Z�(�)�)�G��&�t�T�:�	���+�+�a� 5�6�7�7��G�����b�)�I��x�x�
�B�'�H��E��
���Y�t�w�w�	�2�3��
����3��$�'�'�8�,�
�	
�
����!1�U�C�D��G��G��K�����H�H�,����	�4��8�<�<�>�/J�J�K��H�H�(�3�7�7�9�4�5�#)�*�*�S�X�X�Z�9K�"L����%�18�'�5�,�[���5;�Z�Z��R��
�
��!3�6�2�K��l��c�h�h�j� �D�H�H�X�$6�$6�7���3�%�����������$�	�N�H�d���C�*.�G�C�H�H�J�'� �'+�����
�#��8�I�.�u�5�6�H�!�)�,�W�5�J��#��#���/�6�6�s���7H�I���C�����
�.�(�:�$�x�/�G��H�H������
� $�!�!�"���#�4�7�7�E�E�M�:�1�=�g�F�J��H��F����x� � ������:�:�a�f�f�h�(:�;�A�>�'�F�'�F�&�r�1�h��?��
��r��&�9�W�\�x�x������� ���B� 5���7H�I��
�Z�Z�\�4�9�9�;��(8�(8��(E����K������A���
����J�O�O�%�E��G��H��Q�Z�F�#�D�/���3��3�i���$�Q�Z�F�#(�D�5�a�C��%��M�V�,C��5�D�Q�G��*�4��d�;���O�O�%��0��v�v�x�}�}��'�1��v�v�x�}�}��'�1��y�y�{�f�m�m�3�����I�J�%�4�4�S�9�:��!����C�F�F�H�M�M�O�c�f�f�h�[�A�!�D����C�F�F�H�M�M�O�c�f�f�h�[�A�!�D��G�*�:�:�����G�
"�1�1��� '�$� �X�X�Z� �X�X�Z�!�i�i�k��C�"�j�j�l�G�+2�)�G�C�H�H�J�'��!����0� �*��f�w�i������1D��
%�v�o�G��$�)�)�+�-���� �#� �K�K�$(�!%�!%�"&��.��T�
�O�O�C�H�H�J�/�M*�T���s�x�x�z�*���#�h�-�?�7�3K�"K��2�F��O�P�*�4���4�H���L� �!��
��r�5�6�
���K�K�����
�
��#�&�&�(��=�a�@��K�K�����
�
��#�&�&�(��=�a�@����-�-���#�$�5�5��c�o�o�/������������)�)�+�
���*�*�,���c�h�h�j�(�+2�)�G�C�H�H�J�'���3� �����,�e�G�n�=�>����;�e�C�H�H�J�>O�O��;�D
� � ��w��d�K����������q� 1�2�m)F�;�\�\���I'��Z
��;��&D��h��$E�-)F�(E��;�;��\�\�s��3o�-o�
o�o�"o
�$p�5o>�o-�o#
�)Ao-�.o(�o(�Io-�Io-�5o>�=p�#
o-�-
o;�7o>�>
p	�p�
p))r&sUser)r'sDate)r(sBranch)r)sNode ID)r*sParent c
���[UR5up4URnUH�nXnURUR5S5up�n
U
(aUR	SU
-S5nOUR	[S5S5nUR
[S5U[R"XWS54-5 M� UR[S5U-5(agg	)
Nr�r$r7sNEWs%s - %s
r2s1Send the above changes to %s (Y/n)?$$ &Yes $$ &NoFT)
r�rSr�rCrbrr�rrc�promptchoice)r
rUr�rr�rSrVrDrPrHrlrgs            rCr�r��s����d�g�g�&�J�C�	
���B����i��#)�:�:�c�h�h�j�:L�#M� ��&���x�x����1D�E�H��x�x��&�	�+>�?�H�
���
�l�O���0�0��+�F��
�	
�� 
���	�
>�?�#�E����r8>�closed�accepted�	abandoned�needsreview�
needsrevision�changesplannedc�H�USRSS5R5$)z7get normalized status name from a Differential Revision�
statusNamerWr8)r�rX)rIs rC�_getstatusnamer��s#���
��&�&�t�S�1�7�7�9�9r8)r(N)�groupr$�)NN)rkN)�	ancestorsrkNN)rhNN)�and_rhN)rgNN)�addrgN)rgNN)�subrgN)rNNNN)r�symbolNNN)�(�:�&�+�-r�r��endc
#�X^# �[U5nSmSn[U5nX#:aSR[R"U4Sj[
R"XS555nU(aSXB4v� U[U5-
nOXUS-S:waXUS-SU4v� US-
nX#:aMSSU4v� g7f)	Ns():+-& rr8c�>�UT;$r<r{)�ch�specials �rCrD�_tokenize.<locals>.<lambda>�s
���2�W�,r8r�r$rWr�)�
memoryviewrrN�	itertools�	takewhiler�iterbytestr)r��view�pos�length�symbolr�s     @rC�	_tokenizer��s������d��D��G�
�C�
��Y�F�

�,�������,�h�.B�.B�4��:�.N�
�
��
��f�*�*��3�v�;��C��#��'�"�d�*��#��'�*�D�#�6�6��1�H�C��,��4��
��s�BB*�"B*c��[R"[5R[U55upU[	U5:wa[
R"SU5eU$)Ns
invalid token)r�	_elements�parser�rr�
ParseError)r��treer�s   rC�_parser��sF���
�
�i�(�.�.�y���?�I�D�
�c�$�i�����/��5�5��Kr8c��URS5(a&USSR5(a[USS5$UR5(a[U5$g)z<str -> int or None, ex. 'D45' -> 45; '12' -> 12; 'x' -> None�Dr$N)rg�isdigitr,)r�s rC�
_parsedrevr��sS��
������6�!�"�:�#5�#5�#7�#7��6�!�"�:���
�~�~����6�{��r8c��[5n[5nUSnUS:Xa)[US5nU(aURU5 X4$US:XaF[US5upEUR	U5 UR	U5 UR	U5 X4$USSH2n[U5upEUR	U5 UR	U5 M4 X4$)z9return ({single-drev-id}, {ancestor-drev-id}) to prefetchrr�r$r�N)r6r��add�_prefetchdrevs�update)r�rJ�
ancestordrevs�opr��a�ts       rCr�r�s����E�E��E�M�	
�a��B�	�Y���t�A�w�����I�I�a�L����
�|�	��d�1�g�&���
���Q�����Q�����Q�����	�a�b��A�!�!�$�D�A��L�L��O�� � ��#����r8c
��^^^	^
^^�U
U4SjmU4Sjm	0m
[U5n[U5up4TRSS5n[U5nUH-nUR	[[
SXu-
5US-55 M/ U(aT"S[U505 [[T	"[U555[U5-5mU	U
UU4SjmT"U5Vs/sHnT
UPM
 sn$s snf)a^return a list of "Differential Revision" dicts

spec is a string using a simple query language, see docstring in phabread
for details.

A "Differential Revision dict" looks like:

    {
        "activeDiffPHID": "PHID-DIFF-xoqnjkobbm6k4dk6hi72",
        "authorPHID": "PHID-USER-tv3ohwc4v4jeu34otlye",
        "auxiliary": {
          "phabricator:depends-on": [
            "PHID-DREV-gbapp366kutjebt7agcd"
          ]
          "phabricator:projects": [],
        },
        "branch": "default",
        "ccs": [],
        "commits": [],
        "dateCreated": "1499181406",
        "dateModified": "1499182103",
        "diffs": [
          "3",
          "4",
        ],
        "hashes": [],
        "id": "2",
        "lineCount": "2",
        "phid": "PHID-DREV-672qvysjcczopag46qty",
        "properties": {},
        "repositoryPHID": "PHID-REPO-hub2hx62ieuqeheznasv",
        "reviewers": [],
        "sourcePath": null
        "status": "0",
        "statusName": "Needs Review",
        "summary": "",
        "testPlan": "",
        "title": "example",
        "uri": "https://phab.example.com/D2",
    }
c�>>�URS5=(d URS5=(d S/SnUT;aTU$[TSU5nUHnUTUS'UT[US5'M UT;a"[R"[S5U-5eTU$)	zparams -> single drev or Noner��phidsNrr�rr*s#cannot get Differential Revision %r)r�rr,rr�r)r�rmrJrI�
prefetchedrSs    ��rC�fetch�querydrev.<locals>.fetchKs�����z�z�&�!�C�V�Z�Z��%9�C�d�V�Q�G���*���c�?�"��B� 5�v�>���D�(,�J�t�G�}�%�+/�J�s�4��;�'�(���j� ��+�+��8�9�F�B��
��#��r8c��>�[5n/nUVs/sHnSU/0PM
 nnU(a�UR5nT
"U5nUSU;aM*URUS5 UR[	US55 URS05nURS/5nUHn	URSU	/05 M U(aM�UR
5 [R"U5$s snf)z6given a top, get a stack from the bottom, [id] -> [id]r�r*s	auxiliarysphabricator:depends-onr�)	r6r�r�r�r,r��reverser�baseset)�
topdrevids�visitedrYrP�queuer�rI�	auxiliary�dependsr�r�s          �rC�getstack�querydrev.<locals>.getstack[s�����%����(2�3�
�1�&�1�#��
��3���Y�Y�[�F���=�D��E�{�g�%���K�K��U��$��M�M�#�d�5�k�*�+�����r�2�I��m�m�$=�r�B�G������h���/�0� ��e�	��������'�'��4s�C.r&r'r$r�c�>�USnUS:Xa�[US5nU(a[R"U/5$US[;a?TVs/sHn[	TU5US:XdMUPM nn[R"U5$[
R"[S5US-5eUS;aN[U5S:Xde[[[R"U55"T"US5T"US55$US:XaT"US5$US	:XaT"T"US55$[
R"S
U-5es snf)Nrr�r$sunknown symbol: %s>r�r�r�rfr�r�r�sillegal tree: %r)r�rr��_knownstatusnamesr�rr�rr�getattr�operatorr�sysstr�ProgrammingError)	r�r�rIr�rJrr��validids�walks	     ����rCr
�querydrev.<locals>.walk�sE���
�!�W��
��?��d�1�g�&�D���'�'���/�/��a��-�-�&��%��%�j��m�4��Q��?��%���
 �'�'��.�.��k�k�!�$9�":�T�!�W�"D�E�E�
�,�
,��t�9��>�!�>��8�X�_�_�R�%8�9��T�!�W�
�t�D��G�}��
��8�^���Q��=� �
�<�
��D��a��M�*�*��(�(�)<�t�)C�D�D��%s�
D?�'D?)	r�r�r�r6r�r�r=r�r?)
rSr�r�rJr��	batchsize�tofetchr�r�rr�r	r
s
`       @@@@@rCr�r�s����\� (�(�J��$�<�D�)�$�/��E����^�\�:�I��%�j�G�
�����u�S��A�M�2�A��E�:�;���
�v�t�G�}�%�&��c�(�4�
�#6�7�8�3�u�:�E�F�H�E�E�6$(��:�.�:�a�J�q�M�:�.�.��.s�C,c	��USnUSR5nUSR5nU(aSU-nSUS-nSR[SXX4/55$)	z�get description (commit message) from "Differential Revision"

This is similar to differential.getcommitmessage API. But we only care
about limited fields: title, summary, test plan, and URL.
r;r<r=s
Test Plan:
%s�Differential Revision: %s�urir?N)rCrNrD)rI�titlerh�testplanrbs     rC�getdescfromdrevr�si��
��N�E��:��%�%�'�G��K� �'�'�)�H��$�x�/��
&��f��
5�C��<�<��t�e�h�%D�E�F�Fr8c��U(d[U5$SUS-n[RUR55nU(d!SR	UR5U/5$[RX1R55$)a!similar to ``getdescfromdrev``, but supports a folded series of commits

This is used when determining if an individual commit needs to have its
message amended after posting it for review.  The determination is made for
each individual commit, even when they were folded into one review.
rrr?)rr7r8r9rNru)rIrD�foldedrbrFs     rCr�r��so����t�$�$�
&��f��
5�C�	$�*�*�3�?�?�+<�=�A���|�|�S�_�_�.��4�5�5�&�*�*�3���0A�B�Br8c�B�URS5=(d 0nURS5=(d 0n[U5S:�a*UR5Vs1sHn[U5iM sn$[[	U5RSS55=(d S1$s snf)zcget the set of local commits from a diff object

See ``getdiffmeta()`` for an example diff object.
�
propertiesr0r$r)r8N)r�rr�r�getdiffmeta)r!�propsr6rzs    rCrr�s���

�H�H�]�#�)�r�E��i�i�(�)�/�R�G�
�7�|�a�� '����/��1��A���/�/�
��D�!�%�%�g�s�3�4�<��=�=��	0s�Bc���URS5=(d 0nURS5nU(d�URS5(a�[USR55Sn0nSU;aSU;aSUSUS4-US'S	U;aS
[US	5-US'SU;aUSUS'URS
URS55nU(aXBS'[	URSS55S:�aUSSUS'O0nSU;aSU;aSUS-US'SU;aURS5(aUSUS'SU;aURS5(aUSUS'U$)aIget commit metadata (date, node, user, p1) from a diff object

The metadata could be "hg:meta", sent by phabsend, like:

    "properties": {
      "hg:meta": {
        "branch": "default",
        "date": "1499571514 25200",
        "node": "98c08acae292b2faf60a279b4189beb6cff1414d",
        "user": "Foo Bar <foo@example.com>",
        "parent": "6d0abad76b30e4724a37ab8721d630394070fe16"
      }
    }

Or converted from "local:commits", sent by "arc", like:

    "properties": {
      "local:commits": {
        "98c08acae292b2faf60a279b4189beb6cff1414d": {
          "author": "Foo Bar",
          "authorEmail": "foo@example.com"
          "branch": "default",
          "commit": "98c08acae292b2faf60a279b4189beb6cff1414d",
          "local": "1000",
          "message": "...",
          "parents": ["6d0abad76b30e4724a37ab8721d630394070fe16"],
          "rev": "98c08acae292b2faf60a279b4189beb6cff1414d",
          "summary": "...",
          "tag": "",
          "time": 1499546314,
        }
      }
    }

Note: metadata extracted from "local:commits" will lose time zone
information.
rr%r0rr+r,s%s <%s>r&r-s%d 0r'r(r.rpr)r/r{r$r*sdateCreateds%s 0ssourceControlBaseRevision)r�r?r:r,r)r!r�metar�rCs     rCrr�s���L
�H�H�]�#�)�r�E��9�9�Z� �D���9�9�%�&�&��E�"2�3�:�:�<�=�a�@�F��D��F�"�~��'?� *��9�%��>�*�.�!��W�
��&� � '�#�f�W�o�*>� >��W�
��F�"�"(��"3��Y���:�:�i����F�);�<�D�� $�W�
��6�:�:�j�"�-�.�!�3�"(��"4�Q�"7��Y����D��d��~��5��$�~�"6�6��W�
�������)�!4�!4��y�/��Y��������*F�!G�!G��;�<��Y���Kr8c��^�[U5S:�a?U4SjnSR[R"X255n[	X5nU(aU$[
R"[S55e)zconvert user supplied DREVSPECs into "Differential Revision" dicts

See ``hg help phabread`` for how to specify each DREVSPEC.
rc�&>�T(aSU-nSU-$)Ns:(%s)s(%s)r{)r�stacks �rC�_formatspec�_getdrevs.<locals>._formatspec#s�����q�L���Q�;�r8r�sempty DREVSPEC set)rrNr�maplistr�rr�r)rSr�specsrr�rJs `    rC�	_getdrevsr#sW���
�5�z�A�~�	�
�y�y��)�)�+�=�>���"�#����L�
�+�+�a�-�.�
/�/r8c
��[UVs1sHn[SUS55iM sn5n[USSU05n/nUH�nUR[	S5US-5 [SUS55n[USS	U05n[U5n	S
n
[
USU-5n[R5HnX�;dM
U
S[UX�4--
n
M S
X�U4-n
URUSU
45 M� U"U5 gs snf)agenerate plain-text patch readable by 'hg import'

write takes a list of (DREV, bytes), where DREV is the differential number
(as bytes, without the "D" prefix) and the bytes are the text of a patch
to be imported. drevs is what "querydrev" returns, results of
"differential.query".
c3�8# �UHn[U5v� M g7fr<r+�ryr�s  rCr{�readpatch.<locals>.<genexpr>:s���9�.�Q�#�a�&�&�.���sdiffsrr�sreading D%s
r*c3�8# �UHn[U5v� M g7fr<r+r&s  rCr{r'Cs���4�^��S��V�V�^�r(sdifferential.getrawdiffsdiffIDs# HG changeset patch
r�s# %s %s
s%s%s
%sN)
r?r=r�noterrr�_metanamemapr�r�)rSrJr�rI�diffidsrM�patchesr4rfrRr�rr��contents              rC�	readpatchr/1s���e�L�e�d�c�9�$�x�.�9�9�e�L�M�G���6���8I�J�E��G���
����"�#�d�5�k�1�2��4�T�(�^�4�4���2�9�I�v�;N�O���t�$��*��
�5����0�1���"�"�$�A��y��,�,�q�/�4�7�)C�C�C��%���t� 4�4������U��W�-�.�#�(
�'�N��5Ms�Dsphabread�stacksread dependenciessDREVSPEC... [OPTIONS]r�c�^�[R"U5n[TURS5U5nU4Sjn[	TXE5 g)a�print patches from Phabricator suitable for importing

DREVSPEC could be a Differential Revision identity, like ``D123``, or just
the number ``123``. It could also have common operators like ``+``, ``-``,
``&``, ``(``, ``)`` for complex queries. Prefix ``:`` could be used to
select a stack.  If multiple DREVSPEC values are given, the result is the
union of each individually evaluated value.  No attempt is currently made
to reorder the values to run from parent to child.

``abandoned``, ``accepted``, ``closed``, ``needsreview``, ``needsrevision``
could be used to filter patches by status. For performance reason, they
only represent a subset of non-status selections and cannot be used alone.

For example, ``:D6+8-(2+D4)`` selects a stack up to D6, plus D8 and exclude
D2 and D4. ``:D9 & needsreview`` selects "Needs Review" revisions in a
stack up to D9.

If --stack is given, follow dependencies information and read all patches.
It is equivalent to the ``:`` operator.
r0c�>>�UHupTRU5 M gr<)r�)r-rIr.rSs   �rC�_write�phabread.<locals>._writevs���$�M�D��H�H�W��%r8N)rr�r#r�r/)rSr
r"rXrJr3s`     rC�phabreadr5Ws=���8����%�D��b�$�(�(�8�,�e�4�E���b�%� r8simport dependencies as wellc�B^^^�[R"T5mSTS'STS'STS'STS'TRS	S
5(aSTS
'TRS	S5(aSTS'UUU4Sjn[TTR	S5U5n[TRXT5 g
)z�import patches from Phabricator for the specified Differential Revisions

The patches are read and applied starting at the parent of the working
directory.

See ``hg help phabread`` for how to specify DREVSPEC.
Tsbypassr$sstripr8sprefixFr6r4r5c��>�T	SR5nT	R5 T	R5 T	RS5 UH�up#T
R	[S5U-5 [R"T
[R"U55n[R"T
T	UUT/S5upVnU(d"[R"[S5U-5eT
RUS-5 T	U/nSSS5 M� SSS5 SSS5 SSS5 g!,(df   M�=f!,(df   N1=f!,(df   N:=f!,(df   g=f)Nr4sapplying patch from D%s
sD%s: no diffs found�
)r�r�r�r�rrr�extract�io�BytesIOr�tryimportonerr�r*)r-r�rI�contents�	patchdatar�rC�rejrXr
rSs        ���rCr3�phabimport.<locals>._write�s����t�*�$�$�&��
�Z�Z�\�4�9�9�;��(8�(8��(G�")����	�	�!�8�9�D�@�A��]�]�2�r�z�z�(�';�<�	�%,�%9�%9���!�����&�N�C�s� �#�k�k�!�,B�*C�d�*J�K�K��G�G�C�%�K�(�#�D�z�l�G�=�<�#*�)H�;�\�\�=�<��	)H�(G��;�;��\�\�sT�E�E�AD2�A#D �;D2�E�E� 
D/�*D2�2
E�<E�
E	�
E�
E"r0N)rr�r�r#r�r/rS)rSr
r"rXr3rJs`` `  rC�
phabimportrA}s��������%�D�
�D��O��D��N��D��O��D���	�}�}�]�I�.�.���Y��	�}�}�]�K�0�0� ��[��+�0
�b�$�(�(�8�,�e�4�E�
�d�g�g�u�%r8s
phabupdate�acceptsaccept revisions�rejectsreject revisions�request-reviewsrequest review on revisions�abandonsabandon revisions�reclaimsreclaim revisions�closesclose revisions�reopensreopen revisions�plan-changessplan changes for revisions�resigns#resign as a reviewer from revisions�
commandeerscommandeer revisionsscomment on the last revisionslocal revision to updates"[DREVSPEC...| -r REV...] [OPTIONS]c	��[R"U5n/SQnUVs/sH,oSRURSS55(dM*UPM. nn[	U5S:�a1[
R"[S5SRU5-5e/nUHnURUSS.5 M URS	5n	U	(a�U(d[
R"[S
55eU(a[
R"[S55e[U[R"X/55n
/n/nU
R5H1up�U
cURX5 MURS
U
-5 M3 U(a6[
R"[S5[R "X5-5e[#XRS5U5n[%U5HcunnUS-[	U5:Xa-URS5(aURSUSS.5 U(dMNUSUS.n['USU5 Me gs snf)zjupdate Differential Revision in batch

DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
)
rErBrGrKrIrFrCrHrDrJr��_r$s%s cannot be used togethers, Tr9rps--rev requires a repositorys&cannot specify both DREVSPEC and --revNr$s-selected revisions without a Differential: %sr0r:r)rAr@rB)rr�r�r�rrr�rrNr��
InputErrorrWrr�r�rrr#r�r)rSr
r"rXrNr!r�rI�frU�drevmap�unknownr�rrJrPrIr�s                  rC�
phabupdaterR�s���2����%�D��L�%�H��1������4��1F�(G�Q��E�H�
�5�z�A�~��k�k�!�9�:�U�Z�Z��=N�N�O�O��G�
������d�3�4���8�8�F��D����"�"�1�%C�#D�E�E���"�"�1�%N�#O�P�P��T�:�#6�#6�t�V�#D�E�������M�M�O�D�A��y����t�w�'����V�a�Z�(�	$�
��"�"��B�C��'�'��6�7��
�

�b�(�(�8�,�e�4�E��U�#���4��q�5�C��J��4�8�8�J�#7�#7��N�N�Z�4�
�;K�L�M��7�%)�'�]�!(��F�
��9�6�B�$��?
Is�)I�Is
phabreview�ctx)�requiresc�Z�UR"US5n[RUR55nU(a:[R
"UR
S5SUR
S5-S.5$UR5RUR55nUH�n[RU5(dMUR5RRSS5nURS5(dUS-
nXe-
n[R
"UUS.5s $ g	)
z]:phabreview: Object describing the review for this changeset.
Has attributes `url` and `id`.
rSrsD%sr)r1r*r&r1r�N)�resourcer7r8r9r�
hybriddictr�r
r4rCr5rrSr�rh)r	r�rDrFrr�rs       rC�template_reviewrX
	s���
�
�
�7�F�
+�C�#�*�*�3�?�?�+<�=�A���&�&�����������
�-�
�
�	
��x�x�z�"�"�3�8�8�:�.���A�)�/�/��2�2��h�h�j�m�m�*�*�>�6�B���|�|�D�)�)��4�K�C����#�.�.� #� �����r8s
phabstatus>�uirS�repoc�n�UR"US5nUR"US5nUR"US5nUR5n[X5/5Un[	USSU/05nUH6n[US5U:XdM[R"USUS	S
.5s $ g![a gf=f)z8:phabstatus: String. Status of Phabricator differential.rSrZrYNr�r�r*rr�)r1sstatus)rVrVrW�KeyErrorrr,rrW)	r	r�rDr
rSrVrlrJrIs	         rC�template_statusr]*	s����
�
�7�F�
+�C����G�W�-�D�	�	�	�'�5�	)�B�

�'�'�)�C���D�%�(��-��
��1�F�V�H�3E�F�E����t�E�{��v�%��*�*� ��L�#�M�2���
��������s�B'�'
B4�3B4swork)�	csettopicc	��^^�URS5n[X5n/[50pvnUR5HUup�U	b<UR	U	5 URU	[55R	U5 MDUR
U5 MW [TSS[U505n
0mU
H nU[US5HnUTU'M
 M" UU4SjnU[R"U5-n[R"X5n
TRSSS	5 X�l[ R""X5n[$R&"TUU
U[R(S
U0S9 g)z Phabricator differiential statuszsort(_underway(), topo)Nr�r�r*c�>�TUR5nTRSU-S[U5-5nTRSUSU4-5 g)Ns%(statusName)ssphabricator.status.%ss
%s %s
r)rVrbr�r�)rDrIr�
drevsbyrevrSs   ��rC�
phabstatus�&phabstatusshowview.<locals>.phabstatusU	sR����#�'�'�)�$�������$�$�~�d�';�;�
��	�����f��v� 6�6�7r8sexperimentalsgraphshortenTsnodelen)r)rUrWr6r�r��
setdefaultr�rr�r,rr�r�	dagwalkerr�_exthookr%�longestshortestr�displaygraph�
asciiedges)rSr
�	displayerrUrP�unknownrevsr��revsbydrevidrVrlrJrIrb�revdag�nodelenras`              @rC�phabstatusshowviewroB	sA����9�9�.�/�D���$�G�)+�S�U�B�,�K��}�}�������K�K����#�#�F�C�E�2�6�6�s�;����s�#�'�
��1�F�D��M�3J�K�E��J�����D��K� 0�1�C�"�J�s�O�2��8�	�H���[�)�)�D�
�
�
��
+�F��L�L��/�4�8�#���"�"�4�.�G����
��������7�#�
r8)NF)NNNNNNN)�r��
__future__rr�r�r�r:r�r�r�rrtr��typing�mercurial.noderr�mercurial.i18nr�mercurial.thirdpartyr�
TYPE_CHECKING�	mercurialrr	r
rrr
rrr�rrrrrrrrrrrrrrrrr�r �mercurial.utilsr!r"r#�r%�
testedwith�eh�cmdtabler��configtable�templatekeyword�finaluisetup�uisetup�
configitem�
colortabler��wrapfunctionr]r�r�r�r�rrr�compiler5�Mr7rSrWrcreryrr�r~r�r�r�r�r�r�r�rrrrrr"r7rUr]rirn�CATEGORY_IMPORT_EXPORTr�rPr+r�rr�r�r�r�r�r�r�rr�rrr#r/r5rArRrXr]�showviewror{r8rC�<module>r�s��3�j#�
���	�����	��
�%��%�
�����������6��
�#�
������
�;�;��
�*�*���n�n���$�$��
�/�/���
�
������
�
�
������
�
�
�������
�
�������
�
������
�
�
���
���
�
�
���
���
�
�
��
����
�
�
������
�
�
��
����
�
�
������$,�#-�#-� �%3�$1�"*�'0�)/�*0��
�	���	�
�	
�		��
�����J�'�!�(�!�HQ�h �0�<�<9�x���Q�y�\��E�/�F�/�,�* �Z�Z�(>�?�� �j�j�F������
|�~�.��������
"�t�
"��
"����%'�%'��%'�P���
�
��
�6
�<�6"�J'�22��)�)�
<���!�!�4P%�f�>*L�^�������u�p.�"E�&L�&��	
�v�r�1�1�2�A�f�I�>�	�h��a� 9�:�;�	�k�2�q�!5�6�7�	�j�"�a� =�>�?����
�B�C�		
�

�j�$��"H� I�J�	�g�u�a� H�I�J�
�����/�/�#�&h3�'�&h3�Z�}�}�����6��:�6�
2�
-�
,�
,�
%�/�'�

�	��*�� �,~/�BG�C�6>�B�J0�*#�L��	�8�U�A�2�3�4�5�����/�/���!��!�>��	�8�U�A�<�=�>�?�����/�/�	�4&�
�4&�n��	�i���"5� 6�7�	�i���"5� 6�7�	����*H�(I�J�	�j�%��#7�!8�9�	�j�%��#7�!8�9�	�h��q�!3�4�5�	�i���"5� 6�7�	�o�u�a�(E�&F�G�	�i���"H� I�J�	�m�U�A�&=�$>�?�	
�z�3��"A� B�C�	
�v�s�A�9�:�A�f�I�F�
��+�,��/�/��%�(9C�)�(9C�x���M�V�H��5��6��>���M�,D��E��F��.���}��0�'�1�'r8

Youez - 2016 - github.com/yon3zu
LinuXploit