Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/mercurial/dirstate.pyc

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


�
�c@s�ddklZddklZddkZddkZddkZddkZddkZddk	Z	ddk
Z
ddkZddkZddk
Z
dZdZeiZd�Zd�Zd	�Zd
efd��YZdS(
i�(tnullid(t_Nt?is>cllllccsF|id�}x0|djo"|| V|idd|�}qWdS(Nt/i�i(trfind(tpathtpos((s%/sys/lib/python/mercurial/dirstate.pyt	_finddirss	cCsJxCt|�D]5}||jo||cd7<dSnd||<q
WdS(Ni(R(tdirsRtbase((s%/sys/lib/python/mercurial/dirstate.pyt_incdirss

cCsKxDt|�D]6}||djo||cd8<dSn||=q
WdS(Ni(R(RRR	((s%/sys/lib/python/mercurial/dirstate.pyt_decdirss
tdirstatecBs�eZd�Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed	��Zed
��Z
ed��Zd�Zd
�Zd�Zd,d�Zd�Zd�Zd�Zd�Zd�Zed�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!e"d�Z#d�Z$d�Z%d �Z&d!�Z'd"�Z(d#�Z)d$�Z*d%�Z+d&�Z,d'�Z-d(�Z.d)�Z/d*�Z0d+�Z1RS(-cCsI||_||_tii|d�|_t|_t|_||_	dS(Nt(
t_openert_roottosRtjoint_rootdirtFalset_dirtyt_dirtyplt_ui(tselftopenertuitroot((s%/sys/lib/python/mercurial/dirstate.pyt__init__(s				cCs|i�|iS(N(t_readt_map(R((s%/sys/lib/python/mercurial/dirstate.pyR0s
cCs|i�|iS(N(Rt_copymap(R((s%/sys/lib/python/mercurial/dirstate.pyR5s
cCs4h}x'|iD]}||tii|�<qW|S(N(RRRtnormcase(Rtftname((s%/sys/lib/python/mercurial/dirstate.pyt_foldmap:s

cCsBy$|id�i�i�pdSWntj
odSnXdS(Ntbranchtdefault(RtreadtstriptIOError(R((s%/sys/lib/python/mercurial/dirstate.pyt_branchAs$cCs�y�|id�id�}t|�}|djo|d |dd!fSn4|djo&|djotitd���nWn/tj
o#}|itijo�q�nXt	t	gS(NRi(iis(working directory state appears damaged!(
RR%tlentutiltAbortRR'terrnotENOENTR(Rtsttlterr((s%/sys/lib/python/mercurial/dirstate.pyt_plHs
cCsLh}x?|ii�D].\}}|ddjot||�qqW|S(Nitr(Rt	iteritemsR
(RRR ts((s%/sys/lib/python/mercurial/dirstate.pyt_dirsUscCs�|id�g}xZ|iid�D]F\}}|djp|id�o|itii|��q%q%Wti|i	||ii
�S(Ns	.hgignoreRtignoresignore.(t_joinRtconfigitemst
startswithtappendRRt
expanduserR6Rtwarn(RtfilesR!R((s%/sys/lib/python/mercurial/dirstate.pyt_ignore]s!cCs#|iidd�o
tidjS(NRtslashR(Rt
configboolRtsep(R((s%/sys/lib/python/mercurial/dirstate.pyt_slashescCsti|i�S(N(R*t	checklinkR(R((s%/sys/lib/python/mercurial/dirstate.pyt
_checklinkiscCsti|i�S(N(R*t	checkexecR(R((s%/sys/lib/python/mercurial/dirstate.pyt
_checkexecmscCsti|id��S(Ns.hg(R*t	checkcaseR7(R((s%/sys/lib/python/mercurial/dirstate.pyt
_checkcaseqscCs|i|S(N(R(RR ((s%/sys/lib/python/mercurial/dirstate.pyR7uscsm�io;�io�fd�}|Sn��fd�}|Sn�io��fd�}|Sn�S(NcsF�i|�}tii|�odSnti|�odSndS(NR/txR
(R7RRtislinkR*tis_exec(RItp(R(s%/sys/lib/python/mercurial/dirstate.pyR }scsCtii�i|��odSnd�|�jodSndS(NR/RIR
(RRRJR7(RI(Rtfallback(s%/sys/lib/python/mercurial/dirstate.pyR �s
cs@d�|�jodSnti�i|��odSndS(NR/RIR
(R*RKR7(RI(RMR(s%/sys/lib/python/mercurial/dirstate.pyR �s
(RDRF(RRMR ((RRMs%/sys/lib/python/mercurial/dirstate.pytflagfunczs


cCsxti�}||ijodSn|i}ti|�p|ti7}n|i|�o|t|�Sn|SdS(NR
(RtgetcwdRR*tendswithsepRAR9R)(Rtcwdtrootsep((s%/sys/lib/python/mercurial/dirstate.pyRO�s	cCsT|djo|i�}nti|i||�}|ioti|�Sn|S(N(tNoneROR*tpathtoRRBtnormpath(RR RQR((s%/sys/lib/python/mercurial/dirstate.pyRT�s

cCs|ii|d�dS(s� current states:
        n  normal
        m  needs merging
        r  marked for removal
        a  marked for addition
        ?  not trackedRi(R(Rtget(Rtkey((s%/sys/lib/python/mercurial/dirstate.pyt__getitem__�scCs
||ijS(N(R(RRW((s%/sys/lib/python/mercurial/dirstate.pyt__contains__�sccs#xt|i�D]}|VqWdS(N(tsortedR(RRI((s%/sys/lib/python/mercurial/dirstate.pyt__iter__�scCs|iS(N(R1(R((s%/sys/lib/python/mercurial/dirstate.pytparents�scCs|iS(N(R((R((s%/sys/lib/python/mercurial/dirstate.pyR#�scCs#t|_|_||f|_dS(N(tTrueRRR1(Rtp1tp2((s%/sys/lib/python/mercurial/dirstate.pyt
setparents�scCs*||_|idd�i|d�dS(NR#tws
(R(Rtwrite(RR#((s%/sys/lib/python/mercurial/dirstate.pyt	setbranch�s	cCs�h|_h|_y|id�i�}Wn3tj
o'}|itijo�ndSnX|pdSnti|i|i|�}|i	p
||_
ndS(NR(RRRR%R'R,R-tparserstparse_dirstateRR1(RR.R0RL((s%/sys/lib/python/mercurial/dirstate.pyR�s			
cCsEx5di�D]'}||ijot||�q
q
Wt|_dS(Ns0_map _copymap _foldmap _branch _pl _dirs _ignore(tsplitt__dict__tdelattrRR(Rta((s%/sys/lib/python/mercurial/dirstate.pyt
invalidate�s

cCs^||jodSnt|_|dj	o||i|<n||ijo|i|=ndS(sFMark dest as a copy of source. Unmark dest if source is None.
        N(R]RRSR(Rtsourcetdest((s%/sys/lib/python/mercurial/dirstate.pytcopy�s
	
cCs|ii|d�S(N(RRVRS(Rtfile((s%/sys/lib/python/mercurial/dirstate.pytcopied�scCs|iS(N(R(R((s%/sys/lib/python/mercurial/dirstate.pytcopies�scCs9||djo$d|ijot|i|�ndS(Ns?rR5(RgRR5(RR ((s%/sys/lib/python/mercurial/dirstate.pyt	_droppath�s!cCs+||}|p
|djo�d|jp
d|jotitd�|��n||ijotitd�|��nxqt|�D]_}||ijoPn||ijo4||djo#titd�||f��q�q�Wn|djo$d|ijot|i|�ndS(	NR2s
s
s)'\n' and '\r' disallowed in filenames: %rs directory %r already in dirstates#file %r in dirstate clashes with %rs?rR5(R*R+RR5RRRgR
(RR tchecktoldstatetd((s%/sys/lib/python/mercurial/dirstate.pyt_addpath�s 

!%cCsxt|_|i|�ti|i|��}d|i|it|i	�f|i
|<||ijo|i|=ndS(smark a file normal and cleantnN(R]RRuRtlstatR7tst_modetst_sizetinttst_mtimeRR(RR R4((s%/sys/lib/python/mercurial/dirstate.pytnormals	
(cCsP|idtjo�|ijo�|i|}|ddjo�|dd
joy|ii|�}|ddjo|i|�n#|ddjo|i|�n|o|i||�ndSn|ddjp"|dd	jo|ddjodSqnt|_	|i
|�d|i|<||ijo|i|=ndS(s&mark a file normal, but possibly dirtyiiR2ii�i�NtmRv(i�i�(Rvii�i�(R1RRRRVtmergetnormaldirtyRmR]RRu(RR tentryRk((s%/sys/lib/python/mercurial/dirstate.pytnormallookups$$
"3	

cCsEt|_|i|�d|i|<||ijo|i|=ndS(smark a file normal, but dirtyRvii�i�N(Rvii�i�(R]RRuRR(RR ((s%/sys/lib/python/mercurial/dirstate.pyR%s
	

cCsHt|_|i|t�d|i|<||ijo|i|=ndS(smark a file addedRiii�N(Riii�i�(R]RRuRR(RR ((s%/sys/lib/python/mercurial/dirstate.pytadd-s
	
cCs�t|_|i|�d}|idtjoh||ijoX|i|}|ddjo
d}q�|ddjo|ddjo
d}q�ndd|df|i|<|djo||ijo|i|=nd	S(
smark a file removediiR}i�Rvii�R2N(R]RRqR1RRR(RR tsizeR�((s%/sys/lib/python/mercurial/dirstate.pytremove5s	
$

"cCsxt|_ti|i|��}|i|�d|i|it|i	�f|i
|<||ijo|i|=ndS(smark a file mergedR}N(R]RRRwR7RuRxRyRzR{RR(RR R4((s%/sys/lib/python/mercurial/dirstate.pyR~Ds	
(cCsXt|_y|i|�|i|=Wn-tj
o!|iitd�|�nXdS(s
forget a filesnot in dirstate: %s
N(R]RRqRtKeyErrorRR<R(RR ((s%/sys/lib/python/mercurial/dirstate.pytforgetMs	
cCs�tii|�}|ii|d�}|djo_|p&tiitii|i|��o
|}q�|ii	|t
i||i��}n|S(N(RRRR"RVRStexistsRRt
setdefaultR*tfspath(RRt	knownpatht	norm_patht	fold_path((s%/sys/lib/python/mercurial/dirstate.pyt
_normalizeVs
-
cCsOh|_d|ijot|d�nh|_ttg|_t|_dS(NR5(RRgRhRRR1R]R(R((s%/sys/lib/python/mercurial/dirstate.pytclearas		cCsk|i�xB|D]:}d|i|�jod|i|<qd|i|<qW|tf|_t|_dS(	NRIRvi�i�ii�(Rvi�i�i(Rvi�i�i(R�tflagsRRR1R]R(RtparentR=R ((s%/sys/lib/python/mercurial/dirstate.pytrebuildis
c
Cs�|ipdSn|idddt�}y"t|iiddd��}Wntj
o
d}nXti}|djot	i
|�i|}nti
�}|i}ti}|i}|di|i��x�|ii�D]�\}}	||jod|||f}n|	d	|jo+|	dd
jo|	ddddf}	n|t|	d|	d|	d|	d	t|��}	||	�||�q�|i|i��|i�t|_|_dS(
NRRat
atomictemptgranularityiiR
s%s%siRvi�i(RRR]RzRtconfigt
ValueErrortsystmaxintR*tfstatR{t	cStringIOtStringIORtstructtpackRbRR1RR3t_formatR)tgetvaluetrenameRR(
RR.tgrantlimittcstcopymapR�RbR te((s%/sys/lib/python/mercurial/dirstate.pyRbss6
"	
			
"1

cCs`|djotSn|i|�otSnx,t|�D]}|i|�otSq:q:WtS(Nt.(RR>R]R(RR RL((s%/sys/lib/python/mercurial/dirstate.pyt
_dirignore�s

c)
s�fd�}d�}�i}�i}|oti}ti}n|pti}ti}n|i}|i}	�i}
ti}t	i
}ti}
t
i}t
i}t
i}t
i}�i}g}|i}�io
�i}n
d�}t}}||ijot}ti}n&|i�o|i�o
t}nt|i��}|p
d|jo
dg}nhd
d<}x�t|�D]�}|||�t�}||joq�ny�|
||��}||i�}||joMt}||
jod
||<n|i|�||�p||�q�nW||jp
||jo|||<n/|	|||��||
jod
||<nWq�t j
ow}||
jod
||<q"|d}xK|
D].} | i!|�o|i|�t}Pq�q�W|	||i"�q�Xq�Wx�o�|i#�}!d
}"|!djo
d}!nd}"y"|||!�dtd	|"�}#WnBt j
o6}|i$t$i%jo||!|i"�q)n�nXxI|#D]A\}$}}||!o|!d|$p|$t�}||jo||joT||�p|i|�||�n||
jo||�od
||<q
q||jp
||joY||
jo||�o|||<q�q
||�o||�o|||<q
q||
jo||�od
||<qq�q�Wq)W|o�|o�tg}%|
D]+}$|$|jo||$�o|%|$q5q5~%�}&x�t&|&ti'g}'|&D]}(|'||(�q�~'��D]I\}}|d
j	o&||i�||fjo
d
}n|||<q�Wn|d=|S(s
        walk recursively through the directory tree, finding all files
        matched by the match function

        results are yielded in a tuple (filename, stat), where stat
        and st is the stat result if the file was found in the directory.
        cs'�iid�i|�|f�tS(Ns%s: %s
(RR<RTR(R tmsg(R(s%/sys/lib/python/mercurial/dirstate.pytfwarn�s#cSs�td�}ti|�otd�}n�ti|�otd�}nati|�otd�}nAti|�otd�}n!ti|�otd�}ntd�|S(Ntunknownscharacter devicesblock devicetfifotsockett	directorys"unsupported file type (type is %s)(RtstattS_ISCHRtS_ISBLKtS_ISFIFOtS_ISSOCKtS_ISDIR(tmodetkind((s%/sys/lib/python/mercurial/dirstate.pytbadtype�s     cSs|S(((RIty((s%/sys/lib/python/mercurial/dirstate.pyt<lambda>�sR�R
s.hgRR�tskipN((R>R�R*tnevertalwaystmatchfntbadRRUtosutiltlistdirRRwR�tS_IFMTtS_IFDIRtS_IFREGtS_IFLNKR7R:RHR�RtexactR]R=tanypatstsetRSRZRxtdirtOSErrorR9tstrerrortpopR,tEACCEStzipt	statfiles()RtmatchR�tignoredR�R�R6t	dirignoreR�tbadfntdmapRUR�RwtgetkindtdirkindtregkindtlnkkindRtworktwaddt	normalizeR�t	skipstep3R=tresultstfftnfR.R�tinsttprefixtfntndR�tentriesR t_[1]tvisitt_[2]ti((Rs%/sys/lib/python/mercurial/dirstate.pytwalk�s�						
	
												

	













	


"%





E:)
c
Cs�|||}}}gggggf\}}	}
}}ggg}}}|i}
|i}|	i}|
i}|i}|i}|i}|i}|i}x�|i|||�i�D]�\}}||
jo\|p|i|�o)|i|�o|o||�q'q�|o||�q�q�n|
|\}}}}|o|djo||�q�|djo�|djo,||ijp6||iAd@o
|ip|djp||i	jo||�qf|t
|i�jo||�qf|o||�qfq�|djo||�q�|djo||�q�|djo||�q�q�W||	|
|||||fS(	NtnmaRvii@i�R}RiR2(RR:R�R3R�R�RyRxRFRRzR{(RR�R�tcleanR�tlistignoredt	listcleantlistunknowntlookuptmodifiedtaddedtremovedtdeletedR�tladdtmaddtaaddtuaddtiaddtraddtdaddtcaddR�R.tstateR�R�ttime((s%/sys/lib/python/mercurial/dirstate.pytstatus*sV$									
'





N(2t__name__t
__module__Rt
propertycacheRRR"R(R1R5R>RBRDRFRHR7RNRORSRTRXRYR[R\R#RR`RcRRjRmRoRpRqRRuR|R�RR�R�R~R�R�R�R�RbR�R�R�(((s%/sys/lib/python/mercurial/dirstate.pyR&sX	
			
																										
		
	�Riii(tnodeRti18nRR*R6R�RdR�RR�R,R�R�t_unknownR�R�RR
RtobjectR(((s%/sys/lib/python/mercurial/dirstate.pys<module>s00				

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.