ܬQc@sddlZddlmZddlmZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddl Z ejZejZdZdefdYZdefdYZd efd YZdS( iN(tnullid(t_it repocachecBseZdZdZRS(sfilecache for files in .hg/cCs|jj|S(N(t_openertjoin(tselftobjtfname((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyRs(t__name__t __module__t__doc__R(((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyRst rootcachecBseZdZdZRS(s*filecache for files in the repository rootcCs |j|S(N(t_join(RRR((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyRs(RR R R(((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR stdirstatecBs$eZdZedZedZedZeddZedZ edZ dZ e d d Z ed Zed Zed ZedZdZdZdZd3dZdZdZdZdZdZdZdZdZedZ dZ!dZ"dZ#dZ$d Z%d!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,d(Z-d)Z.d*Z/e0d3d+Z1e0e0d,Z2d-Z3d3d.Z4d/Z5d0Z6d1Z7d2Z8RS(4cCsd||_||_||_tjj|d|_t|_t|_ d|_ ||_ i|_ dS(sCreate a new dirstate object. opener is an open()-like callable that can be used to open the dirstate file; root is the root of the directory tracked by the dirstate. tiN( Rt _validatet_roottostpathRt_rootdirtFalset_dirtyt_dirtyplt_lastnormaltimet_uit _filecache(Rtopenertuitroottvalidate((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt__init__s       cCs|j|jS(sYReturn the dirstate contents as a map from filename to (state, mode, size, time).(t_readt_map(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR /s cCs|j|jS(N(Rt_copymap(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR!6s cCsi}xC|jjD]2\}}|ddkr||tj|css .hgignorecCs|jdg}xT|jjdD]@\}}|dksL|jdr%|jtj|q%q%Wtj|j||jj S(Ns .hgignoreRtignoresignore.( R Rt configitemst startswithtappendR%t expandpathR?Rtwarn(RtfilesR)R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt_ignorefs cCs"|jjddo!tjdkS(NRtslasht/(Rt configboolRtsep(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt_slashnscCstj|jS(N(R%t checklinkR(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt _checklinkrscCstj|jS(N(R%t checkexecR(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt _checkexecvscCstj|jd S(Ns.hg(R%t checkcaseR (R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt _checkcasezscCs |j|S(N(R(RR(((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR ~scstjr%jr%fd}|S|jrMfd}|Sjrlfd}|SSdS(NcsZyBtjj|}tj|r.dStj|rAdSWntk rUnXdS(NR:txR(RtlstatR R%t statislinkt statisexectOSError(RRR9(R(s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR(s cs9tjjj|rdSd|kr5dSdS(NR:RRR(RRtislinkR (RR(tfallbackR(s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR(s cs6d|krdStjj|r2dSdS(NR:RRR(R%tisexecR (RR(RXR(s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR(s (RMRO(Rt buildfallbackR(((RXRs6/sys/lib/python2.7/site-packages/mercurial/dirstate.pytflagfuncs    cCsltj}||jkrdS|j}tj|sG|tj7}n|j|rd|t|S|SdS(NR(RtgetcwdRR%t endswithsepRJRAR6(Rtcwdtrootsep((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR\s  cCsM|dkr|j}ntj|j||}|jrItj|S|S(N(tNoneR\R%tpathtoRRKtpconvert(RR(R^R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyRas    cCs|jj|ddS(sReturn the current state of key (a filename) in the dirstate. States are: n normal m needs merging r marked for removal a marked for addition ? not tracked t?i(Rc(R tget(Rtkey((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt __getitem__s cCs ||jkS(N(R (RRe((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt __contains__sccs#xt|jD] }|VqWdS(N(tsortedR (RRR((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyt__iter__scCs |jjS(N(R R$(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR$scCs#g|jD]}|j|^q S(N(R<R(Rtp((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pytparentsscCs|j|jdS(Ni(RR<(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pytp1scCs|j|jdS(Ni(RR<(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pytp2scCstj|jS(N(tencodingttolocalR4(R((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR,scCst|_|_|jd}||f|_i}|tkr|tkrxc|jjD]O\}}|ddkrZ||jkr|j|||R RFRKRMRORQR R[R\R`RaRfRgRiR$RkRlRmR,RRuR}RRRRRtRRRRrRRRRRRRRRRRyRRR(((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyR sb      "                         (R1tnodeRti18nRR=R%R?RRRnRRR~Rt filecacheRRR tobjectR (((s6/sys/lib/python2.7/site-packages/mercurial/dirstate.pyts H0