$Jc@sddklZlZlZlZlZddklZddkZddk Z ddk Z ddk Z ddk Z ddk Z ddkZddkZddkZddkZddkZddkZddkZddkZddkZddkZddkZddkZddkZddklZddkZddk Z ddk!Z!ddk"Z"ddk#Z#ddk$Z$ei%Z%dei&fdYZ'dZ(dZ)d Z*dS( i(tbinthextnullidtnullrevtshort(t_N(treleasetlocalrepositorycBseZedddfZediZeddZedZ edZ edZ d Z d Z d Zd Zd ZedZdZhdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'ed$Z(eed%Z)d&Z*ed'Z+d(d)Z,d*Z-d+Z.d,Z/d-Z0d.Z1d/Z2d0Z3d1Z4d2Z5d3Z6d4Z7e8d5Z9e8d6Z:d7Z;d8eeeeehd9Z<ed:Z=d;Z>ed<Z?d=eeeeed>Z@d?ZAd@ZBedAZCdBZDdCZEedDZFeeedEZGdFZHdGZIeeedHZJeeedIZKeeedJZLeedKZMeedLZNdMZOdNZPdOZQdPZRedQZSdRZTdSZUedTZVdUZWgedVZXRS(Wtlookuptchangegroupsubsett branchmapsrevlogv1 store fncache sharedic Cs*tii|tii||_tii|id|_||_t i |i|_ t i |i|_ ||_ |i |_y3|ii|id|iti|iWntj onXtii|ip/|o tii|pti|nti|idg}|iiddtostitii|id|id|iiddto|idn|i d d id n|i d d }x|D]}|id|qW|iqtitd|n|otitd|nt}y%t|i d ii }Wn/tj o#}|i!t!i"joqnXx.||i#D]}titd|qW|i|_$y^tii|i di}tii|ptitd|n||_$Wn/tj o#}|i!t!i"joqjnXt%i%||i$t i |_%|i%i|_&|i%i |_'|i%i|_(|i%i)|i _)d|_+d|_,d|_-d|_.d|_/d|_0h|_1h|_2d|_3|_4|_5dS(Ns.hgthgrctrevlogv1tformattusestoretstoret usefncachetfncaches 00changelog.itat9 dummy changelog to prevent using the old repo layouttrequirestws%s srepository %s not foundsrepository %s already existssrequirement '%s' not supportedt sharedpaths1.hg/sharedpath points to nonexistent directory %s(6trepot repositoryt__init__tostpathtrealpathtroottjointorigroottutiltopenertwopenertbaseuitcopytuit readconfigt extensionstloadalltIOErrortisdirtexiststmkdirt configbooltTruetappendtwritetcloseterrort RepoErrorRtsettreadt splitlinesterrnotENOENTt supportedRRtspathtsopenertsjoint createmodetNonet_tagst _tagtypest branchcachet _ubranchcachet_branchcachetipt nodetagscachet filterpatst _datafilterst _transreft_lockreft _wlockref( tselfR#Rtcreatet requirementstreqfiletrtinstts((s&/sys/lib/python/mercurial/localrepo.pyRs      %  !          cCsjti|i}dtijo5tid}|i|io|idqWn|i|i_|S(Nt HG_PENDINGs00changelog.i.a( t changelogR;Rtenviront startswithRt readpendingtversiont defversion(RJtctp((s&/sys/lib/python/mercurial/localrepo.pyRRms cCsti|iS(N(tmanifestR;(RJ((s&/sys/lib/python/mercurial/localrepo.pyRZwscCsti|i|i|iS(N(tdirstateR!R%R(RJ((s&/sys/lib/python/mercurial/localrepo.pyR[{scCs.|djoti|Snti||S(N(R>tcontextt workingctxt changectx(RJtchangeid((s&/sys/lib/python/mercurial/localrepo.pyt __getitem__s cCstS(N(R.(RJ((s&/sys/lib/python/mercurial/localrepo.pyt __nonzero__scCs t|iS(N(tlenRR(RJ((s&/sys/lib/python/mercurial/localrepo.pyt__len__sccs&xtt|D] }|VqWdS(N(txrangeRb(RJti((s&/sys/lib/python/mercurial/localrepo.pyt__iter__scCs d|iS(Nsfile:(R(RJ((s&/sys/lib/python/mercurial/localrepo.pyturlscKsti|i||||S(N(thookR%(RJtnametthrowtargs((s&/sys/lib/python/mercurial/localrepo.pyRhss: cs`t|to|}|f}ndi|}x;iD]0} | |jotitd| q<q<Wx9|D]1} iddtdt d| d|qwWfd} d} |oyi d d } Wn%t j oi d d } nX| i } | | |d| x3|D]+} iddt d| d|q/WdSnyid d } Wn%t j oid d} nX| i } | | |ti| d ijoid gntiidd g}i|||d|d|}x3|D]+} iddt d| d|q-W|S(Nts%r cannot be used in a tag nametpretagRjtnodettagtlocalcs|idd|o"|ddjo|idnx|D]}|o ||p|}ioF|ijo6ii|t}|idt||fn|idt|fq@W|idS(Niiis s%s %s (tseekR0R@R?tgetRRR1(tfptnamestmungetprevtagsRitmtold(RJRn(s&/sys/lib/python/mercurial/localrepo.pyt writetagss!!t localtagssr+Rs.hgtagssrb+tabtextratmatch(t isinstancetstrRttag_disallowedR tAbortRRhR.RR!R)R5R>twfiletencodingt fromlocalR[taddtmatch_texactRtcommit(RJRtRntmessageRptusertdateR|tallcharsRXRiRyRvRsRwttagnode((RJRns&/sys/lib/python/mercurial/localrepo.pyt_tagsN   !$   ) !)c Cskx>|id D],}d|jotitdqqW|i|i||||||dS(sZtag a revision with one or more symbolic names. names is a list of strings or, when adding a single tag, names may be a string. if local is True, the tags are stored in a per-repository file. otherwise, they are stored in the .hgtags file, and a new changeset is committed with the change. keyword arguments: local: whether to store tags in non-version-controlled file (default False) message: commit message to use if committing user: name of user to use if committing date: date tuple to use if committingis.hgtagssCworking copy of .hgtags is changed (please commit .hgtags manually)N(tstatusR RRttagsR(RJRtRnRRpRRtx((s&/sys/lib/python/mercurial/localrepo.pyRos   cCs3|idjo|i\|_|_n|iS(sreturn a mapping of tag to nodeN(R?R>t _findtagsR@(RJ((s&/sys/lib/python/mercurial/localrepo.pyRsc Csh}h}ti|i|||ti|i|||h}xD|iD]6\}\}}|tjo||ti|RCtcleartnodemapt_readbranchcacheRRBRRRR(RJRtoldtipRtlastRtktv((s&/sys/lib/python/mercurial/localrepo.pyR Bs$          cCsh}x|iiD]\}}d}xVtt|dddD]8}||}d|ii|djo |}PqHqHW|djo|d}n|||trangeRbRRR5(RJtbttbntheadstheadReth((s&/sys/lib/python/mercurial/localrepo.pyt branchtags^s    c Csh}y2|id}|iid}|iWn&ttfj ohttfSnXy|ididd\}}t |t |}}|t |jp||i |jot dnxY|D]Q}|pqn|idd\}}|i|igit |qWWnhtj o nTtj oG} |iio|iit| dnhtt}}}nX|||fS(Nsbranchheads.caches it is'invalidating branch cache (tip differs)(R!R5tsplitR1R)tOSErrorRRtpopRtintRbRnt ValueErrorRtstripR/tKeyboardInterruptt ExceptionR%t debugflagtwarnR( RJRtftlinesRRRRntlabelRO((s&/sys/lib/python/mercurial/localrepo.pyRps0!*- c Csy|idddt}|idt||fxH|iD]:\}}x+|D]#}|idt||fqXWqEW|iWnttfj onXdS(Nsbranchheads.cacheRt atomictemps%s %s (R!R.R0RRtrenameR)R(RJtbranchesRRRRtnodesRn((s&/sys/lib/python/mercurial/localrepo.pyRs %c Csh}xFt||D]5}||}|i|igi|iqWx1|iD]#\}}|i|g} | i|t| djoq\ng} x|o|i} | | joqn|t g} | D]} | || i q~ i}|i i | |}g}| D]}||jo ||q,q,~} | i d| qW| i| | ||sics ||S(((RPRXR(toldfn(s&/sys/lib/python/mercurial/localrepo.pyR ssfiltering %s through %s R%Rtfilename(RER%t configitemsRR}RR>RFRRTRbtlstriptinspectt getargspecR/tdebugR( RJRRtdataRtpattcmdtmftfntparamsRitfilterfn((Rs&/sys/lib/python/mercurial/localrepo.pyt_filters:       $ cCs||i|trunningtnestRRR+R<R2R3RR!R5R)R0R[RRt transactionR%RR;t aftertransRR=tweakreftref(RJttrtdstrenames((s&/sys/lib/python/mercurial/localrepo.pyR2s( "!  cCs|i}ztii|idoM|iitdti |i |id|ii |i t Sn|ii tdtSWd|iXdS(NRs%rolling back interrupted transaction s%no interrupted transaction available (tlockRRR+R<R%RRRtrollbackR;Rt invalidateR.RR(RJR((s&/sys/lib/python/mercurial/localrepo.pytrecoverMs % c CsZd}}z;|i}|i}tii|ido|iit dt i |i |id|ii ti|id|idy)|idi}|ii|Wn?tj o3|ii t dti|iinX|i|ii|in|ii t dWdt||XdS(NRsrolling back last transaction s undo.dirstateR[s undo.branchs=Named branch could not be reset, current branch still is: %s s"no rollback information available (R>twlockRRRR+R<R%RRRRR;RR RRR!R5R[t setbranchR)RRRRt destroyedR(RJR!RR((s&/sys/lib/python/mercurial/localrepo.pyR[s&   %"  cCsrx5diD]'}||ijot||q q Wd|_d|_d|_d|_d|_d|_ dS(Nschangelog manifest( Rt__dict__tdelattrR>R?R@RDRARBRC(RJR((s&/sys/lib/python/mercurial/localrepo.pyRss      c Csyti|d|d|}Wn|tij om}|pn|iitd||ifti|t|iiddd|d|}nX|o |n|S(Nitdescs"waiting for lock on %s held by %r R%ttimeoutt600( RR2tLockHeldR%RRtlockerRtconfig(RJtlocknametwaitt releasefnt acquirefnR&RRO((s&/sys/lib/python/mercurial/localrepo.pyt_lock~s$ cCs|io |i}|dj o|io|i|Sn|i|id|d|itd|i}t i ||_|S(sLock the repository store (.hg/store) and return a weak reference to the lock. Use this before modifying the store (e.g. committing or stripping). If you are opening a transaction, get a lock as well.)Rs repository %sN( RHR>theldRR0R<RRRRR(RJR-R((s&/sys/lib/python/mercurial/localrepo.pyRs cCs|io |i}|dj o|io|i|Sn|i|id||ii|iit d|i }t i ||_|S(sLock the non-store parts of the repository (everything under .hg except .hg/store) and return a weak reference to the lock. Use this before modifying files in .hg.R!sworking directory of %sN( RIR>R1RR0RR[R0RRRRR(RJR-R((s&/sys/lib/python/mercurial/localrepo.pyR!s  c Cs|i}|i}|i|} |i|t} |i|t} } h} |i}|o6|d|jo%|d}|i|}| }|oC| tjp |djo%||jo||}| }qqn|pa|iit d||fx>|di D](}||jo||i }PqqWn|iit d||t |f|| dR%RRt ancestorstfilenodeRtancestortcmpR/RR(RJtfctxt manifest1t manifest2tlinkrevRt changelisttfnamettexttflogtfparent1tfparent2t fparent2otmetaR$tcfnametcrevt newfparentR6tfparentancestor((s&/sys/lib/python/mercurial/localrepo.pyt _filecommitsP        )    '  )RlcCsd}|pti|id}n|pg} | i|_||_n|i} zo|ii\} } |d} | oG| t jo:|o3|i p |i ot itdn|id|d|}|o|di|dng}xE| iD]:}||o'| i|io|i|qqW|o)d|djo|diddn| o|i ot|d|d |d }x|i D]}|d jp||jp|| ijoqn||d jo||td n|| joG|d}xa|D]}|i|oPqAqAW||tdq||ijo||tdqqWn| oi|id oX| t joK|dp|d p|d  o)|di|d ijodSnti|}xI|dD]=}||jo*||djot itdq1q1Wti|| | f|||||}|o|||||_n|o| ii}xa|D]Y}|i itd|| i|i!|i||}||d|f||RtfilestanypatsR RRRRtsubstatetsubtdirtyRR4RTRrRtmerge_t mergestateR\R]t_textR$R%Rtsubrepot writestatet commitctxR.tnormaltforgett setparentstresetR(RJR>RRR}tforceteditorR|RJtvdirsR!tp1tp2twctxtchangestsubsRPtmatchedRtdRtmstcctxtstatetsrtret((s&/sys/lib/python/mercurial/localrepo.pyRs      #  *   &"!  !  csd }}|i}|i|i}}|ii}|i} |i} |i|o |ipd} } iddt d| d| i }zi }t i |} h}g}t}xt|i|iD]}ii|dyF||}i||| || |||<|i||iWqttfj o<|o!iitd|q|i|qXqW|i|g}t|D]+}||jp || jo ||qq~}g}|D]}||jo ||qq~}x|D] }||=q>Wii|| ||i|i||f}ii ii||||i!| |i"|i"| |i#|i$i }fd}id dt d t|d| d| d |ii%| |i&i'oi(nid d t|d| d| |SWd ~|i)Xd S(stAdd a new revision to current repository. Revision information is passed via the context argument. Rlt precommitRjtparent1tparent2s strouble committing %s! csiio ipdS(Rl(RRt writependingR((RJ(s&/sys/lib/python/mercurial/localrepo.pyRst pretxncommitRntpendingRN(*R>tremovedRbRcRZR$RRRhR.RRRtproxyRbRtmodifiedtaddedR%tnoteRHR4RRR)RRR/tupdateRt manifestnodeRRt delayupdatet descriptionRnRR|tfinalizeR1RARR(RJtctxR2RRRtRbRctm1tm2Rtxp1txp2ttrptnewtchangedR;RR8RRtdroptmnRRY((RJs&/sys/lib/python/mercurial/localrepo.pyRZZsf    '      E2  !$   %cCsti|i|hhdS(sInform the repository that nodes have been destroyed. Intended for use by strip and rollback, so there's a common place for anything that has to be done after destroying history.N(RRR%(RJ((s&/sys/lib/python/mercurial/localrepo.pyR#scCs||i|S(s walk recursively through the directory tree or a given changeset, finding all files matched by the match function (twalk(RJR}Rn((s&/sys/lib/python/mercurial/localrepo.pyRsRcsBfd}t|tio |n |t|tio |}n |}|idj} | odj} ptiii|||} } } | o'|iijo|i n| pfd}|_ n| oSi i | | | }|\}}}}}}}}| o|og}x|t |D]n}|jp=|i|i|jp|i||io|i|qr|i|qrW| o||7}n|ocyFit}z%x|D]}i i|qWWd|iXWqctij oqcXqgqkn| p|}| oy|d}x9|||D])}d||<|i||i|qWxJ|D]}||jo ||=qqWn!ggg}}}||}ggg}}}x|D]}||jo|i||i|jp>||||jo:||p|i||io|i|n| o|i|n||=q9|i|q9W|i}n|||||||f}g}|D]}||iq$~|S(sreturn status of files between two nodes or node and working directory If node1 is None, use the first dirstate parent instead. If node2 is None, compare node1 with working directory. csE|ii}x,|iD]}|p ||=qqW|S(N(RZR$tkeys(R~RR(R}(s&/sys/lib/python/mercurial/localrepo.pyt mfmatchess   Rcs;|jo*iidii||fndS(Ns%s: %s (R%RR[R(RRI(tctx1RJ(s&/sys/lib/python/mercurial/localrepo.pyROs N(R~R\R^RR>RRMRRRZROR[RRRR7RR/R!RR[RR2t LockErrorR4Rtsort(RJtnode1tnode2R}tignoredRKtunknownRtctx2tworkingt parentworkingt listignoredt listcleant listunknownRORPR7RvRwRttdeletedtfixupRR!tmf1tmf2RRNRR((RJRR}s&/sys/lib/python/mercurial/localrepo.pyRs    "!  ,     ) %c Cs|i}zdg}xS|D]K}|i|}yti|}Wn1|iitd||i|qnX|idjo$|iitd||fnt i |i pt i |i p+|iitd||i|q|i |djo|iitd|q|i |djo|i i|q|i i|qW|SWd|iXdS(Ns%s does not exist! ise%s: files over 10MB may cause memory and performance problems (use 'hg revert %s' to unadd the file) s:%s not added: only files and symlinks supported currently tamns%s already tracked! RN(R!RRtlstatR%RRR/tst_sizetstattS_ISREGtst_modetS_ISLNKR[t normallookupRR(RJtlistR!trejectedRRYtst((s&/sys/lib/python/mercurial/localrepo.pyR#s4  &cCsu|i}zWxP|D]H}|i|djo|iitd|q|ii|qWWd|iXdS(NRs%s not added! (R!R[R%RRR\R(RJRR!R((s&/sys/lib/python/mercurial/localrepo.pyR\Bs c CsB|oax^|D]R}yti|i|Wqtj o#}|itijoq`qXqWn|i}zx|D]}|o:tii |i|o|i i t d|q~|i |djo|i i|q~||i jo|i i t d|q~|i i|q~WWd|iXdS(Ns%s still exists! Rs%s not tracked! (R R RRR7R8R!RRR+R%RRR[R\tremoveR(RJRR RROR!((s&/sys/lib/python/mercurial/localrepo.pyRMs( #c Cs*g}|iiD]:}|tjo'||ii|ii|dqq~}|i}zx|D]}|i|djo|iit d|qm||djo |dp|d}|i |i||}|i |||i ||ii |qmWWd|iXdS(NiRNs%s not removed! i(R[RRRZR5RRR!R%RRRRRR[R( RJRRRYt manifestsR!RRwR((s&/sys/lib/python/mercurial/localrepo.pytundeletecsP &cCs|i|}tii|ptii|p|iitd|ntii|ptii|p|iitd|nZ|i }z?|i |djo|i i |n|i i ||Wd|i XdS(Ns%s does not exist! s1copy failed: %s is not a file or a symbolic link s?r(RRRR+RR%RRtisfileR!R[RR$R(RJtsourcetdestRYR!((s&/sys/lib/python/mercurial/localrepo.pyR$ss&&  cCsq|ii|}g}|D] }||ii| |fq~}g}t|D]\}}||qW~S(N(RRRRR(RJRRRRRRNR((s&/sys/lib/python/mercurial/localrepo.pyRs4cCs|djo|di}n|i}||jogSn||}|i|dj o |ii|g|d}n|pFg}|D].}d|ii|djo ||qq~}n|S(NiR1i(R>RR treverseRRt nodesbetweenR5(RJRRtclosedRRRR((s&/sys/lib/python/mercurial/localrepo.pyt branchheadss       5cCs|p|iig}ng}x~|D]v}|}xg|ii|}|dtjp|dtjo&|i|||d|dfPn|d}q9q*W|S(Nii(RRRRRR/(RJRRRRRY((s&/sys/lib/python/mercurial/localrepo.pyRs"!c Csg}x|D]\}}|gd}}}d}xm||jo_|tjoR|ii|d} ||jo|i||d}n| }|d7}q6W|i|q W|S(Niii(RRRRR/( RJtpairsRNttoptbottomRRReRRY((s&/sys/lib/python/mercurial/localrepo.pytbetweens   cCs|i||||dS(sReturn list of roots of the subsets of missing nodes from remote If base dict is specified, assume that these nodes and their parents exist on the remote side and that no child of a node of base exists in both remote and self. Furthermore base will be updated to include the nodes that exists in self and remote but no children exists in self and remote. If a list of heads is specified, return only nodes which are heads or ancestors of these heads. All the ancestors of base are in self and in remote. All the descendants of the list returned are missing in self. (and so we know that the rest of the nodes are missing in remote, see outgoing) i(tfindcommonincoming(RJtremotetbaseRR_((s&/sys/lib/python/mercurial/localrepo.pyt findincomingsc Cs|ii}g}t}t}t} |djo h}n|p|i}n|iitjoKd|t<|tgjotgtgt|fSntgggfSn|ii t dg} x6|D].} | |jo| i | qd|| }|| jo+||jo|i || i|qAqAW|i|dqiW|o| d7} |iit d | d itt|fxtdt|d D]l}xc|i |||d !D]G}|iit dt|dt|df| i |qWqWqYqYWxV|oNg}| d7} x7t||i|D]\}}|i |d|d}d}x|D]}|iit d|t|t|f||jo|djo;|iit dt||i|d||RRRRR%RRR/RRRRRRRtmapRdRbtzipRR2R3RR R(RJRRRR_Rwtsearchtfetchtseent seenbranchRRtreqtreqcntRNRRYRt newsearchRRReR((s&/sys/lib/python/mercurial/localrepo.pyRs           " """    "    /     ?c Cs|djo#h}|i|||d|n|iitdditt|idt |i i }|i t |i}xc|o[|id}||jo;|i |x+|i i|D]}|i|qWqqWg} t } x|D]}|i i|\} } | |jo| |jo| i|n|o@| |jo| i| n| |jo| i| qq q W|o| t| fSn| SdS(sReturn list of nodes that are roots of subsets not in remote If base dict is specified, assume that these nodes and their parents exist on the remote side. If a list of heads is specified, return only nodes which are heads or ancestors of these heads, and return a second element which contains all remote heads which get new children. R_scommon changesets up to Rs iN(R>RR%RRRRRRR4RRRRRRRR/RR( RJRRRR_tremainRRRYtsubsett updated_headsRbRc((s&/sys/lib/python/mercurial/localrepo.pyt findoutgoing[s<  -        c Cs6|i}z|i|d|d|\}}}|tgjo|iitdn|p|iitddSn|djo|ido |}n|djo|i|d}n?|idpt i tdn|i ||d}|i |d|i SWd|iXdS( NRR_srequesting all changes sno changes found iR tpullsWPartial pull cannot be done because other repository doesn't support changegroupsubset.(RRRR%RRR>tcapablet changegroupR RR taddchangegroupRgR( RJRRR_RtcommonRtrheadstcg((s&/sys/lib/python/mercurial/localrepo.pyRs$   cCs:|ido|i|||Sn|i|||S(Ntunbundle(Rt push_unbundletpush_addchangegroup(RJRR_trevs((s&/sys/lib/python/mercurial/localrepo.pytpushs c sh}|i}i|||d|}i|||\}}dj o"ii|\} } n|ii} fd} | piitdd Sn|p|t gjoM|i doh} pi } nQxMD]E} | i }|| jo| |i | q| g| |RRRR%RRRRR RR/Rt _changegroupRR (RJRR_RRt remote_headstincRyRtmsng_cltbasesRtlocalhdsRRt remotehdstlhRRRtupdRR((RRJRs&/sys/lib/python/mercurial/localrepo.pytprepushsX  ".     +  cCsy|i}z[|i|||}|ddj o)|\}}|i|d|iSn|dSWd|iXdS(NiRi(RRR>RRgR(RJRR_RRRmRR((s&/sys/lib/python/mercurial/localrepo.pyR#s   cCse|i|||}|ddj o7|\}}|o dg}n|i||dSn|dS(NiR_Ri(RR>R(RJRR_RRmRR((s&/sys/lib/python/mercurial/localrepo.pyR.s  cCs|iip |djo$|iitdt|n|iioE|iitdx,|D] }|iidt|qhWndS(Ntbundles%d changesets found slist of changesets: s%s (R%tverboseRRRbRRR(RJRRRn((s&/sys/lib/python/mercurial/localrepo.pytchangegroupinfo;s$ c sdjo|ii}|i||jofg}xI|D]A}x8ii|D]$}|tjo|i|q`q`WqGWi|Sqniddt dii ||\ }}i t } x$|D]}| i i|qW| itt| } | o1i d| \} } d} t n t i hh it d} d} dd fd fd fd  fd  fd fd fd  fd} ti| S(stThis function generates a changegroup consisting of all the nodes that are descendents of any of the bases, and ancestors of any of the heads. It is fairly complex as determining which filenodes and which manifest nodes need to be included for the changeset to be complete is non-trivial. Another wrinkle is doing the reverse, figuring out which changeset in the changegroup a particular filenode or manifestnode belongs to. The caller can specify some nodes that must be included in the changegroup using the extranodes argument. It should be a dict where the keys are the filenames (or 1 for the manifest), and the values are lists of (node, linknode) tuples, where node is a wanted node and linknode is the changelog node that should be transmitted as the linkrev. t preoutgoingRjRicSs|S(N((R((s&/sys/lib/python/mercurial/localrepo.pytidentitysc Sst|}|id|ix|D]}g}|i|D]}|tjo ||q@q@~}x~|ov|i}||joY|i|g} |i|D]}|tjo | |qq~ }|i|qjqjWq&Wx|D]}|i|dqWdS(NR( RRRRRRRRR>( trevlogthassettmsngsetthaslstRnRRYt parentlstRR((s&/sys/lib/python/mercurial/localrepo.pyt prune_parentss ;    ;csfd}|S(NcsLi|}x"|dD]}i||qWi|d|dS(Nii(R5R(tclnodeRXR(tmsng_mnfst_settchangedfilesettcl(s&/sys/lib/python/mercurial/localrepo.pytcollect_manifests_and_filess  ((RR(RR(Rs&/sys/lib/python/mercurial/localrepo.pytmanifest_and_file_collectors csmt}xMD]E}iii|}|jo|i|qqW|dS(N(R4RnR;RR(t has_mnfst_setRtlinknode(RRt has_cl_setRtmnfst(s&/sys/lib/python/mercurial/localrepo.pytprune_manifestss ! cs|S(N((t mnfstnode(R(s&/sys/lib/python/mercurial/localrepo.pytlookup_manifest_linkscs(dgfd}|S(Nics i|}|djoi|}x|iD][\}}i|d}|dj o0|}i|h}|i||q<q<Wnpi|}x]D]U}|i|d}|dj o0|}i|h}|i||qqW|ddRR5(RRNtdeltamfRtfnodeRtndsetRw(tnext_revRt changedfilestmsng_filenode_setR(s&/sys/lib/python/mercurial/localrepo.pytcollect_msng_filenodess&     ((RR(RRR(RRs&/sys/lib/python/mercurial/localrepo.pytfilenode_collectors "csw|}t}xM|D]E}i|i|i|}|jo|i|qqW|||dS(N(R4RnR;RR(Rt filerevlogRRRR(RRRR(s&/sys/lib/python/mercurial/localrepo.pytprune_filenodess  ! cs|fd}|S(Ncs|S(N((R(R(s&/sys/lib/python/mercurial/localrepo.pytlookup_filenode_links((R=R(R(Rs&/sys/lib/python/mercurial/localrepo.pytlookup_filenode_link_funcs csW p |jodSnx3|D]'\}}||jo|||RR~RRRRRbR RRRt chunkheadert closechunkRhR(RR tchnktmsng_mnfst_lstR=Rtmsng_filenode_lst(RRRRRRRRRRRt msng_cl_lstRRRRJ(s&/sys/lib/python/mercurial/localrepo.pytgengroup#s`               N(R>RRRRRRR/RRhR.RRR4RytdiscardRRZtindexRbR t chunkbuffer( RJRRRRtallheadsRRRYt knownheadstjunkR((RRRRJRRRRRRRRRRRRRRs&/sys/lib/python/mercurial/localrepo.pyR CsX               / R RRZtgetchunkRRRRnR}R1RRd(RJRtsrctypeRgtemptyokR"R#t changesetsRPt revisionstoldheadsRRtclstartR'tclendRtfltoRRRYRe((RRJs&/sys/lib/python/mercurial/localrepo.pyRsz     $        ! ! cCs|i}|i}yt|}Wn+tj otitd|nX|djotitdnM|djotitdn'|djotitdn|i i td|i}y%t t|i d d\}}Wn1tt fj otitd|nX|i i td |ti|fti}xt|D]}|i}y(|i d d\} } t| } Wn1tt fj otitd|nX|i itd | ti| f|iti| d } x*ti|d| D]} | i| qMW| iqWti|} | djo d} n|i i tdti|| ti|| f|it|idS(Ns'Unexpected response from remote server:isoperation forbidden by serveris$locking the remote repository failedis%the server sent an unknown error codesstreaming all changes Rs!%d files to transfer, %s of data tsadding %s (%s) RtlimitgMbP?s(transferred %s in %.1f seconds (%s/sec) (t stream_outtreadlineRRR2t ResponseErrorRR RR%RRRt TypeErrort bytecountttimeRdRR;Rt decodedirt filechunkiterR0R1RRbR(RJRRsRtrespt total_filest total_bytesRReRitsizetofptchunktelapsed((s&/sys/lib/python/mercurial/localrepo.pyt stream_ins\      %   )   cCs@|o)| o!|ido|i|Sn|i||S(sclone remote repository. keyword arguments: heads: list of revs to clone (forces use of pull) stream: use streaming clone if possibletstream(RRDR(RJRRRE((s&/sys/lib/python/mercurial/localrepo.pytcloneMs(Yt__name__t __module__R4t capabilitiesRR9R>Rt propertycacheRRRZR[R`RaRcRfRgRRhRRRoRRRRRRR RRRRRRpRRRRR^RRRRRRRRR RRRR RRR0R.RR!RHRRZR#RRRR\RRR$RRRRRRRRRRRRRR RRRRDRF(((s&/sys/lib/python/mercurial/localrepo.pyRsT        >   !                            Kd D   i       0 p  *  D i 0cs:g}|D]}|t|q ~fd}|S(Ncs+x$D]\}}ti||qWdS(N(R R(tsrcR(t renamefiles(s&/sys/lib/python/mercurial/localrepo.pyRcs (ttuple(RPRRR((RLs&/sys/lib/python/mercurial/localrepo.pyRas'cCst|tid||S(NR(RR t drop_scheme(R%RRK((s&/sys/lib/python/mercurial/localrepo.pytinstancehscCstS(N(R.(R((s&/sys/lib/python/mercurial/localrepo.pytislocalks(+RnRRRRRti18nRRRRXRRR[RRZR\RRRRR R'RhR2R}RtmergeRURRRRRR7RR:RRJRRRRORP(((s&/sys/lib/python/mercurial/localrepo.pyss.($<00   H T