ó ŸçƒQc@s“ddlmZddlmZddlmZmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZd„Zd„Zdd„Z ied6e d 6ed 6e d 6e d 6e d 6e d6Z!d„Z"d„Z#d„Z$e%d„Z&de%d„Z'e%d„Z(d„Z)de*d„Z+d„Z,de%de*e%dd„Z-d„Z.d„Z/d„Z0e0Z1e*d„Z2de*d„Ze%d„Z3d „Z4d!„Z5d"„Z6d#„Z7d$„Zd%„Z8dS(&iÿÿÿÿ(t_(trelease(thextnullidNcCs4tjtj|ƒƒ}tjj|ƒr0tp3tS(N(tutilt expandpatht urllocalpathtostpathtisfilet bundlerepot localrepo(R((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt_localsc s3|jƒ}|\}}| rF| rFˆp/dˆr?ˆdpBdfSˆrXtˆƒp[g‰|jdƒs¦|r‹tjtdƒƒ‚nˆj|ƒˆˆdfS|jƒ‰‡‡‡fd†}x6|D].}||ƒsÎt j tdƒ|ƒ‚qÎqÎW|r%||ƒs%ˆj|ƒq%nˆˆdfS(Nit branchmaps"remote branch lookup not supportedcsu|dkr<ˆs*tjtdƒƒ‚nˆjjƒ}n|ˆkrmˆjd„tˆ|ƒDƒƒtStSdS(Nt.sdirstate branch not accessiblecss|]}tj|ƒVqdS(N(tnodeR(t.0tr((s0/sys/lib/python2.7/site-packages/mercurial/hg.pys *s( RtAbortRtdirstatetbranchtextendtreversedtTruetFalse(R(R tlrepotrevs(s0/sys/lib/python2.7/site-packages/mercurial/hg.pytprimary$s  !sunknown branch '%s'( tpeertNonetlisttcapableRRRtappendR terrortRepoLookupError(RtothertbranchesRRt hashbranchRR((R RRs0/sys/lib/python2.7/site-packages/mercurial/hg.pyt addbranchrevss&         cCsOtj|ƒ}d}|jr3|j}d|_nt|ƒ||pHgffS(s5parse url#branch, returning (url, (branch, branches))N(RturlRtfragmenttstr(RR$tuR((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytparseurl7s    tbundletuniontfilethttpthttpstsshs static-httpcCs^tj|ƒ}|jpd}tj|ƒp4td}y||ƒSWntk rY|SXdS(NR.(RR'tschemetschemestgett TypeError(RR*R2tthing((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt _peerlookupKs cCsHt|tƒr>yt|ƒj|ƒSWq>tk r:tSXn|jƒS(s$return true if repo or path is local(t isinstanceR)R7tislocaltAttributeErrorRtlocal(trepo((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyR9Ts  cCs9t|ƒr%tjtj|ƒdƒStj||ƒSdS(s0open path with open if local, url.open if remotetrbN(R9Rt posixfileRR'topen(tuiR((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytopenpath]s cCsvt|ƒj|||ƒ}t|d|ƒ}xBtjƒD]4\}}t|ddƒ}|r:|||ƒq:q:W|S(s1return a repository object for the specified pathR@t reposetupN(R7tinstancetgetattrt extensionsR(R@Rtcreatetobjtnametmodulethook((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt _peerorrepodstcCsYt|||ƒ}|jƒ}|sLtjtdƒ|pB|jƒƒ‚n|jdƒS(s1return a repository object for the specified pathsrepository '%s' is not localtvisible(RKR;RRRR'tfiltered(R@RRFRR<((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt repositoryns  cCs%t||ƒ}t|||ƒjƒS(s/return a repository peer for the specified path(tremoteuiRKR(tuiorrepotoptsRRFtrui((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRwscCs.tjjtjjtj|ƒjp'dƒƒS(s4return default destination of clone if none is givenRL(RRtbasenametnormpathRR'(tsource((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt defaultdest|scCsôt|ƒs$tjtdƒƒ‚n|s9t|ƒ}n|j|ƒ}t|tƒr¥|j|ƒ}t|ƒ\}}t ||ƒ}t |||dƒ\}}n"|j ƒ}|j ƒ}}d}|j} tjj|ƒ} tjj| dƒ} tjj| ƒr!tjtdƒƒ‚ntjj| ƒsCtj| ƒntj| dtƒd} y|jjdƒ} Wn+tk rŸ} | jtjkr ‚q nX| d7} tjtjj| dƒ| ƒtjtjj| dƒ| ƒt || ƒ}|jjd d ƒ}|rU|jd d d tƒ}|j dƒ|j d|ƒ|j!ƒn|rð|jj"tdƒƒ|tk r†|}nxW|d dfD]F}|dkr®q–ny|j#|ƒ}PWq–t$j%k rÛq–q–Xq–Wt&||ƒndS(screate a shared repositorys!can only share local repositoriess.hgsdestination already existst notindexedRLtrequiressshared t sharedpathtpathstdefaultthgrctwttexts[paths] s default = %s supdating working directory ttipN('R9RRRRWRR8R)R+ROR&RR;R'RZRRtrealpathtjointexiststisdirtmkdirtmakedirRtopenertreadtIOErrorterrnotENOENTt writefileR@tconfigtwritetclosetstatustlookupR!R"t_update(R@RVtdesttupdatet origsourceR$tsrcrepotrevtcheckoutRZtroottroothgt requirementstinstRR\tfpttesttuprev((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytshare€sd           c Csd }y^d }d}|jjddtƒ}x|jjƒD]ó}|r^|jdƒr^q=ntjj |j |ƒ}tjj ||ƒ} tjj | ƒ} | rÆtjj | ƒ rÆtj | ƒntjj |ƒr=| jdƒrtjtjj | dƒƒ}ntj|| |ƒ\}} || 7}q=q=W|rN|jd|ƒn|jd|ƒ|SWnt|ƒ‚nXd S( sGcopy files from store of srcrepo in destpath returns destlock itphasestpublisht phaserootstdatatlockslinked %d files scopied %d files N(RR@t configboolRtstoretcopylisttendswithRRRbRZtdirnameRcReR…Rt copyfilestdebugR( R@Rvtdestpathtdestlockthardlinktnumt srcpublishingtftsrctdsttdstbasetn((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt copystoreÃs2! c 'Cs„t|tƒrH|j|ƒ} t| |ƒ\}}t|||ƒ} n.|jƒ} d(|p`gf}| jƒ} }t| | ||ƒ\}} |d(krÃt|ƒ}|j t dƒ|ƒn|j|ƒ}t j |ƒ}t j |ƒ}|st j t dƒƒ‚ntjj|ƒr|tjj|ƒsNt j t dƒ|ƒ‚q|tj|ƒr|t j t dƒ|ƒ‚q|nd(} } }| jƒ}z¡| }t| ƒrÉtjjt j | ƒƒ}nt|ƒrÞ|}nt}|r#|jƒr#t|ƒr#tj|ƒ r#| o| }n|r_y|jdtƒ} Wq_tjk r[t}q_Xn|rý|jddtdd ƒtjjtjj |d ƒƒ}tjj|ƒsÁtj!|ƒn|}y|}t j"|d tƒWnJt#k r0}|j$t$j%kr*d(}t j t dƒ|ƒ‚n‚nXt&|||ƒ} tjj |d ƒ}|j'd ƒ}tjj |dƒ}tjj|ƒrÃtjj|ƒs°tj!|ƒnt j(||ƒnt|||ƒ}|jddd dt)j*t)j+ƒƒn0y"t|p |||dtƒ}WnJt#k rk}|j$t$j%kred(}t j t dƒ|ƒ‚n‚nXd(}|rÎ| j,dƒsŸt j t dƒƒ‚ng|D]}| j-|ƒ^q¦}|d} n|jƒrü|jƒj.| d|d|ƒn1|r|j/|d|ƒnt j t dƒƒ‚d(}|jƒ}|rÓ| j,dƒrÓ| j0dƒ}|j1}xN|j2ƒD]@\}}y|j-|ƒ} | ||||$ƒ||j1kr)t?j@||ƒq)q,n| |fSWd(tA| | ƒ|d(k rftBjC|tƒn| d(k r| j8ƒnXd(S()sIMake a copy of an existing repository. Create a copy of an existing repository in a new directory. The source and destination are URLs, as passed to the repository function. Returns a pair of repository peers, the source and newly created destination. The location of the source is added to the new repository's .hg/hgrc file, as the default to be used for future pulls and pushes. If an exception is raised, the partly cloned/updated destination repository will be deleted. Arguments: source: repository object or URL dest: URL of destination repository to create (defaults to base name of source repository) pull: always pull from source repository, even in local case stream: stream raw data uncompressed from repository (fast over LAN, slow over WAN) rev: revision to clone up to (implies pull=True) update: update working directory after clone completes, if destination is local repository (True means update to default rev, anything else is treated as a revision) branch: branches to clone sdestination directory: %s s#empty destination path is not validsdestination '%s' already existssdestination '%s' is not emptytwaitt preoutgoingtthrowRVtclones.hgRXtcachescache/branchheadst branchheadstoutgoingRRFRqsXsrc repository does not support revision lookup and so doesn't support clone by revisionitheadststreamRs)clone from remote to remote not supportedtpushkeyt bookmarksRLR]R^R_s[paths] s default = %s R[R\t@supdating to bookmark @ s$updating to bookmark @ on branch %s R`supdating to branch %s N(DR8R)RR+RRR'R&RWRpRRRRRRRcRdtlistdirR;R9tabspathRtcancopyRt hassecretR…R!t LockErrorRJRRaRbReRftOSErrorRjtEEXISTR—tsjointcopyfileRRRRRqR›tpushtlistkeyst _bookmarkst iteritemsR"RnR¡RgtpasswdRoR@t setconfigRtKeyErrort branchtipRrR¢t setcurrentRtshutiltrmtree('R@tpeeroptsRVRstpullRwRtR RRutsrcpeerRxtsrclockRŽtcleandirRvR¥tcopythgdirRR|t dstcachedirtsrcbranchcachetdstbranchcachetdestpeerRRtdestrepoR=tmarkstkR–tmR}R*t defaulturlRRptbn((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyR›äs"%        ! " "  "  #              cCs|jjtdƒ|ƒdS(NsI%d files updated, %d files merged, %d files removed, %d files unresolved (R@RpR(R<tstats((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt _showstatsÁscCstj||t|dƒS(s Update the working directory to node. When overwrite is set, changes are clobbered, merged else returns stats (see pydoc mercurial.merge.applyupdates)N(tmergemodRtRR(R<Rt overwrite((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt updaterepoÅscCsPt||tƒ}t||ƒ|drB|jjtdƒƒn|ddkS(s<update the working directory to node, merging linear changesis1use 'hg resolve' to retry unresolved file merges i(RÍRRÊR@RpR(R<RRÉ((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRtÍs   cCs6t||tƒ}|r(t||ƒn|ddkS(sAforcibly switch the working directory to node, clobbering changesii(RÍRRÊ(R<Rt show_statsRÉ((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytcleanØscCsxtj||t|tƒ}t||ƒ|drK|jjtdƒƒn|rj|jjtdƒƒn|ddkS(sWBranch merge with node, resolving changes. Return true if any unresolved conflicts.isPuse 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon s'(branch merge, don't forget to commit) i(RËRtRRRÊR@RpR(R<RtforcetremindRÉ((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytmergeßs  cCsCt|j|ƒ|jdƒƒ\}}t|||ƒ}|jtdƒtj|ƒƒt||||jdƒƒ\} } | r¨g| D]} |j | ƒ^qŠ} nt j |||| |d|dƒ\}} } zV| sú|jtdƒƒ|ƒSt j ||||ƒ}||| |ƒ|jƒWd| ƒX|ƒdS( sÐ Helper for incoming / gincoming. displaychlist gets called with (remoterepo, incomingchangesetlist, displayer) parameters, and is supposed to contain only code that can't be unified. Rscomparing with %s RwR,RÐsno changes found Ni(R+RR4RRpRRt hidepasswordR&RqR tgetremotechangestcmdutiltshow_changesetRo(t displaychlisttsubreporecurseR@R<RVRRtbufferedR$R#RRxRwtchlistt cleanupfnt displayer((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt _incomingës$' $% cs@‡‡‡‡fd†}‡fd†}t||ˆˆˆˆƒS(Ncsmd}ˆjdƒriˆd}xGt|jƒD]3}|j|ƒ}t||jˆˆˆƒƒ}q/Wn|S(Nitsubrepos(R4Rtsortedtsubstatetsubtmintincoming(trettctxtsubpathRá(RRR<RVR@(s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRØs %csÕtjˆƒ}ˆjdƒr+|jƒnd}x|D]•}|dk rZ||krZPng|jj|ƒD]}|tkrm|^qm}ˆjdƒr²t|ƒdkr²q8n|d7}|j ||ƒq8WdS(Nt newest_firstit no_mergesii( RÕtloglimitR4treverseRt changelogtparentsRtlentshow(R#RÚRÜtlimittcountR–tpRì(RR(s0/sys/lib/python2.7/site-packages/mercurial/hg.pytdisplays  1! (RÝ(R@R<RVRRRØRò((RRR<RVR@s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRã s  c Cs#|j|pd|pdƒ}t||jdƒƒ\}}|jtdƒtj|ƒƒt||||jdƒƒ\}}|r·gtj ||ƒD]}|j |ƒ^q™}nt |||ƒ}t j |jƒ||d|jdƒƒ} | j} | stj|j|| jƒdS| S(Ns default-pushR\Rscomparing with %s RwRÐ(RR+R4RpRRRÓR&tscmutiltrevrangeRqRt discoverytfindcommonoutgoingt unfilteredtmissingtnochangesfoundR@texcludedR( R@R<RsRRR$RRxRwR#Ržto((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt _outgoing&s $1 c s;‡‡‡‡fd†}tjˆƒ}tˆˆˆˆƒ}|dkrO|ƒSˆjdƒrk|jƒntjˆˆˆƒ}d}x|D]•} |dk r¯||kr¯Pngˆjj| ƒD]} | t krÂ| ^qÂ} ˆjdƒrt | ƒdkrqn|d7}|j ˆ| ƒqW|j ƒ|ƒdS(Ncsmd}ˆjdƒriˆd}xGt|jƒD]3}|j|ƒ}t||jˆˆˆƒƒ}q/Wn|S(NiRÞ(R4RRßRàRáRâRž(RäRåRæRá(RsRRR<R@(s0/sys/lib/python2.7/site-packages/mercurial/hg.pytrecurse8s %RçiRèii( RÕRéRüRR4RêRÖRëRìRRíRîRo( R@R<RsRRRýRïRûRÜRðR–RñRì((RsRRR<R@s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRž7s(    1!  cCs#tj||tt|ƒddkS(s<revert changes to revision in node without updating dirstateii(RËRtRR(R<Rtchoose((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytrevertVscCs tj|ƒS(s&verify the consistency of a repository(t verifymodtverify(R<((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRZsc Cs4tj|dƒr-|jjƒ}|j}n |jƒ}xKd D]C}|j|ƒpd|jd|ƒ}|r@|jd||ƒq@q@W|jddƒ}|rµ|jdd|ƒnxAd D]9}x0|j|ƒD]\}}|j|||ƒqÒWq¼W|jd d ƒ}|r0|jd d tj |ƒƒn|S(s*build a remote ui from ui or repo and optstbaseuiR1t remotecmdR@R,t mainreporoottauththostfingerprintst http_proxytwebtcacerts(R1R(RRR( Rt safehasattrRR½R@R4RmR²t configitemsR( R“RRR”RûtvRtsecttkeytval((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRP^s$   ! (9ti18nRR…RRRRR R t unionrepothttppeertsshpeertstatichttprepoR¢RRER!RóRR'RÕRõRÒRËRRRjRR¶R R&RR+R3R7R9RARRKRORRWRR€R—R›RÊRÍRtRrRÏRÝRãRüRžRÿRP(((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt sVHl  $       C ! Ü     !