Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/src/cmd/hg/mercurial/dispatch.pyc

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


�
�c@s�ddklZddkZddkZddkZddkZddkZddkZddkZddk	Z	ddk
Z
ddkZddkZddk
Z
ddkZddkZddkZddkZddkZddkZddkZd�Zd�Zd�Zd�Zd�Zdefd	��YZd
�Zd�Zd�Zd
�Z d�Z!e"�Z#d�Z$d�Z%dS(i�(t_NcCstittid��dS(srun the command in sys.argviN(tsystexittdispatchtargv(((s./mercurial/dispatch.pytrunscCszy4ti�}d|jo|iddd�nWn6tij
o'}tiitd�|�dSnXt	||�S(s!run the command specified in argss--tracebacktuit	tracebacktons
abort: %s
i�(
t_uiRt	setconfigtutiltAbortRtstderrtwriteRt	_runcatch(targstutinst((s./mercurial/dispatch.pyRs
	c
Cs0d�}x;d0D]3}tt|d�}|oti||�qqWy�y>d|joti�nzt||�SWd|i�XWn<d|jotiti	�d�n|i
��nXWnatij
o=}|i
td�|idd	i|id
�f�ntij
o'}|i
td�|id�n�tij
op}|itijotd�|i}ntd
�|i}|i
td�|ip|i|f�ndtij
o6}|i
td�|ip|i|if�n tij
o�}|idoF|i
td�|id|id
f�ti||id�q,|i
td�|id
�ti|d�n�tij
o }|i
td�|�nYtij
o�}|i
td�|id�t|id
t �p|i
d|id
f�q,|id
p|i
td��q,|i
dt!i"|id
��n�ti#j
o }|i
td�|�nzti$j
o|i
td��nRti%j
o7}|i
td�|id�ti|d�n
t!i&j
o }|i
td�|�n�t'j
o�}t(|�i)�d}|i
td�|�|di)�jo|i
td��q,|di)�jo|i
td��q,nJt*j
o@}t+|d �o|i
td�|�q,t+|d!�oBy|i,id
}Wn|i,}nX|i
td"�|�q,t+|d#�o<|idti-jo%|i.o|i
td$��q*q,t|d%d�oXt|d&d�o'|i
td�|i|if�q*|i
td�|i�q,�n�t/j
o]}t|d&d�o'|i
td�|i|if�q,|i
td�|i�n�t0j
oqy|i
td'��Wq,t*j
oD}|iti-jo%|i.o|i
td(��q	q�q,Xnt1j
o|i
td)��n�t2j
o}|i3Sn�t4ij
o'}|i
td�|id�n�|i
td*��|i
td+��|i
td,��|i
td-�t!i5��|i
td.�d/ig}t6i6�D]}	||	dq~���nXdS(1NcWs
ti�dS(N(terrortSignalInterrupt(R((s./mercurial/dispatch.pyt	catchtermstSIGBREAKtSIGHUPtSIGTERMs
--debuggeris&hg: command '%s' is ambiguous:
    %s
it ishg: %s
s%timed out waiting for lock held by %sslock held by %ssabort: %s: %s
sabort: could not lock %s: %s
s
hg %s: %s
t	shortlistsabort: %s!
s	abort: %ss %r
s empty string
s
%r
skilled!
shg: unknown command '%s'
s
abort: %s
i�s#abort: could not import module %s!
smpatch bdiffs((did you forget to compile extensions?)
tzlibs"(is your Python install correct?)
tcodetreasonsabort: error: %s
Rsbroken pipe
tstrerrortfilenames
interrupted!
s
broken pipe
sabort: out of memory
s1** unknown exception encountered, details follow
s;** report bug details to http://mercurial.selenic.com/bts/
s** or mercurial@selenic.com
s*** Mercurial Distributed SCM (version %s)
s** Extensions loaded: %s
s, (RsSIGHUPsSIGTERM(7tgetattrtsignaltNonetpdbt	set_tracet	_dispatchtflushtpost_mortemRtexc_infoRRtAmbiguousCommandtwarnRRtjointConfigErrortLockHeldterrnot	ETIMEDOUTtlockertdescRtLockUnavailableRt
ParseErrortcommandsthelp_t	RepoErrort
ResponseErrort
isinstancet
basestringRtellipsistRevlogErrorRtUnknownCommandRtImportErrortstrtsplittIOErrorthasattrRtEPIPEt	debugflagtOSErrortKeyboardInterrupttMemoryErrort
SystemExitRtsockettversiont
extensions(
RRRtnametnumRRtmt_[1]tx((s./mercurial/dispatch.pyRs�	


)"."+%
'
''
"6cCs\xUtiitii|d��p2|tii|�}}||jodSqqW|S(Ns.hg(tostpathtisdirR+tdirnameR"(tptoldp((s./mercurial/dispatch.pyt	_findrepo�s
%

cCst|d�o|iSngS(NR(RAR(tfn((s./mercurial/dispatch.pyt	aliasargs�stcmdaliascBseZd�Zd�ZRS(cs�|�_|�_g�_g�_d�_t�_y#ti�i|t�t�_	Wnt
ij
ot�_	nX�ip �fd�}|�_
dSnti�i�}|id��g}d}ykti�|t�d\�_
�_�_t�i
�|�_�tiid�jo
t�_nWnat
ij
o"��fd�}|�_
n2t
ij
o"��fd�}|�_
nXdS(Ntcs|itd��i�dS(Nsno definition for alias '%s'
i(R*RRK(RR(tself(s./mercurial/dispatch.pyRW�siiRcs$|itd��i�f�dS(Ns,alias '%s' resolves to unknown command '%s'
i(R*RRK(RR(tcmdR[(s./mercurial/dispatch.pyRW�scs$|itd��i�f�dS(Ns.alias '%s' resolves to ambiguous command '%s'
i(R*RRK(RR(R\R[(s./mercurial/dispatch.pyRW�s(RKt
definitionRtoptsthelptTruetnorepotcmdutiltfindcmdtshadowsRR<tFalseRWtshlexR?tpopRXR4R)(R[RKR]tcmdtableRWRR^R_((R\R[s./mercurial/dispatch.pyt__init__�s<						

	+
cOs;|io|itd�|i�n|i|||�S(Nsalias '%s' shadows command
(RdtdebugRRKRW(R[RRR^((s./mercurial/dispatch.pyt__call__�s
(t__name__t
__module__RiRk(((s./mercurial/dispatch.pyRY�s	-cCspxi|id�D]X\}}t|||�}||i|if||<|iotid|7_qqWdS(Ntaliass %s(tconfigitemsRYR^R_RaR4(RRhRnR]taliasdef((s./mercurial/dispatch.pyt
addaliases�s
cCs�h}h}yti|ti|�}Wn-tiij
o}tid|��nX|o�|d|d}}ti	|ti
|idd��\}}|d}t|d�|}|id|�}|ot
i|�|}nt|d�}	n
d}g}	x>tiD]3}
|	i|
d|
d||
d|
df�qWyti||	|t�}Wn-tiij
o}ti||��nXx0tiD]%}
|
d}||||<||=q�W||o|dpd|||fS(NiiRtstricttdefaultsi(t	fancyoptsR4t
globaloptstgetopttGetoptErrorRR3R"RbRcttabletconfigRXRfR?tlisttappendR`(RRtoptionst
cmdoptionsRR\taliasestiRstctotn((s./mercurial/dispatch.pyt_parse�s>

1

cCs�x�|D]�}ya|idd�\}}|idd�\}}|p|o
t�n|i|||�Wqttfj
o titd�|��qXqWdS(s0parse the --config options from the command linet=it.smalformed --config option: %sN(R?t
IndexErrorR
t
ValueErrorRRR(RRytcfgRKtvaluetsection((s./mercurial/dispatch.pyt_parseconfigs
c	Cs+y|id�}Wntj
ot|�}nXg}|D]$}t|�djo||q@q@~}g}d}x�||jo�|||joA|d|joPn||=|i|i|��|d8}q|||d |jo(|i|i|�d�|d8}q||d7}q|W|S(s�Return 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.
    s--iii(tindexR�tlenR{Rg(R~RtargcountRNtoptt	shortoptstvaluestpos((s./mercurial/dispatch.pyt_earlygetopts&8c	Cs�ti||d|tddi|��}|o|Snt||||�}ti||d|tddi|�d|�|S(Nspre-%sRRspost-%stresult(thookReR+t_runcommand(tluitrepoR\tfullargsRR|tdtret((s./mercurial/dispatch.pyt
runcommand8s+(cs't�tdg���tdg��}|oti|d�ntti��pd}|p
�}n|oIy/�i�}|itii	|dd��Wq�t
j
oq�Xntddd	g��}|oB|i|d�}�i�}|itii	|dd��nti
|�x�i�D]�\}}|tjoq<nt|d
d�}|o|�nt|dh�}	g}
|	D]!}|tijo|
|q�q�~
}|o*�itd�|d
i	|�f�ntii|	�ti|�q<Wt|ti�|idd�}
|
o
|
t_n�}t|��\}��}�|dotitd���n|dotitd���n|dotitd���n|do|dt_n|do|dt_n|do8d��������fd�}ti |�n|dp|dp|dom�i!ddt"t#|d����i!ddt"t#|d����i!ddt"t#|d���n|do�i!ddd�n|d o�i!dd!d"�n|d#oti$�||d$�Sn8|d$oti%��Sn|pti$�d%�Snd}|ti&i'�jo6ybt(i)�d&|�}|i*�|i+�ptitd'�|��n�i!d(d)|i,�Wn�t-i.j
o�|ti/i'�jo��oc|o[t0t��}|d*}|o7|i1|�t2|�jot3�d|g|�Sq�n|pt-i.td+���n�q�nX�i4d*|�n|o�id,�n����fd-�}t5||||�||�S(.Ns--configs--cwdi�RZs.hgthgrcs-Rs--repositorys--repotextsetupRhs&extension '%s' overrides commands: %s
RRtfallbackencodingRys'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encodingmodettimecSsPti�}|ddjo/|d|d|d|dti�f}n|S(Nigiiii(RPttimesR�tclock(tt((s./mercurial/dispatch.pyt	get_times�s/c	so��}�itd�|d�d|d�d|d�d|d�d|d�df�dS(Ns4Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)
iiiii(R*R(R�(tsR�R(s./mercurial/dispatch.pyt
print_time�s	tverboseRjtquietRRtnoninteractivetinteractivetoffR_RIRRQsrepository '%s' is not localtbundletmainreporootis5There is no Mercurial repository here (.hg not found)swarning: --repository ignored
csti������S((Rtchecksignature((R}RRtfunc(s./mercurial/dispatch.pyt<lambda>�s(6R�R�RPtchdirRVtgetcwdtcopyt
readconfigRQR+R@t
expandpathRJtloadallt_loadedR R"R4RxR*RtupdatetaddRqRyR�R�R�RRR�tatexittregisterR
R>tboolR5tversion_RaR?thgR�RtlocaltrootRR6toptionalrepotmaptcountR�R%tinsertR�(RRR�RQR�trpathRKtmoduleR�RhRNR\t	overridestfallbackR�R|R�R�trepostguessR�((RR�R�R�RR}s./mercurial/dispatch.pyR%Ds�
#	#


5
			!##'	

#cs���fd�}|do�|idddd�}|djo!|itd�|�d}n|idd	�}|o4tii|�}|i|�}t|d
�}n
ti	}yddk
l}	Wn(tj
ot
itd
���nX|	i�}
|
idt�z|�SWd|
i�|djo,ddk}|i|
�}|i|�n<|	i|
i��}
|
i�|
iddd|dd�|o|i�nXn|�SdS(Ncs@y��SWn.tij
oti�td���nXdS(Nsinvalid arguments(RtSignatureErrorR3R((R\tcmdfunc(s./mercurial/dispatch.pyt	checkargs�stprofilet	profilingtformattdefaultttexttkcachegrinds-unrecognized profiling format '%s' - Ignored
toutputtwbi�(tlsprofsYlsprof not available - install from http://codespeak.net/svn/user/arigo/hack/misc/lsprof/tsubcallsttopi
tfiletclimiti(stextR�(RyR*RRPRQt
expanduserR�topenRR
t	mercurialR�R=RRtProfilertenableR`tdisabletlsprofcalltreetKCacheGrindR�tStatstgetstatstsorttpprinttclose(RR|R\R�R�R�R�RQtostreamR�RTR�tcalltreetstats((R\R�s./mercurial/dispatch.pyR��sB

		


(&ti18nRRPRR�R!R#RHR.RfR�RR4R�RtRJR�RRbR�RR	RRRRVRXtobjectRYRqR�R�R�R�tsetR�R%R�(((s./mercurial/dispatch.pys<module>s$lT					4	
	(					

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.