Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/mercurial/dispatch.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�ܬQc@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZdefd��YZd�Zd�Zd�Zd�Zd	�Zd
efd��YZd�Z d
�Z!d�Z"d�Z#d�Z$d�Z%d�Z&e'�Z(d�Z)d�Z*d�Z+d�Z,dS(i�(t_NtrequestcBs eZdddddd�ZRS(cCs:||_||_||_||_||_||_dS(N(targstuitrepotfintfouttferr(tselfRRRRRR((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt__init__s					N(t__name__t
__module__tNoneR	(((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyRscCs.tjtttjd��p"dd@�dS(srun the command in sys.argviii�N(tsystexittdispatchRtargv(((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pytrunsc
Cs|jr|j}n!|jr-|jj}n	tj}y�|jsTtj�|_nd|jkr||jjddd�n|jr�|j|j_n|jr�|j|j_n|jr�|j|j_nWn�t	j
k
r$}|jtd�|�|j
r |jtd�|j
�ndStjk
r�}t|j�dkry|jtd	�|jd|jd
f�n|jtd�|jd
�dSXdjd
�|jD��}tj�}d}zt|�}|SWdtj�|}|jjdd||pd
|�XdS(s%run the command specified in req.argss--tracebackRt	tracebacktons
abort: %s
s(%s)
i�ishg: parse error at %s: %s
ishg: parse error: %s
t css-|]#}d|kr!t|�p$|VqdS(RN(trepr(t.0ta((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pys	<genexpr>AsNt
commandfinishs!%s exited %s after %0.2f seconds
(RRR
tstderrtuimodRt	setconfigRRtutiltAborttwriteRthintterrort
ParseErrortlentjointtimeRt	_runcatchtlog(treqRtinsttmsgt	starttimetrettduration((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyRsH								cCsLd�}|j}y@x9dED]1}tt|d�}|rtj||�qqWWntk
renXy�yOd|jkr�|jtd��tj	�nzt
|�SWd|j�XWnGd|jkr�j
�tjtj�d�n|j��nXWnB
tjk
rO}|jtd�|jd	d
j|jd�f�n�jk
r�}t|j�dkr�|jtd�|jd|jd	f�n|jtd
�|jd	�dStjk
r?}|jtjkrtd�|j}ntd�|j}|jtd�|jp1|j|f�n		tjk
r�}|jtd�|jpo|j|jf�n�tjk
r!}|jd	r�jtd�|jd	|jdf�tj ||jd	dt!dt"�qH|jtd�|jd�tj |d�n'tj#k
rb}|jtd��|jdj|j��n�tj$k
r�}|jtd�|�|j%rH|jtd�|j%�qHn�tj&k
r_}|jtd�|jd	�t'|jdt(�s|jd|jdf�qH|jds;|jtd��qH|jdt)j*|jd��n�tj+k
r�}|jtd�|�n�tj,k
r�|jtd ��n�tj-k
r,}|jtd!�|jd	�y!tj ||jd	d"t"�WqHtj-k
r(tj |d�qHXntj.k
rS}|jd#|�dSt)j/k
r�}|jtd$�|�|j%rH|jtd�|j%�qHn�t0k
r4}|jtd�|�t1|�j2�d}|d%j2�kr	|jtd&��qH|d'j2�krH|jtd(��qHnt3k
r�}t)j4|d)�ro|jtd$�|�qHt)j4|d*�r�y|j5jd}Wn t6t7fk
r�|j5}nX|jtd+�|�qHt)j4|d,�r|jd	tj8kr|j9r�|jtd-��q�qHt|d.d�r�t|d/d�rf|jtd�|j|jf�q�|jtd$�|j�qH�n�t:k
r�t|d/d�dk	r�|jtd0�|j|jf�qH|jtd$�|j�nUt;k
rgy|jtd1��WqHt3k
rc}|jtj8kr]|j9r`|jtd2��q`qd�qHXn�t<k
r�|jtd3��n�t=k
r�}|j>St?jk
r�}|jtd$�|jd�nut)j@�}|j2d4�d	}	tA|	�}
d|
df}xtBjB�D]\}}t|d5d�}
t|d6td7��}|
jC�sr	|d8|f}Pn|	|
j2�kr	|
d9kr	g|
j2�D]}tA|�^q�}g|D]}||
kr�|^q�}tD|p��}|d	dks
||dkr!
|||f}q!
q	q	W|d	dk	r�|\}}
}t'|
t1�s~
d:jg|
D]}t1|�^q`
�}
ntd;�||
||f}ntd<�td=�}|td>�tj@jEd?d�td@�|tdA�dBjgtBjB�D]}|d	^q�7}|jFdCdD|tjG��|j|��nXdS(FNcWs
tj�dS(N(R tSignalInterrupt(R((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt	catchtermMstSIGBREAKtSIGHUPtSIGTERMs
--debuggersAentering debugger - type c to continue starting hg or h for help
is&hg: command '%s' is ambiguous:
    %s
iRishg: parse error at %s: %s
shg: parse error: %s
i�s%timed out waiting for lock held by %sslock held by %ssabort: %s: %s
sabort: could not lock %s: %s
s
hg %s: %s
tfulltcommandshg: %s
t	shortlistsabort: remote error:
tsabort: %s!
s(%s)
s	abort: %ss %r
s empty string
s
%r
skilled!
shg: unknown command '%s'
t
unknowncmds%s
s
abort: %s
smpatch bdiffs((did you forget to compile extensions?)
tzlibs"(is your Python install correct?)
tcodetreasonsabort: error: %s
Rsbroken pipe
tstrerrortfilenamesabort: %s: '%s'
s
interrupted!
s
broken pipe
sabort: out of memory
t+t
testedwithtbuglinksthe extension author.tunknowntinternalt.s�** Unknown exception encountered with possibly-broken third-party extension %s
** which supports versions %s of Mercurial.
** Please disable %s and try your action again.
** If that fixes the bug please report it to %s
s<** unknown exception encountered, please report by visiting
s0** http://mercurial.selenic.com/wiki/BugTracker
s
** Python %s
s
s*** Mercurial Distributed SCM (version %s)
s** Extensions loaded: %s
s, tcommandexceptions%s
%s
(R/sSIGHUPsSIGTERM(HRtgetattrtsignalRt
ValueErrorRtwarnRtpdbt	set_tracet	_dispatchtflushRt	print_exctpost_mortemR
texc_infoR tAmbiguousCommandR#R!R"tLockHeldterrnot	ETIMEDOUTtlockertdescR;tLockUnavailableR:tCommandErrortcommandsthelp_tFalsetTruetOutOfBandErrort	RepoErrorRt
ResponseErrort
isinstancet
basestringRtellipsistRevlogErrorR-tUnknownCommandtInterventionRequiredRtImportErrortstrtsplittIOErrortsafehasattrR9tAttributeErrort
IndexErrortEPIPEt	debugflagtOSErrortKeyboardInterrupttMemoryErrort
SystemExitR8tsockettversionttuplevert
extensionststriptmaxtreplaceR&t
format_exc(R'R.RtnametnumR(R9tmtmyvertcomparetcttworsttmodR=treporttvttestedtttlowertnearesttctwarningtx((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR%Ls0		




(, 
+&	 
$!	 
(	&&
	

!%% +		
*	/
cCsLy0tg|jd�D]}t|�^q�SWntk
rGt�SXdS(NRA(ttupleRetintRE(R�ti((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyRrs0
cs�t|dg�}|r�djttj|��}g���fd�}tjd||�}gt��D]\}}|�krm|^qm�tj	|�}n|�S(NRRcsYt|jd��d}�j|�|t��kr@�|Stjtd���dS(Nis#too few arguments for command alias(R�tgrouptappendR"RRR(RzRy(t	givenargstnums(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pytreplacers

s
\$(\d+|\$)(
RCR#tmapRt
shellquotetretsubt	enumeratetshlexRe(tfnR�RtcmdR�R�R�((R�R�s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt	aliasargsstcmdaliascBseZd�Zd�ZRS(cs1|�_�_d�_|�_g�_g�_d�_t�_t	�_
t	�_y^tj
�j|�\}}x3|j�D]%\}}||kr�|�_Pq�q�Wt�_Wntjk
r�t	�_nX�js�fd�}|�_t�_dS�jjd�r;t�_�fd�}|�_dStj�j�}	|	jd��_�ttj|	�}	xHdD]@�t�g|	�r|��fd�}|�_t�_dSq|Wy�j
�|t	�d}
t|
�d
kr	|
\�_�_�_n|
\�_�_t�j|	��_�tjjd�krTt	�_n�tj
jd�krxt�_
n�jjd��r��jdt���_n�jj�_Wnotjk
r���fd�}|�_t�_n8tj k
r,��fd�}|�_t�_nXdS(NR5cs|jtd��j�dS(Nsno definition for alias '%s'
i(RFRRx(RR(R(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�;st!cs�idj�jf��d6}���fd�}tjd|�jd�}td�t��D��}�j|d<dj��|d<tjd	||d
t	�}tj
|d|d�j�S(
NRtHG_ARGScs~|j�ddkr |j�St|j�d�t��krL|j�S�jdt|j�d��jf�dSdS(Nit$sKNo argument found for substitution of %i variable in alias '%s' definition.R5(tgroupsR�R�R"tdebugRx(Rz(RRR(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt	_checkvarFs
"
	!s
\$(\d+|\$)icss+|]!\}}t|d�|fVqdS(iN(Rd(RR�targ((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pys	<genexpr>Qst0t@s\$t
escape_prefixtenvirontout(R#RxR�R�t
definitiontdictR�RtinterpolateRYtsystemR(RRtenvR�R�Rv(R(RRs6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�Ds 

is--cwds-Rs--repositorys--repos--configcs$|jtd��j�f�dS(NsMerror in definition for alias '%s': %s may only be given on the command line
i(RFRRx(RR(t
invalidargR(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�_siiRshg icsU|jtd��j�f�ytj|�dt�Wntjk
rPnXdS(Ns,alias '%s' resolves to unknown command '%s'
R6i(RFRRxRVRWRYR Ra(RR(R�R(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�{scs$|jtd��j�f�dS(Ns.alias '%s' resolves to ambiguous command '%s'
i(RFRRx(RR(R�R(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR��s(s--cwds-Rs--repositorys--repos--config(!RxR�tcmdnameR�RtoptsthelpRYtnorepoRXtoptionalrepotbadaliastcmdutiltfindcmdt	iteritemstshadowsR RaR�t
startswithtshellR�RetpopR�Rt
expandpatht_earlygetoptR"R�RVt__doc__RN(RRxR�tcmdtabletaliasestentrytaliasteR�Rt
tableentry((R�R�Rs6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR	%st									

					
					cOs�|jr)|jd|j|jf�ntj|d�rN|j|||�Sy tj|j�|||�WnMtj	k
r�dj
|jg|j�}|jd|j|f��nXdS(Ns alias '%s' shadows command '%s'
R�Rsalias '%s' expands to '%s'
(R�R�RxR�RRgR�tchecksignatureR tSignatureErrorR#R(RRRR�((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt__call__�s		 (R
RR	R�(((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�$s	icCs�x�|jd�D]�\}}t|||�}y-||jd}|j|jkrZwnWnttfk
rtnX||j|jf||j<|j	r�t
j	d|7_	n|jrt
jd|7_qqWdS(NR�is %s(tconfigitemsR�R�R�tKeyErrorRhR�R�RxR�RVR�(RR�R�R�taliasdeftolddef((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt
addaliases�s
		cCs�i}i}ytj|tj|�}Wn+tjjk
rU}tjd|��nX|r|d|d}}tj	|tj
|jdd��\}}|d}t|d|�}|j
d|�}|r�tjtj|��|}nt|d�}	nd}g}	x>tjD]3}
|	j|
d|
d||
d|
df�qWytj||	|t�}Wn+tjjk
r�}tj||��nXx0tjD]%}
|
d}||||<||=q�W||r�dp�|||fS(NiiRtstricttdefaultsi(t	fancyoptsRVt
globaloptstgetopttGetoptErrorR RURR�R�ttablet
configboolR�tconfigR�RR�R�RetlistR�RY(RRtoptionst
cmdoptionsR(R�R�R�R�R�totn((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt_parse�s:
"1
cCs�g}x�|D]�}yt|jdd�\}}|jdd�\}}|sT|r]t�n|j|||�|j|||f�Wq
ttfk
r�tjtd�|��q
Xq
W|S(s0parse the --config options from the command linet=iRAs?malformed --config option: %r (use --config section.name=value)(ReRiRR�RERRR(RR�tconfigstcfgRxtvaluetsection((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt_parseconfig�s
	c
Cspy|jd�}Wntk
r2t|�}nXg|D]}t|�dkr:|^q:}g}d}x�|krk||}}|jd�}	|	dkr�||	 }n||kr'||=|	dkr�j||	d�|d8}qh|d|krPn|j|j|��|d8}qm|d |kr^|j|j|�d�|d8}qm|d7}qmW|S(sVReturn list of values for an option (or aliases).

    The values are listed in the order they appear in args.
    The options and values are removed from args.

    >>> args = ['x', '--cwd', 'foo', 'y']
    >>> _earlygetopt(['--cwd'], args), args
    (['foo'], ['x', 'y'])

    >>> args = ['x', '--cwd=bar', 'y']
    >>> _earlygetopt(['--cwd'], args), args
    (['bar'], ['x', 'y'])

    >>> args = ['x', '-R', 'foo', 'y']
    >>> _earlygetopt(['-R'], args), args
    (['foo'], ['x', 'y'])

    >>> args = ['x', '-Rbar', 'y']
    >>> _earlygetopt(['-R'], args), args
    (['bar'], ['x', 'y'])
    s--iiR�i�i(tindexRER"tfindR�R�(
R�Rtargcounttoptt	shortoptstvaluestpostfullargR�tequals((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR��s4
+



c	

Cs�tj||d|tddj|�d|d|�t||||�}	tj||d|tddj|�d|	d|d|�|	S(Nspre-%sRRtpatsR�spost-%stresult(thookRYR#t_runcommandRX(
tluiRR�tfullargsRR�tdtcmdpatsR�R+((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt
runcommand!s(
(cCs�ytj�}Wn/tk
rA}tjtd�|j��nXtj|�pTd}|sf|}n.|j	�}|j
tjj|dd�|�|r�dr�j
|d�}|j	�}|j
tjj|dd�|�n||fS(spReturn (path, local ui object) for the given target path.

    Takes paths in [cwd]/.hg/hgrc into account."
    s+error getting current working directory: %sR5s.hgthgrci�(tostgetcwdRlRRRR:R�tfindrepotcopyt
readconfigtpathR#R�(RtrpathtwdR�R�R�((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt	_getlocal+s	"%csLi�ytj�tj���Wntjjk
r<dSX�sGdStj�tj���fd�}tjj�}t	�|��d�y+t
j�|�jdd��\}}Wn%t
jt
jfk
r�|�dSX|d�|d��rAtj�d�rA���fd��������fd�S|�dS(Ncs�t_�t_dS(N(RVR�R�((R�R�(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pytrestorecommandsPs	iRR�R�cs���d�S(Ni(((RR�R(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt<lambda>csc
s&t�d��d ���gi�S(Ni(R�R((RR�R�R�R�R(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�ds(R�RVR�R�R�R�R�R�R�R�R�R�R�R RNRaRRg(R�RRR�R�R�R�((	RR�R�R�R�R�R�R�Rs6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt_checkshellaliasCs2		



cs	|j�|j�t�tdg���}tdg��}|rYtj|d�ntdddg��}t�|�\}}t|���}|r�|�Stj	|�gtj�D]}|dt
kr�|^q�}|j�_x�|D]�\}	}
t|
di�}g|D]}|t
jkr|^q}
|
ri�jtd	�|	d
j|
�f�nt
jj|�t
j|	�q�|t
j�|jdd�}|r�|t_n�}t|��\}��}�|d
rtjtd���n|dr&tjtd���n|drHtjtd���n|drb|dt_n|dr||dt_n|dr�d��������fd�}tj|�nt�|g�}|jr|j|jj�x$|D]}|jjj |�q�|ds0|ds0|dr~xKd2D]@}t!t"||��}x!|D]}|j d||�qZWq7Wn|dr�x$|D]}|j ddd�q�Wn|dr�$|D]}|j ddd�q�Wn�j#d t$�rx$|D]}|j d!d"d#�q�|d$r0t
j%��S|d%rJt
j&�|�S|s`t
j&�d&�Sd}�}|t
j(j)�krY|r�|r�|j}n|r��j*|j_*�j+|j_+�j,|j_,nbyst-j.�d'|�}|j/�stjtd(�|��n|d)r+|j0�}n|jj d*d+|j1�Wn�t2j3k
r^�n�t2j4k
r3|t
j5j)�kr4|t
j6j)�kr�r|rt7t8j9��}|d}|r|j:|�t;|�krd|g||_t<|�Sn|s*t2j4td,�tj=���n�q4nX|rF|j�n�j>d|�n|ru�jtd-��nd
jd.�|D��}�j?d/d0|�����fd1�}z&t@||||�|||��SWd|r||jkr|jA�nXdS(3Ns--configs--cwdi�s-Rs--repositorys--repoiR�s&extension '%s' overrides commands: %s
RRtfallbackencodingR�s'option --config may not be abbreviated!tcwds$option --cwd may not be abbreviated!t
repositoryssoption -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!tencodingtencodingmodeR$cSsNtj�}|ddkrJ|d|d|d|dtj�f}n|S(Nigiiii(R�ttimesR$tclock(R�((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt	get_times�s.c	so��}�jtd�|d�d|d�d|d�d|d�d|d�df�dS(Ns4time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)
iiiii(RFR(R�(RtsR(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt
print_time�s	tverboseR�tquietRRtnoninteractivetinteractivetofftinsecuretwebtcacertsR5RqR�R4R�srepository '%s' is not localthiddentbundletmainreporoots+no repository found in '%s' (.hg not found)swarning: --repository ignored
css-|]#}d|kr!t|�p$|VqdS(RN(R(RR((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pys	<genexpr>sR3s%s
cstj������S(N(RR�((RR�tfuncR(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�s(sverbosesdebugsquiet(BRRR�R�R�tchdirR�R�Rstloadallt_loadedt	__class__RCRVR�RFRR#tupdatetaddR�R�RR�R�RRRtatexittregistertsetRRRdtbooltgetRXtversion_RWRR�ReRRRthgRtlocalt
unfilteredtrootR tRequirementErrorR[R�t	inferrepoR�R�R�tcountR"RIR�tinsertR&R�tclose(R'tcfgsRR�R�R�tshellaliasfntexttextsRxtmoduleR�R�t	overridestfallbackR�R�RtuisR�R�tvaltui_RR�trepostguessR)R�((RR�RRRRs6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyRIjs�		
/(


	


			













!

c
Csw|jdddd�}|jdddd�}|jdddd�}|jdd	dd
�}|dkr�|jtd�|�d}nyd
dlm}Wn&tk
r�tjtd���nX|j	�}|j
dt�z|�SWd|j�|dkr4d
dl
}	|	j|�}
|
j|�n>|j|j��}|j|�|jd|d|d|�XdS(Nt	profilingtformattdefaultttexttsortt
inlinetimetlimititnesteditkcachegrinds-unrecognized profiling format '%s' - Ignored
i�(tlsprofsYlsprof not available - install from http://codespeak.net/svn/user/arigo/hack/misc/lsprof/tsubcallstfiletclimit(stextR>(R�t	configintRFRt	mercurialR?RcRRtProfilertenableRYtdisabletlsprofcalltreetKCacheGrindtoutputtStatstgetstatsR:tpprint(RRtfpR7tfieldR<RBR?tpRHtcalltreetstats((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt	lsprofiles2	
	

cCs�yddl}Wn&tk
r8tjtd���nX|jdddd�}|dkrm|j|�n|jtd�|�|j�z|�SWd|j	�|j
|�XdS(	Ni�s>statprof not available - install using "easy_install statprof"R6tfreqR8i�is+invalid sampling frequency '%s' - ignoring
(tstatprofRcRRRRCtresetRFtstarttstoptdisplay(RRRNRURT((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pytstatprofile1s
	

c	s��fd�}|dr
tjd�}|dkrR|jdddd�}n|dkr~|jtd	�|�d}n|jdd
�}|r�|j|�}t|d�}n	tj	}z0|dkr�t
|||�St|||�SWd|r|j�nXn|�SdS(
Ncs>y��SWn,tjk
r9tj�td���nXdS(Nsinvalid arguments(R R�RUR((R�tcmdfunc(s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt	checkargsFstprofiletHGPROFR6ttypeR8tlststats%unrecognized profiler '%s' - ignored
RJtwb(R`sstat(
R�tgetenvRR�RFRR�topenR
RRSRZR)(	RR�R�R[R\tprofilerRJR�RN((R�R[s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyR�Es(
		(-ti18nRR�R
RRDRGRpRPR�R$RR�RRVR!R�RsR�R R�RRRtobjectRRRR%RrR�R�R�R�R�R�R�R�R�RRRIRSRZR�(((s6/sys/lib/python2.7/site-packages/mercurial/dispatch.pyt<module>s.�T		.	�	y		(		5	
		&		�"	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.