m RDc@sdkTdklZdkTdkZeedeedeedeeddeifdYZd Z dS( (t*(sgettextNsappendfile changegroups+changelog dirstate filelog manifest contexts0re lock transaction tempfile stat mdiff errno uisos revlog time utiltlocalrepositoryc BstZfZdZeddZedZdZeeeedZ dZ dZ d Z d Z d Zd Zd ZdZdZdZeedZdZddZdZedZdZdZedZdZdZeeedZddZddZ d Z!eeed!Z"ed"eee#i$eeeed# Z%ege#i$ed$Z&eege#i$eed%Z'ed&Z(ed'Z)eed(Z*ed)Z+ed*Z,ed+Z-eed,Z.d-Z/d.Z0eeed/Z1eeed0Z2eed1Z3eed2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:eeee;eee;d9Z<d:Z=d;Z>d<Z?ged=Z@RS(>NcCs d|_dS(N(tNonetselft transhandle(R((t7/usr/lib/python2.4/site-packages/mercurial/localrepo.pyt__del__sic Cs?tii||p~ti}xetiitii |dpB|}tii |}||joti t dq&q&W|}ntii |d|_| o4tii|i oti t d|ntii||_||_tid||_ti|i|_ti|i|_y#|ii|i d|iWntj onX|ii}t|idti|_|iti j|_!|idd}d}|djo.xB|i%D]} |ti'| O}qWn|i!o ti(}n|i|B}t)i)|i||_)t*i*|i||_*|i*i+}||ijo||O}n||_d|_,d|_-d|_.d|_/d|_0|oNtii1|pti2|nti2|iti2|i d nt3i3|i|i|i|_3dS( Ns.hgs no repo foundsrepository %s not foundtparentuithgrctformattflagsitdata(4trepot repositoryt__init__Rtpathtostgetcwdtptisdirtjointoldptdirnamet RepoErrort_tcreatetabspathtroottorigroottuiRtutiltopenertwopenert readconfigtIOErrort revlogoptstvtinttgettrevlogtREVLOG_DEFAULT_FORMATt revlogversiontREVLOGV0trevlogv1RtflR tsplittxtflagstrtREVLOG_DEFAULT_FLAGStmanifestt changelogtversiont tagscachet nodetagscachet encodepatst decodepatsRtexiststmkdirtdirstate( RRRRRR,RR R$R.((RRsf "   #             c sd}d} t} g}iidD]A\}}|i dddjo|o|||fqDqD~}|i x^|D]V\}}|ido$|||dip| } q| ||p| } qW| S( Nc siitd||f|id}|djo#ti td||fn|| }yt |}Wn\t j oPyt d|}Wqt j o&ti td||fqXnXy1x*|iddD]}t||}qWWn4tj o(}ti td||fnXt|p#ti td ||fny%|d id d }Wnttifj o ntj o}t|ti o6iitd ||id|idfn!iitd||foniitSnX|oBoti td|niitd|n|S(scall python hook. hook is callable object, looked up as name in python module. if callable returns "true", hook fails, else passes. if hook raises exception, treated as hook failure. exception propagates if throw is "true". reason for "true" meaning "hook failed" is so that unmodified commands (e.g. mercurial.commands.update) can be run as hooks without wrappers to convert return values.scalling hook %s: %s t.is)%s hook is invalid ("%s" not in a module)shgext_%ss*%s hook is invalid (import of "%s" failed)is(%s hook is invalid ("%s" is not defined)s)%s hook is invalid ("%s" is not callable)RR thooktypeserror: %s hook failed: %s is'error: %s hook raised an exception: %s s%s hook failedswarning: %s hook failed N( RRtnoteRthnametfuncnametrfindtdRtAborttmodnamet __import__tobjt ImportErrorR-RtgetattrtAttributeErrorterrtcallabletnametargstrtKeyboardInterrupttSignalInterruptt Exceptiontexct isinstancetwarntthrowt print_exctTrue( R>R?RQRCRERARIRRM(RRKRLRT(RtcallhookWsL  # )$ #%6   csiitd||ftg}i D]#\}}|d|i |fq4~}ti|d|di}|octi|\}}o#titd||fniitd||fn|S(Nsrunning hook %s: %s tHG_tenvirontcwds %s hook %sswarning: %s hook %s (RRR=RRKtcmdtdictt_[1]RLt iteritemstkR$tuppertenvRtsystemRRMt explain_exittdescRTRBRS(RKR[R]RMRaR$R_Rd(RLRRT(Rtrunhooks C#$thooksR;iispython:i(RWRetFalseRMR]RRt configitemsR>R[R-RKRftsortt startswithtstrip( RRKRTRLR[RfR>RWR]RMRe((RRKRTRLRthookVs: a  $s: c Csx;|iD]0}||jotitd|q q W|iddtd|d|d||oJ|i ddi d ||f|idd|d|d|d Snx:|i D],}d |jotitd qqW|id d i d ||f|iid djo|id gn|ptd||f}n|id g||||idd|d|d|d S(stag a revision with a symbolic name. if local is True, the tag is stored in a per-repository file. otherwise, it is stored in the .hgtags file, and a new changeset is committed with the change. keyword arguments: local: whether to store tag 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 committings%r cannot be used in a tag nametpretagRTtnodettagtlocalt localtagstas%s %s Ns.hgtagssCworking copy of .hgtags is changed (please commit .hgtags manually)tabt?sAdded tag %s for changeset %s(Rttag_disallowedtcRKRRBRRlRVRnRpRtwritetchangesR.twfileR:tstatetaddtmessagetcommittusertdate( RRKRnRpR|R~RRvR.((RRos*  !%#  #c sipvh_d}i}|iid} x|D]}ii |} ii |}i i | dd\}} |d joqNnd}xM| i |iD]6|d7}|td|t||fqWqNWyKid}d}x/|D]'|d7}|td|q$WWntj onXiiidy|ii|SWq_titd|q_XnXdS(Nsunknown revision '%s'( RRRtKeyErrorR2tlookupR RR(RR((RR scCsti|iiS(N(RtlstatRRtst_dev(R((Rtdev)scCstS(N(RV(R((RRp,scCstii|i|S(N(RRRRR(RR((RR/scCstii|i|S(N(RRRRRR(RR((Rtwjoin2scCs8|ddjo|d}nti|i||iS(Nit/i(RtfilelogRRR)(RR((RR5scCsti||S(N(Rt changectxRtchangeid(RR((RR:scCsti||||S(sechangeid can be a changeset revision, node, or tag. fileid can be a file revision or node.N(RtfilectxRRRtfileid(RRRR((RR=scCs |iiS(N(RR:R(R((RRBsRMcCs|i||S(N(RR Rtmode(RRR((RRyEscCs|idjong}xX|iidD]D\}}ti |i d|gggd}|i ||fq)W||_n|i |di}x[|iD]P\}}||o7|iitd||fti||}PqqW|S(NtencodetiRMsfiltering %s through %s (RR6RRRRhtpatR[RtmatcherRtmfRR tfilenameRR tdebugRtfilter(RRRRR[RR ((RtwreadHs %     cCs |idjong}xX|iidD]D\}}ti |i d|gggd}|i ||fq)W||_nx[|iD]P\}}||o7|iitd||fti||}PqqW|o|i|Sn|i|di|S(NtdecodeRisfiltering %s through %s tw(RR7RRRRhRR[RRRRRRRRRR tfdRwR (RRR RRRR[R((RtwwriteZs  %     cCs|i}|djo|io|iSny|idi}Wnt j o d}nX|iddi |t i |i i |i|idt|i}||_|S(NR:Rsjournal.dirstateRtjournal(RRttrRtrunningtnestRRtdsR"Rwt transactionRRSRt aftertransR(RRR((RRls    cCs|i}tii|idoD|iit dt i |i |id|i tSn|iit dtSdS(NRs%rolling back interrupted transaction s%no interrupted transaction available (RtlockRRRR8RRtstatusRRtrollbackRtreloadRVRSRg(RR((Rtrecover~s  cCs|p|i}n|i}tii|idol|ii t dt i |i |idti|id|id|i|in|iit ddS(Ntundosrolling back last transaction s undo.dirstateR:s"no rollback information available (twlockRRRRRR8RRRRRRRRtrenameRtwreloadRS(RRR((RRs " cCs|iidS(N(RR:R(R((RRscCs0|ii|iid|_d|_dS(N(RR2tloadR1RR4R5(R((RRs   cCsy(ti|i|d|d|}Wntij o~}|pn|i i t d||i dfti|i|t|i iddpd|d|}nX|o |n|S(NiRds"waiting for lock on %s held by %s RttimeoutiX(RRRtlocknamet releasefnRdRtLockHeldtinsttwaitRRSRRLR%tconfigt acquirefn(RRRRRRdRR((Rtdo_locks(' icCs,|id|d|idtd|iS(NRRRds repository %s(RRRRRR(RR((RRscCs2|id||ii|idtd|iS(NRRdsworking directory of %s(RRRR:RwRRR(RR((RRsc Cs|i|t}|i|t}|tjo|i||}||jo|t}}n||jo t}n|tjo'||i |jo|ddfSqnd||fS(s*determine whether a new filenode is neededN( t manifest1R&Rtnullidtfp1t manifest2tfp2RtancestortfpattextRR( RRRRRRRRR((Rtcheckfilemerges    #c Cs |iidpt}|p|iidpt}|p|iidpt}|ii|}|ii|}|i i|d} |i i |d}|i i|d}g}||jo d} nd} |p|i}n|i}|i} | i}|i}|ii} x=|D]5}y|i|}t i!|i"||i#|t$} |i&|}| ||<|i(|||| |\}}}|o|||t2i3|i4| |i5| t6|| <|i7| }Wn0t9j o$|i i t d | nX|i:| }(h} |ii=| } | oj| | dRA(Rtvisibles        ' ($RRR]R=theadtR2tchlogRAtmergest seenmergeRRtfoundR@tseenRtppRRR.RRRtbranchRtoutR>RBRRgtvisRtbbRVRR(RRRJRDRLRBRHRKRIRCRER@RFRMRR.R>RRARR=RRR]RG((R>RARt branchlookupYs~!            2    %cCs|p|iig}ng}x|D]x}|}xi|ii|}|dt jp|dt jo&|i |||d|dfPn|d}q9Wq*W|S(Nii( tnodesRR2RRRRRRRR(RRORRRR((RRAs"!c Csg} x|D]\}}|gd}}}d}x`||joR|i i |d}||jo|i ||d}n|}|d7}q6W| i |q W| S(Niii( RMtpairsttoptbottomRRtiRRR2RRR( RRPRRRSRQRRRRRM((Rtbetweens    cCs}|ii}g} h}h}h} |djo h}n|p|i }n|ii t jo-d|t <|t gjo t gSngSn|iitdg}x6|D].}||jo|i|qd|| 6    cCs|i}|i|d|}|tgjo|ii t dn|p|ii t ddSn|djo|i |d}n|i||d}|i|dS(NRsrequesting all changes sno changes found itpull(RRRR^RYRRVRRRRRRt changegrouptcgtchangegroupsubsettaddchangegroup(RRYRRReRRV((RRcs  cCs:|ido|i|||Sn|i|||S(Ntunbundle(RYtcapableRt push_unbundleRtrevstpush_addchangegroup(RRYRRk((Rtpushs c Csh}|i} |i||| d|} | o;| o4|ii t d|ii t dd Sn|i ||| \}} |dj o"|ii||\}}} n||ii}} |p|ii t dd Snq|pi| o]t| t| joD| tgjo4|ii t d|ii t dd Sqen|djo|i|d}n|i||d}|| fS( NRs abort: unsynced remote changes! s/(did you forget to sync? use push -f to force) isno changes found s)abort: push creates new remote branches! s0(did you forget to merge? use push -f to force) Rm(Ni(Ni(Ni(RXRYRt remote_headsRR^RtincRRSRRRRbRRaRkR2t nodesbetweentmsng_cltbasesRRRdReRf( RRYRRkRrReRRXRqRRaRnRo((Rtprepushs.  "1  cCsZ|i}|i|||}|ddj o |\}}|i |dSn|dS(NiRmi( RYRRRsRRkR?RReRnRg(RRYRRkRReR?Rn((RRls   cCse|i|||}|ddj o7|\}}|o dg}n|i ||dSn|dS(NiRRmi( RRsRYRRkR?RReRnRh(RRYRRkReR?Rn((RRjs  c"siddtdii||\ }}h}xC|D];}x2i |D]!}|tjod||s cs^h}xAD]9}ii|}|jod||c siddtdii|d dt i g} D]} | i| qI~ ddddd }ti|S( sGenerate a changegroup of all nodes that we have that a recipient doesn't. This is much easier than the previous function as we can assume that the recipient has any changenode we aren't sending them.RtRTR;icCs|S(N(R.(R.((RRusc#sQxJtd|iD]3}|i|}|i|jo|VqqWdS(Ni(txrangeR'RRMRnRRtrevset(R'RMR(R(Rt gennodelsts csd}|S(Ncs2i|}x|dD]}d|ti|V|}x"|i||D] }|VqWqqWtiVo'iddtddndS(NRRniR;(RR}RRORuRRRRiRR1RRtnodeiterRRRRR1RdRRRRlRR;(RRRRRRR(R}RRR;RORRRu(RRs4          N(RRlRVR;R2R}Rpt basenodesRROR\RR]RRRRuRRRRRR( RRR;RRR}RRRR]RORRu(( RR;R}RRRORRRuRRds 3    !c sd}d} |pdSniddtd|d}} }i }dztiiiiti} iitdid}ti|}i|||ddjotitd nid}||}iitd ti|}i!i|| |iitd xti"|}|pPnii$td |i%|}|i}ti|}|i|| |djotitd n||i|7}| d7} qnWi(Wdoi)nXtiiii_ii*|tii} d} | o%| | jotd| | } niitd||| | f|djo9iddtdt,ii-|dd|n|i.|djoiddt,ii-|dd|xNt/|d|dD]1}iddt,ii-|d|qWn| | dS(sOadd changegroup to repo. returns number of heads modified or added + 1.cs*iitdt|iS(Nsadd changeset %s (RRRRRR.R}R(R.(RR}(Rtcsmap6s cs i|S(N(R}RR.(R.(R}(Rtrevmap:sitprechangegroupRTR;sadding changesets is!received changelog group is emptysadding manifests sadding file changes sadding %s revisions s#received file revlog group is emptyNRs (%+d heads)s2added %d changesets with %d changes to %d files%s tpretxnchangegroupRnRdtincoming(1RRR;RRlRVtsrctypet changesetsRt revisionsRRRR}t appendfiletappendchangelogRR2R3RRtoldheadsRRRRtcorRdt chunkitertaddgroupRRBtcnrR1tgetchunkRRRR,tot writedatatcleanuptcheckinlinesizetnewheadsRRnRR]RS(RR;RR}RRRRRRRRRRR,RRRRSR((RR}RRg2sv    & *  % !c ? Cs|ii}:| o*|:dtjotitdnt }0|:d|}/}-|ii|/|-}|ii|/d}#|ii|-d}|ii|#|},|ii|#}|ii|#}$|ii|i}|ii|}%|ii|,})|ii|,} |i\}3} }*}"}||/jp ||-j} |o | otitdn|o:| o2|3p| p|*otitdqn| o| ox|D]u}1|1|job|i(|1}5|i*|1i||1}2t,|5|2djotitd|1qHqqWn|i-i.td|i-i/td|||| f|i-i/td t1|,t1|#t1|fh}7h}g}4|i}8|$i} t7i8|} xK| |3|D];}1d |8|1D]\}1}|o||1 oqn|1|jod}|1|joY|i(|1}5|i*|1i||1}2t,|5|2djo||1}n~5~2n|||1jo%|)i3|1t}||jo||1|jo|i-i/td |1| i3|1d| |1|%|1}}}.||A||.AB|A}|i3|1t||1|f|7|1D]l\}1}|o||1 oqnn|1ddjoqnn|1|)jo||)|1jotd}9| oJ| p|o<|i-iHtd|1tdtdtd}9n|9tdjo|||1}|i_|1|=|>|<|(}|otQ}0|'iI|1ntiF|i;|1||oe|;o|iiZ|1gd+qZ ta|i*|1i|>}|iiZ|1gd'd,|d(d)qi qi W|4iNx|4D]}1|i-i.td-|1tic|1ytid|i;|1Wqo tej oC}&|&igtgihjo'|i-iPtd.|1|&iifqqo Xqo W|o2|;o|iiZ|4d/qE|ii=|4n|o|iij|/|-n|ota|td0fta|7ta|'td1fta|4td2fta|'td3ff}d4img}6|D]}|6td5|q~6}|i-iKd6|n|o|;o]|'o<|i-iKtd7|iio|/|iio|-fq|i-iKtd8q|'o|i-iKtd9qn|iVd:d$|<d%|!d;tp|0|0S(<Nisoutstanding uncommitted mergesisEthere is nothing to merge, just use 'hg update' or look at 'hg heads'soutstanding uncommitted changess>'%s' already exists in the working dir and differs from remotesresolving manifests s, force %s allow %s moddirstate %s linear %s s ancestor %s local %s remote %s Rs %s versions differ, resolve s remote %s is newer, get s updating permissions for %s RAs' local changed %s which remote deleted s(k)eep or (d)elete?s[kd]R_sother deleted %s sremote deleted %s, clobbering sremote deleted %s slocal modified %s, keeping s working dir created %s, keeping Rs&remote changed %s which local deleted sremote created %s slocal deleted %s, recreating slocal deleted %s s:this update spans a branch affecting the following files: s (resolve)s %s%s s#aborting update spanning branches! sL(use 'hg merge' to merge across branches or 'hg update -C' to lose changes) t preupdateRTRRs getting %s Rtst_mtimeis merging %s Rtst_sizes removing %s s update failed to remove %s: %s! RMtupdatedtmergedRt unresolveds, s %d files %ss%s s`There are unresolved merges, you can redo the full merge using: hg update -C %s hg merge %s s'(branch merge, don't forget to commit) s9There are unresolved merges with locally modified files. Rterror(qRR:RtplRRRRBRRgRIRnRRR2RtpaRtm1ntm2nR1tmanRRRRRR-tmatmfaRxRRRRRt linear_pathtallowt forcemergeRRR"RR#R$RR=Rt moddirstateRtmergeR&RtmwtmfwR\RtumapRRRRR^RtchooseRRrRRvRR8RMtpromptRt branch_mergeRRR,RitcfRSRVRR R txxp2RlRRRRt failedmergetmytothertflagtmerge3R?Rtf_lent audit_pathR4R5RR6R7tstrerrorRt show_statststatsRR]RR%(?RRnRRRRRRRRRRRRRRRRRRRR&RR?R=RRRRRRRrRRRRRR-RRR RRR,RRRvRRIRR#RRR"R]RRRMRRR RR((RRs )&5   /       (# :!( !                     *  0d4<%c sd}ii||} i }|d| } |d|}i itdi itdt|t|t| ftiidpi iddpd } tid | || |fd id hd <d|<d|<dt|<dt|<dt| <} | oi itdnti| ti|| S(s.perform a 3-way merge in the working directorycspdtii|f}tid|\}}ti |d}i i|||i|S(Ns%s~%s.tprefixtwb(RRtbasenameRRtprettempfiletmkstempRRKtfdopenRRRR,RRnR(RRnRRKRR(R,RR(Rttemps  RXRs resolving %s s$file %s: my %s other %s ancestor %s tHGMERGERRthgmerges%s "%s" "%s" "%s"RZRYtHG_FILEt HG_MY_NODEt HG_OTHER_NODEtHG_FILE_MY_NODEtHG_FILE_OTHER_NODEtHG_FILE_BASE_NODEsmerging %s failed! N( RRRRR,RRRRXRRrRRvRR=RRRRRYR&RR[RRbRRRRRMRSR4(RRRRRRRrRvRR,R[RMRXR((RRR,RRs"8/"T  c#s h}h}d}}} dgdgh}ddd}!d}i tijiipijo,iitdodpdnh}iitd|!id xtiiD]}|d7}ii|}ii|}||jotd ||fn||jotd |nd||W|iqWti|}|i i td ti||ti||f|it |i!dS( Nisoperation forbidden by serversstreaming all changes Ris!%d files to transfer, %s of data Rsadding %s (%s) Rtlimits(transferred %s in %.1f seconds (%s/sec) ("RYt stream_outtfpR%treadlinetrespRRBRRRRR\R-t total_filest total_bytest bytecountttimeR<RRSRKtsizeRRtofpt filechunkitertchunkRwRtelapsedRRR( RRYR RSRRR<RRRRR RK((Rt stream_ins,  ')   #9 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 possibletstreamN(RRRYRiRRRc(RRYRR((Rtclones (At__name__t __module__t capabilitiesRRRRgRlRuRoRRRRRRpRRRRRRRyRRRRRRRRRRRRRtalwaysR}R RxR{RRR9RRRNRARTR^RbRcRmRsRlRjRfRdRgRVRRRRR(((RRsx @ Q, 7                 8'\    S  0 #  B _, % cs|d}|S(Ncs`titiidtiidtitiidtiiddS(NRRsjournal.dirstates undo.dirstate(RRRRRR((R(RRrs.(RXRRr(RXRrR((RRRs ( Rnti18ntgettextRt demandloadR tglobalsR RR(R RRR((RRts"