o ö]Lb“ã@s ddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddlmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z"ddl#m$Z$m%Z%m&Z&m'Z'da(ej)Z)ej*Z*ej+Z+e j,Z,dd „Z-d d „Z.Gd d „d ej/ƒZ0dd„Z1dd„Z2dd„Z3dd„Z4ddddœZ5dd„Z6d(dd„Z7dd„Z8Gdd „d e9ƒZ:Gd!d"„d"e:ƒZ;Gd#d$„d$e:ƒZdS))é)Úabsolute_importNé)Ú_)ÚbinÚhexÚshort)ÚcmdutilÚencodingÚerrorÚexchangeÚ logcmdutilÚmatchÚmergeÚpathutilÚphasesÚpycompatÚscmutilÚ subrepoutilÚutilÚvfs)ÚdateutilÚhashutilÚprocutilÚurlutilcCs6t t |¡¡}t |¡}|jst t |j¡¡}|S)zU get a path or url and if it is a path expand it and return an absolute path ) rÚ urllocalpathrÚ expandpathÚurlÚschemeÚnormpathÚabspathÚpath)r Ú expandedpathÚu©r#ú3/usr/lib/python3/dist-packages/mercurial/subrepo.pyÚ_expandedabspath8s  r%cCstt t|ƒ¡ ¡ƒdd…S)zEget a unique filename for the store hash cache of a remote repositoryré )rrÚsha1r%Údigest)Ú remotepathr#r#r$Ú_getstorehashcachenameCsr*c@seZdZdZdd„ZdS)Ú SubrepoAbortzEException class used to avoid handling a subrepo error more than oncecOs:| dd¡|_| dd¡|_tjj|g|¢Ri|¤ŽdS)NÚsubrepoÚcause)Úpopr,r-r ÚAbortÚ__init__)ÚselfÚargsÚkwr#r#r$r0KszSubrepoAbort.__init__N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r0r#r#r#r$r+Hs r+cs‡fdd„}|S)Nc s†zˆ|g|¢Ri|¤Ž}W|Sty}z|‚d}~wtjyB}zt|ƒ}|jdtdƒ|}t||j|t ¡d‚d}~ww)Nó s(in subrepository "%s"))Úhintr,r-) r+r r/Ú subrelpathÚmessagerr9ÚsysÚexc_info)r1r2ÚkargsÚresÚexr,Úerrormsg©Úfuncr#r$ÚdecoratedmethodRs ô€ÿÿ€úz-annotatesubrepoerror..decoratedmethodr#)rCrDr#rBr$ÚannotatesubrepoerrorQs rEcCs>|rtdƒt|ƒ||f}n tdƒt|ƒ||f}| |d¡S)Ns‰ subrepository sources for %s differ you can use (l)ocal source (%s) or (r)emote source (%s). what do you want to do?$$ &Local $$ &Remotes¢ subrepository sources for %s differ (in checked out version) you can use (l)ocal source (%s) or (r)emote source (%s). what do you want to do?$$ &Local $$ &Remoter)rr:Ú promptchoice)ÚuiÚsubÚdirtyÚlocalÚremoteÚmsgr#r#r$Ú _updatepromptfsÿ ûÿ ú rMc Cs”| ¡D]C\}}}t|ƒD]\}}| ¡|kr||=nq | |¡ ¡dkr'q|D]}| ¡dkrF| tdƒ| |¡¡| | ||¡¡q)qdS)Ns.hgóhgrcs5warning: removing potentially hostile 'hgrc' in '%s' ) ÚwalkÚ enumerateÚlowerÚbasenameÚwarnrÚjoinÚunlinkÚreljoin) rGrÚignoreÚdirnameÚdirsÚnamesÚiÚdÚfr#r#r$Ú _sanitizeys* þ ÿüÿ€÷ùr^cCsd| d¡sd|vst |¡|krt tdƒ|¡‚t |j¡|ƒ|j   |¡r0t tdƒ|¡‚dS)Nó~ó$ó+subrepo path contains illegal component: %ss$subrepo '%s' traverses symbolic link) Ú startswithrrr r/rrÚ pathauditorÚrootÚwvfsÚislink)Úrepor r#r#r$Ú_auditsubrepopaths  ÿ ÿrhTF)óhgógitósvncCsz| ddd¡stjtdƒtdƒd‚t |d¡}| dd||¡s.tjtd ƒ|tdƒd‚|tvr;t td ƒ|¡‚dS) NósubrepossallowedTssubrepos not enableds)see 'hg help config.subrepos' for details©r9Fs %s:alloweds%s subrepos not allowedsunknown subrepo type %s)Ú configboolr r/rÚSUBREPO_ALLOWED_DEFAULTSÚgetÚtypes)rGÚkindÚdefaultr#r#r$Ú _checktype sþ  þÿrtcCsvddlm}|a| ¡}t||ƒ|j|}t|j|dƒ|r,|d| |¡|df}t|d|||dd…|ƒS)z>return instance of the right subrepo class for subrepo in pathr©ÚhgérN) ÚrvrgrhÚsubstatertrGÚsubrevrq)Úctxr Ú allowwdirÚ allowcreateÚhrgÚstater#r#r$r,´s   r,cCsnddlm}|a| ¡}t||ƒ|j|}t|j|dƒd}|ddkr(d}t|d|||d|fdƒS) z=return an empty subrepo in pctx for the extant subrepo in ctxrrurwóris(0000000000000000000000000000000000000000rT)rxrvrgrhryrtrGrq)r{r Úpctxr~rgrrzr#r#r$Ú nullsubrepoÈs    r‚c@sBeZdZdd„Zdd„Zdd„ZdLdd „ZdLd d „ZdMd d„Zdd„Z dd„Z dd„Z dd„Z dd„Z dNdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„ZdOd3d4„Zd5d6„ZdPd8d9„Zd:d;„Zdd?„Z d@dA„Z!dBdC„Z"dDdE„Z#dNdFdG„Z$e%dHdI„ƒZ&e%dJdK„ƒZ'd S)QÚabstractsubrepocCs| ¡j|_||_||_dS)zæInitialize abstractsubrepo part ``ctx`` is the context referring this subrepository in the parent repository. ``path`` is the path to this subrepository as seen from innermost repository. N)rgrGÚ_ctxÚ_path)r1r{r r#r#r$r0ás  zabstractsubrepo.__init__cCódS)zÐAdd the hgwebdir entries for this subrepo, and any of its subrepos. ``serverpath`` is the path component of the URL for this repo. ``webconf`` is the dictionary of hgwebdir entries. Nr#©r1Ú serverpathÚwebconfr#r#r$Ú addwebdirpathîszabstractsubrepo.addwebdirpathcCr†)z‡ returns true if the repository has not changed since it was last cloned from or pushed to a given repository. Fr#©r1r r#r#r$Ú storeclean÷ózabstractsubrepo.storecleanFcCót‚)a returns true if the dirstate of the subrepo is dirty or does not match current stored state. If ignoreupdate is true, only check whether the subrepo has uncommitted changes in its dirstate. If missing is true, check for deleted files. ©ÚNotImplementedError©r1Ú ignoreupdateÚmissingr#r#r$rIþózabstractsubrepo.dirtycCs"|j||drtdƒt|ƒSdS)z·return reason string if it is ``dirty()`` Returned string should have enough information for the message of exception. This returns None, otherwise. ©r’r“s)uncommitted changes in subrepository "%s"N)rIrr:r‘r#r#r$Ú dirtyreasons ÿÿzabstractsubrepo.dirtyreasonNcCs$|j|dd}|rtj||d‚dS)z+raise Abort if subrepository is ``dirty()``Tr•rmN)r–r r/)r1r’r9r–r#r#r$Ú bailifchangedsÿzabstractsubrepo.bailifchangedcCrŽ)zpcurrent working directory base state, disregarding .hgsubstate state and working directory modificationsr©r1r#r#r$Ú basestateszabstractsubrepo.basestatecCr†)z7check if path is a subrepository within this repositoryFr#r‹r#r#r$Ú checknestedózabstractsubrepo.checknestedcCrŽ)z¨commit the current changes to the subrepo with the given log message. Use given user and date if possible. Return the new state of the subrepo. r)r1ÚtextÚuserÚdater#r#r$Úcommit"rzabstractsubrepo.commitcCstjS)z6returns phase of specified state in the subrepository.)rÚpublic©r1rr#r#r$Úphase)szabstractsubrepo.phasecCrŽ)zTremove the subrepo (should verify the dirstate is not dirty first) rr˜r#r#r$Úremove-rzabstractsubrepo.removecCrŽ)zTrun whatever commands are needed to put the subrepo into this state r)r1rÚ overwriter#r#r$rp4szabstractsubrepo.getcCrŽ)z/merge currently-saved state with the new state.rr¡r#r#r$r:r›zabstractsubrepo.mergecCrŽ)zhperform whatever action is analogous to 'hg push' This may be a no-op on some systems. r©r1Úoptsr#r#r$Úpush>rzabstractsubrepo.pushcKsgS©Nr#©r1rGr ÚprefixÚuipathfnÚ explicitonlyr¦r#r#r$ÚaddEózabstractsubrepo.addcCs|j d|tdƒf¡dS)Ns%s: %ssaddremove is not supportedr©rGrSr)r1Úmatcherrªr«r¦r#r#r$Ú addremoveHszabstractsubrepo.addremovecKr†©Nrr#)r1r ÚfmÚ fntemplaterªr¦r#r#r$ÚcatLr®zabstractsubrepo.catc Kst ggggggg¡Sr¨)rÚstatus)r1Úrev2r¦r#r#r$r¶Oszabstractsubrepo.statuscKsdSr¨r#)r1rGÚdiffoptsÚnode2r rªr¦r#r#r$ÚdiffRr®zabstractsubrepo.diffcCr†r²r#)r1rGÚdestr¦r#r#r$ÚoutgoingUr®zabstractsubrepo.outgoingcCr†r²r#)r1rGÚsourcer¦r#r#r$ÚincomingXr®zabstractsubrepo.incomingcCrŽ)zreturn filename iteratorrr˜r#r#r$Úfiles[r›zabstractsubrepo.filescCrŽ)z9return file data, optionally passed through repo decodersr©r1ÚnameÚdecoder#r#r$Úfiledata_r›zabstractsubrepo.filedatacCr†)zreturn file flagsr€r#)r1rÁr#r#r$Ú fileflagscr›zabstractsubrepo.fileflagscCs tj|dS)z,Resolve the fileset expression for this repo©Úbadfn)ÚmatchmodÚnever)r1ÚcwdÚexprrÆr#r#r$Ú matchfilesetgs zabstractsubrepo.matchfilesetcCr†)z)handle the files command for this subreporr#)r1rGÚmr«r³ÚfmtÚsubreposr#r#r$Ú printfileskr›zabstractsubrepo.printfilesTc s¼ˆdur‡fdd„| ¡Dƒ}n| ¡}t|ƒ}t|ƒ}|jjtdƒ|tdƒ|d}| d¡|D]%} | | ¡} d| vr?dp@d } d | v} | || | | |  | |¡¡|  ¡q2|  ¡|S) Ncóg|]}ˆ|ƒr|‘qSr#r#©Ú.0r]©r r#r$Ú qóz+abstractsubrepo.archive..óarchiving (%s)ófiles)ÚunitÚtotalróxiíi¤ól) r¿Úlenr:rGÚ makeprogressrÚupdaterÄÚaddfilerÃÚ incrementÚcomplete) r1Úarchiverrªr rÂr¿rÙÚrelpathÚprogressrÁÚflagsÚmodeÚsymlinkr#rÓr$Úarchiveos&ÿ  ÿ zabstractsubrepo.archivecCr†)zv walk recursively through the directory tree, finding all files matched by the match function Nr#)r1r r#r#r$rO…ózabstractsubrepo.walkcCsggfSr¨r#©r1r rªr«ÚdryrunÚ interactiver#r#r$Úforget‹ózabstractsubrepo.forgetc Cs| tdƒ|j¡dS)zÒremove the matched files from the subrepository and the filesystem, possibly by force and/or after the file has been removed from the filesystem. Return 0 on success, 1 on any warning. s)warning: removefiles not implemented (%s)r)Úappendrr…© r1r°rªr«ÚafterÚforcerÎrëÚwarningsr#r#r$Ú removefilesŽs ÿzabstractsubrepo.removefilescOs$|j tdƒ|d|df¡gS)Ns)%s: reverting %s subrepos is unsupported rrwr¯©r1ryÚpatsr¦r#r#r$Úrevert¢s ÿÿzabstractsubrepo.revertcCs|Sr¨r#©r1Úrevidr#r#r$Úshortid©r®zabstractsubrepo.shortidcCr†)zH convert this repository from shared to normal storage. Nr#r˜r#r#r$Úunshare¬rézabstractsubrepo.unsharecCr†)a1verify the revision of this repository that is held in `_state` is present and not hidden. Return 0 on success or warning, 1 on any error. In the case of ``onpush``, warnings or errors will raise an exception if the result of pushing would be a broken remote repository. rr#)r1Úonpushr#r#r$Úverify±r”zabstractsubrepo.verifycCst |j ¡j |j¡¡S)z@return vfs to access the working directory of this subrepository)Úvfsmodrr„rgrerTr…r˜r#r#r$re¹ózabstractsubrepo.wvfscCs|j t|j ¡ƒ|j¡S©zCreturn path to this subrepository as seen from outermost repository)rerVÚ reporelpathr„rgr…r˜r#r#r$Ú_relpath¾rÿzabstractsubrepo._relpath©FF)FN©Fr¨©NT)(r4r5r6r0rŠrŒrIr–r—r™ršrŸr¢r£rprr§r­r±rµr¶rºr¼r¾r¿rÃrÄrËrÏrèrOrírôr÷rúrûrýÚ propertycachererr#r#r#r$rƒàsN         rƒcsâeZdZ‡fdd„Zedd„ƒZdd„Zdd„Zd d „Ze d d „ƒZ d d„Z dd„Z dd„Z edd„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZedZd!d"„ƒZed[d$d%„ƒZd&d'„Zd(d)„Zed*d+„ƒZed,d-„ƒZed.d/„ƒZd0d1„Zed\d2d3„ƒZed4d5„ƒZed6d7„ƒZed8d9„ƒZed:d;„ƒZ edd?„Z"d@dA„Z#edBdC„ƒZ$ed]dDdE„ƒZ%dFdG„Z&edHdI„ƒZ'edJdK„ƒZ(edLdM„ƒZ)dNdO„Z*dPdQ„Z+edRdS„ƒZ,d\dTdU„Z-e dVdW„ƒZ.e dXdY„ƒZ/‡Z0S)^Ú hgsubrepoc sHtt|ƒ ||¡||_| ¡}| t |¡¡}|o"|j  d|¡ }t j   |¡}t j   t j   t |¡¡¡} | |krCt tdƒ|¡‚tj|j||d|_t j   |jj¡t j   |¡krft d||jjf¡‚|| ¡urr|j ¡|_|jj|_dD]\} } |j | | ¡} | r|j | | | d¡qy|j ddd d¡| ||d |¡dS) Ns%s/.hgra©Úcreates9failed to reject unsafe subrepo path: %s (expanded to %s)))óuiscommitsubreposósubrepor s_usedassubreposTruer)Úsuperrr0Ú_statergÚwjoinrÚ localpathreÚexistsÚosr ÚnormcaseÚrealpathrr r/rrvÚ repositoryÚbaseuiÚ_repordÚProgrammingErrorÚ unfilteredrGÚconfigÚ setconfigÚ _initrepo) r1r{r rr}Úrrdr Ú norm_rootÚ real_rootÚsÚkÚv©Ú __class__r#r$r0Ås8  ÿ ÿÿ    €zhgsubrepo.__init__cCst |jt|ƒ|¡dSr¨)rrŠrr:r‡r#r#r$rŠçszhgsubrepo.addwebdirpathcCs8|j ¡ | |¡WdƒS1swYdSr¨)rÚlockÚ _storecleanr‹r#r#r$rŒës $ÿzhgsubrepo.storecleancCsJd}| |¡}| |¡D] }|t|dƒkrd}nq |r#t|dƒdu}|S)NTF)Ú_calcstorehashÚ_readstorehashcacheÚnext)r1r ÚcleanÚ itercacheÚfilehashr#r#r$r%ïs þzhgsubrepo._storecleanccsPd}dt|ƒV|jj}|D]}tt | |¡¡ ¡ƒ}d||fVqdS)z˜calculate a unique "store hash" This method is used to to detect when there are changes that may require a push to a given remote path.)s bookmarkssstore/phaserootssstore/00changelog.is# %s ó%s = %s N)r%rrrrr'Útryreadr()r1r)ÚfilelistrÚrelnamer+r#r#r$r&üs€þzhgsubrepo._calcstorehashcCst |jj d¡¡S)Nscache/storehash)rþrrrTr˜r#r#r$Ú_cachestorehashvfs szhgsubrepo._cachestorehashvfscCst|ƒ}|j |d¡S)z7read the store hash cache for a given remote repositoryór)r*r0Ú tryreadlines)r1r)Ú cachefiler#r#r$r' szhgsubrepo._readstorehashcachecCs^t|ƒ}|j ¡t| |¡ƒ}|j}|j||dddWdƒdS1s(wYdS)zÄcache the current store hash Each remote repo requires its own store hash cache, because a subrepo store may be "clean" versus a given remote repo, but not versus another swbT)ræÚ notindexedN)r*rr$Úlistr&r0Ú writelines)r1r)r3Ú storehashrr#r#r$Ú_cachestorehashs  "ýzhgsubrepo._cachestorehashcCs,|j ¡dur |jdS|jd}|j|S)zBfetch the context for this subrepo revision, possibly a workingctxNr)r„Úrevrr )r1r9r#r#r$Ú_getctxs   zhgsubrepo._getctxcs†|ˆj_|ˆj_|rAdg‰‡‡fdd„}tˆjdd}tˆjddd}|d|ƒ||kr1|d|ƒˆjj d t d  ˆ¡¡¡dSdS) Ns[paths] cs0|rˆ d||f¡ˆj d||d¡dSdS)Nr,spathsr )rïrGr)ÚkeyÚvalue©Úlinesr1r#r$Ú addpathconfig.sþz*hgsubrepo._initrepo..addpathconfigF)ÚabortTsdefaults default-pushrNr€) rÚ _subparentÚ _subsourceÚ _abssourcerÚwriterÚ tonativeeolrT)r1Ú parentrepor½r r?ÚdefpathÚ defpushpathr#r=r$r&s   òzhgsubrepo._initrepocKstj||j||||fi|¤ŽSr¨)rr­rr©r#r#r$r­;s ÿÿz hgsubrepo.addcCs&t |¡}d|d<t |j||||¡S)NTrl)Úcopyrr±r)r1rÌrªr«r¦r#r#r$r±As zhgsubrepo.addremovecKs6|jd}|j|}tj|j|j|||||fi|¤ŽSr²)r rrrµrG)r1r r³r´rªr¦r9r{r#r#r$rµJs  ÿÿz hgsubrepo.catc Ksz|jd}|j|}|j|}|jj||fi|¤ŽWStjyG}z|j tdƒ|t|ƒf¡t  ggggggg¡WYd}~Sd}~ww)Nró*warning: error "%s" in subrepository "%s" ) r rr¶r ÚRepoLookupErrorrGrSrr:r)r1r·r¦Úrev1Úctx1Úctx2Úinstr#r#r$r¶Rs    ÿÿ"€ûzhgsubrepo.statusc Ksšz*t|jdƒ}|durt|ƒ}tj||j||j||j||f|ddœ|¤ŽWdStjyL}z|j t dƒ|t |ƒf¡WYd}~dSd}~ww)NrT)rªÚ listsubreposrJ) rr r Údiffordiffstatrr rKrGrSrr:) r1rGr¸r¹r rªr¦Únode1rOr#r#r$rº`s2úø ÷  ÿÿ€ÿzhgsubrepo.diffNTc s¼| |jd¡| ¡}ˆr‡fdd„|Dƒ}|jd}|j|}t |j| ¡t |j|¡fg¡t  |||ˆ¡}|j D]} t || dƒ} t   | ˆ¡} || d} ||   || | |¡7}q=|S)N)ricrÐr#r#rÑrÓr#r$rÔ~rÕz%hgsubrepo.archive..rTó/)Ú_getr r¿rrÚ prefetchfilesr9Ú matchfilesrƒrèryr,rÇÚ subdirmatcher) r1rârªr rÂr¿r9r{rÙÚsubpathrÚsubmatchÚ subprefixr#rÓr$rèys   ÿ    zhgsubrepo.archiveFcCsH|jd}|dkr |s dS|jd}|| ¡ ¡kr|sdS|j|dS)Nrr€T)r“)r rÚp1rrI)r1r’r“rÚwr#r#r$rIŒs    zhgsubrepo.dirtycCs|jd ¡S©Nó.)rrr˜r#r#r$r™—ózhgsubrepo.basestatecCs|j |j |¡¡Sr¨)rÚ _checknestedrr‹r#r#r$rššózhgsubrepo.checknestedcCsV| d¡s |jd ¡S|j dt|ƒ¡|j |||¡}|s'|jd ¡St|ƒS)NTr^scommitting subrepo %s )rIrrrGÚdebugr:rŸ)r1rœrržÚnr#r#r$rŸs zhgsubrepo.commitcCs|j|pd ¡Sr])rr¢r¡r#r#r$r¢©szhgsubrepo.phasecCs0|j tdƒt|ƒ¡t |j|jjd¡dS)Nóremoving subrepo %s F)rGÚnoterr:rvr)rÚnullidr˜r#r#r$r£­szhgsubrepo.removecs |\}}}ˆjj}|ˆj ¡vrtˆjƒdks| ¡sdS|ˆj_tˆjƒ‰‡‡fdd„}tˆjƒdkrÚˆjj ¡| ¡rut   ˆ¡ruˆj   t dƒtˆƒˆf¡|ƒ}zt jˆjjj|ˆjjddd}W| ¡n| ¡w| ¡ˆ_nV| ¡r’ˆj  dd ¡} | r‡t | ¡} | ˆj  dd ¡d œ} ni} ˆj   t d ƒtˆƒt ˆ¡f¡|ƒ}zt jˆjjji|ˆjjd| d \} } W| ¡n| ¡w|  ¡ˆ_ˆj||ddˆ ˆ¡dSˆj   t dƒtˆƒt ˆ¡f¡ˆ ˆ¡} |ƒ}z t ˆj|¡W| ¡n| ¡w| rˆ ˆ¡dS)NrTcst ˆjiˆ¡Sr¨)rvÚpeerrr#©r1Úsrcurlr#r$ÚÁsz hgsubrepo._get..ssharing subrepo %s from %s F)rÞÚ bookmarkssshareópools poolnaming)rlsmodeócloning subrepo %s from %s )rÞÚ shareoptsrópulling subrepo %s from %s )rrArrÜÚsharedrBrCrÚrmtreervÚislocalrGr¶rr:ÚsharerrdÚcloserJrrrrÚ hidepasswordÚclonerr8rŒr Úpull)r1rr½ÚrevisionrrrFÚgetpeerrgrpÚpoolrnÚotherÚclonedÚcleansubr#rhr$rT´sˆ    ÿÿû   þÿÿ ú  óÿÿ  zhgsubrepo._getc Cs–| |¡}|\}}}|j}|j d|j¡|r7| ¡}||} |  ¡r7|j tdƒ|dd…|jf¡|}|rBt   ||¡dSt   ||¡dS)Nsgetting subrepo %s s,revision %s in subrepository "%s" is hidden rr&) rTrrGrbr…rÚhiddenrSrrÚ clean_updaterÞ) r1rr¤Úinrepor½rxrrrgÚurepor{r#r#r$rps"  ÿÿz hgsubrepo.getcs’ˆ ˆ¡ˆjd‰ˆjˆd‰ˆ ˆ¡‰‡‡‡‡‡fdd„}ˆjd}ˆ ¡rDˆˆkr?tˆjˆ| ¡ˆˆƒr=|ƒdSdS|ƒdS|ƒdS)Nr^rcsˆˆˆkr!ˆ ¡ˆ ¡kr!ˆj dtˆƒ¡t ˆjˆd¡dSˆˆkr1ˆj dtˆƒ¡dSˆj dtˆƒ¡tjˆdddS)Nsupdating subrepository "%s" rsskipping subrepository "%s" smerging subrepository "%s" F)Úremind)ÚbranchrGrbr:rvrÞrrr#©ÚancÚcurÚdstr1rr#r$Ú mergefunc*s ÿ ÿ ÿz"hgsubrepo.merge..mergefunc)rTrÚancestorrIrMrG)r1rrˆÚwctxr#r„r$r#s     ÿ  zhgsubrepo.mergec Cs| d¡}| d¡}| d¡}|jd}|j}t|ƒD]}| |¡ |¡dkr*dSqt|jdƒ}|sK| |¡rK|j  t dƒt |ƒt   |¡f¡dS|j  t d ƒt |ƒt   |¡f¡t |jd|i|¡} ztj|j| ||d } W|  ¡n|  ¡w| |¡| jS) Nóforces new_branchssshr^rFTs4no changes made to subrepo %s since last push to %s spushing subrepo %s to %s )Ú newbranch)rprryÚsortedrHr§rCrŒrGr¶rr:rrurvrgr rtr8Úcgresult) r1r¦ròrŒÚsshÚcÚsubsrÚdsturlr{r?r#r#r$r§Ds:     ÿ  ÿÿÿÿ zhgsubrepo.pushcCóTd|vsd|vrt |¡}| dd¡| dd¡t |j¡}tj||j|||dS©Nsrevsbranch)rX)rIr.rÚrepo_rel_or_abs_sourcerrvr¼)r1rGr»r¦rXr#r#r$r¼gó     zhgsubrepo.outgoingcCr“r”)rIr.rr•rrvr¾)r1rGr½r¦rXr#r#r$r¾pr–zhgsubrepo.incomingcCs |jd}|j|}| ¡ ¡Sr²)r rÚmanifestÚkeys)r1r9r{r#r#r$r¿ys   zhgsubrepo.filescCs2|jd}|j|| ¡}|r|j ||¡}|Sr²)r rÚdataÚ wwritedata)r1rÁrÂr9r™r#r#r$rÃs zhgsubrepo.filedatacCs|jd}|j|}| |¡Sr²)r rrå)r1rÁr9r{r#r#r$rĆs   zhgsubrepo.fileflagsc CsD|j ¡dur |jd}n |jd}|j|}t |||||||¡Sr²)r„r9rr rr¿) r1rGrÌr«r³rÍrÎr{r9r#r#r$rÏ‹s    zhgsubrepo.printfilesc CsØ|j ¡dur |jd}n |jd}|j|}|j|||dg}|jD]9}| |¡}z|j|||d} tj|| |d} |  | ¡Wq#t j y\|j   tdƒ|j t|ƒ|¡¡Yq#wt|ƒdkrg|dSt |¡S)NrrÅs#skipping missing subrepository: %s r)r„r9rr rËryrHrÇÚprefixdirmatcherrïr Ú LookupErrorrGr¶rrerVrrÜÚ unionmatcher) r1rÉrÊrÆr{r9ÚmatchersrXrHÚsmÚpmr#r#r$rË–s*     ÿÿÿ  zhgsubrepo.matchfilesetcCs|jd}| |¡Sr¨)rrO)r1r r{r#r#r$rO°s  zhgsubrepo.walkc Cstj|j|j|||d||dS)NT)rërì)rrírGrrêr#r#r$rí´søzhgsubrepo.forgetc Cst |j|j|||||||¡ Sr¨)rr£rGrrðr#r#r$rôÁs ÷zhgsubrepo.removefilescOsn|j tdƒ|d¡| d¡s'| ¡}d|d<|d|d<|j|i|¤Ž| d¡s5|j|dd dSdS) Nóreverting subrepo %s rÚ no_backupržrr9Údry_runT©r¤)rGr¶rrprIÚ filerevertrõr#r#r$r÷Ùs   ÿzhgsubrepo.revertcOsH|j|d}| d¡rdg}ng}tj|j|j|g|¢Ri|¤ŽdS)Nr9Úallsset:modified())rrprr÷rG)r1rör¦r{r#r#r$r¥ïs  $zhgsubrepo.filerevertcCó |dd…S)Nr&r#rør#r#r$rú÷ó zhgsubrepo.shortidcCsDddlm}|a|j ¡r|j tdƒ|j¡t |j|j¡dS)Nrrusunsharing subrepo '%s' ) rxrvrrprGr¶rrrû)r1r~r#r#r$rûús  zhgsubrepo.unsharecCs¶z1|jd}|j ¡|}| ¡r/tdƒ|jt|j ¡ƒf}|r&t   |¡‚|jj   d|¡WdSt j yZtdƒ|jt|j ¡ƒf}|rNt   |¡‚|jj   d|¡YdSw)Nrs%subrepo '%s' is hidden in revision %ss%s rs%subrepo '%s' not found in revision %s)r rrr~rrrr„Únoder r/rGrSrK)r1rür9r{rLr#r#r$rý s,  þ  þ ôzhgsubrepo.verifycCs|jjS)z.return own wvfs for efficiency and consistency)rrer˜r#r#r$re,szhgsubrepo.wvfscCs t|jƒSr)rrr˜r#r#r$r1s zhgsubrepo._relpathrrrr¨)1r4r5r6r0rErŠrŒr%r&rr0r'r8r:rr­r±rµr¶rºrèrIr™ršrŸr¢r£rTrprr§r¼r¾r¿rÃrÄrÏrËrOrírôr÷r¥rúrûrýrerÚ __classcell__r#r#r"r$rÄsŽ "                [   "           rcs¶eZdZ‡fdd„Zd#dd„Zedd„ƒZd d „Zd d „Zd d„Z dd„Z e d$dd„ƒZ dd„Z e dd„ƒZe dd„ƒZe d%dd„ƒZe dd„ƒZdd„Ze dd „ƒZd!d"„Z‡ZS)&Ú svnsubrepocsBtt|ƒ ||¡||_t d¡|_|jst t dƒ|j ¡‚dS)Nrks+'svn' executable not found for subrepo '%s') r r«r0r rÚfindexeÚ_exer r/rr…©r1r{r rr}r"r#r$r09s  ÿÿzsvnsubrepo.__init__r€Fc Cs$|jg}i}|j ¡stj|d<|ddvr| d¡| |¡|dur6|j |j   ¡j |j |¡}| |¡t tjƒ}| d¡}|rI||d<|d=d|d<tjt tj|¡fd tjtjtjt |¡d œ|¤Ž} ttj|  ¡ƒ\} } |  ¡} |sŽ| jr„t | p‚d | j¡‚| rŽ|j  | d ¡| | fS) NÚstdinr)óupdateócheckoutócommits--non-interactiveóLC_ALLsLANGóCs LC_MESSAGESéÿÿÿÿ)ÚbufsizeÚ close_fdsÚstdoutÚstderrÚenvsexited with code %dó )!r­rGrìÚ subprocessÚPIPErïÚextendrerVr„rgÚorigrootr…Údictr ÚenvironrpÚPopenrÚrapplyrÚ tonativestrÚclosefdsÚ tonativeenvÚmaprÚ fromnativeeolÚ communicateÚstripÚ returncoder r/rS) r1ÚcommandsÚfilenameÚfailokÚcmdÚextrakwr rºÚlc_allÚpr¸r¹r#r#r$Ú _svncommandBsN     ÿ    ÿúù  ÿzsvnsubrepo._svncommandcCsP|jddgdd\}}t d|¡}|st tdƒ¡‚t| d¡ƒt| d¡ƒfS)Nó --versionó--quiet)rÍs ^(\d+)\.(\d+)s cannot retrieve svn tool versionrrw)rÓÚreÚsearchr r/rÚintÚgroup)r1ÚoutputÚerrrÌr#r#r$Ú _svnversionps ÿ zsvnsubrepo._svnversioncCó|j d¡ S)Nó.svn©rerr˜r#r#r$Ú _svnmissingzr_zsvnsubrepo._svnmissingcCs€| ddg¡\}}tjj |¡}| d¡}d\}}|r1s€ þýz#svnsubrepo.files..rÁrô) rÓrärårærçrèrrérêrTÚ childNodesrïrù)r1rÚrëÚpathsrþrrrÁr#r#r$r¿(s þzsvnsubrepo.filescCs| dg|¡dS)Nscatr)rÓrÀr#r#r$rÃ9ózsvnsubrepo.filedata)r€Frr)r4r5r6r0rÓrrÜràrïrðrrErIr™rŸr£rprr§r¿rÃrªr#r#r"r$r«8s0  .  %        r«cs\eZdZ‡fdd„Zdd„Zedd„ƒZedd„ƒZdFd d „ZdFd d„Z dGdd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„ZedHd)d*„ƒZd+d,„ZedId-d.„ƒZed/d0„ƒZed1d2„ƒZed3d4„ƒZed5d6„ƒZed7d8„ƒZdJd:d;„Z edd?„ƒZ"ed@dA„ƒZ#edBdC„ƒZ$dDdE„Z%‡Z&S)KÚ gitsubrepocs>tt|ƒ ||¡||_| ¡ |¡|_| ¡|_| ¡dSr¨) r rr0r rgrÚ_abspathrAÚ _ensuregitr®r"r#r$r0>s   zgitsubrepo.__init__c Csfz d|_| dg¡\}}Wnwty„}zktdƒ}tdƒ}|jtjkr1t ||jt   |j ¡f¡‚t j rnz d|_| dg¡\}}Wn8tym}z |jtjkr[tjtdƒ|j|d‚t ||jt   |j ¡f¡‚d}~wwtjtdƒ|j|d‚WYd}~nd}~ww| |¡}|d kr˜|j td ƒ¡dS|d kr£t td ƒ¡‚|d kr±|j tdƒ¡dSdS)NrjrÔs(error executing git for subrepo '%s': %ss'check git is installed and in your PATHsgit.cmds1couldn't find 'git' or 'git.cmd' for subrepo '%s'rms"couldn't find git for subrepo '%s'óunknownscannot retrieve git version óaborts,git subrepo requires at least 1.6.0 or laterówarnings-git subrepo requires at least 1.6.0 or later )Ú_gitexecutableÚ _gitnodirrrÚerrnoÚENOENTr r/r…r Ú strtolocalÚstrerrorrÚ iswindowsÚ _checkversionrGrS)r1ÚoutrÛrþÚ genericerrorÚ notfoundhintÚe2Ú versionstatusr#r#r$r Es` ÿ ÿüú ÿÿ€õ þ ï€ö ÿÿzgitsubrepo._ensuregitcCsjt d|¡}|rt| d¡ƒt| d¡ƒt| d¡ƒfSt d|¡}|r3t| d¡ƒt| d¡ƒdfSdS)Ns ^git version (\d+)\.(\d+)\.(\d+)rrwés^git version (\d+)\.(\d+)rrµ)rÖr×rØrÙ)r,rÌr#r#r$Ú _gitversionrs ( zgitsubrepo._gitversioncCs2t |¡}|dkr dS|dkrdS|dkrdSdS)ašensure git version is new enough >>> _checkversion = gitsubrepo._checkversion >>> _checkversion(b'git version 1.6.0') 'ok' >>> _checkversion(b'git version 1.8.5') 'ok' >>> _checkversion(b'git version 1.4.0') 'abort' >>> _checkversion(b'git version 1.5.0') 'warning' >>> _checkversion(b'git version 1.9-rc0') 'ok' >>> _checkversion(b'git version 1.9.0.265.g81cdec2') 'ok' >>> _checkversion(b'git version 1.9.0.GIT') 'ok' >>> _checkversion(b'git version 12345') 'unknown' >>> _checkversion(b'no') 'unknown' rµr!)rrrr")rérr#sok)rr2)r,Úversionr#r#r$r+~s zgitsubrepo._checkversionNFcCs|j|||ddS)N)rºÚstreamr©Ú_gitdir©r1rÌrºr5r#r#r$Ú _gitcommand¢razgitsubrepo._gitcommandcCs|j||||jdS)N)rºr5rÉ)r%rr8r#r#r$r7¥s ÿzgitsubrepo._gitdirc Cs>|j d|jd |¡f¡|durtj ¡}d|d<d|vr#d|d<d}|jjr0t  t j d¡}|jj rDt |ƒrD|d d krD| d d ¡tjt tj|jg|¡d t tj|¡t |¡tjtj|d}|rj|jdfS|j ¡ ¡}| ¡|jd krš|jd krš|d }|dvrŒ||jfSt tdƒ||j|jf¡‚||jfS)zœCalls the git command The methods tries to call the git command. versions prior to 1.6.0 are not supported and very probably fail. s %s: git %s r8Nr´r³sGIT_ALLOW_PROTOCOLsfile:git:http:https:sshówródiffrs--colorrµ)r¶rÉrºr·r¸r¹)ócat-fileó symbolic-refsgit %s error %d in %s) rGrbrrTr rÁrIÚquietrÚopenrÚdevnullÚ _colormoderÜÚinsertr¼rÂrÃrrÄr$rÆrÅr½r¸ÚreadrÊÚwaitrËr r/r) r1rÌrºr5rÉÚerrpiperÒÚretdataÚcommandr#r#r$r%ªsH  ÿ ÷   ÿÿ zgitsubrepo._gitnodircCrÝ)Nó.gitrßr˜r#r#r$Ú _gitmissingàr_zgitsubrepo._gitmissingcCs| ddg¡S)Ns rev-parseóHEAD©r9r˜r#r#r$Ú _gitstateãr_zgitsubrepo._gitstatecCs| gd¢¡\}}|r d}|S)N)r=rJrÕr6)r1ÚcurrentrÛr#r#r$Ú_gitcurrentbranchæszgitsubrepo._gitcurrentbranchcCs>| ddd|g¡}| d¡d}| d¡tdƒ}||d…S)Nsremoteóshows-nr»rsURL: )r9ÚsplitÚindexrÜ)r1rKr,Úliner[r#r#r$Ú _gitremoteìs zgitsubrepo._gitremotecCs| dd|g¡\}}|dkS)Nr<s-err6)r1rxr,Úcoder#r#r$Ú_githavelocallyòszgitsubrepo._githavelocallycCs| d||g¡}||kS)Nó merge-baserK)r1Úr1Úr2Úbaser#r#r$Ú_gitisancestoröszgitsubrepo._gitisancestorcCs| gd¢¡dkS)N)óconfigs--booló core.bareótruerKr˜r#r#r$Ú _gitisbareúrzgitsubrepo._gitisbarecCs| gd¢¡dS)z This must be run before git diff-index. diff-index only looks at changes to file stat; this command looks at file contents and updates the stat.)s update-indexó-qs --refreshNrKr˜r#r#r$Ú_gitupdatestatýszgitsubrepo._gitupdatestatcCs‚i}i}| gd¢¡}| d¡D],}| d¡\}}| d¡s$| d¡s$q| d¡r/| d¡r/q|||<| |g¡ |¡q||fS)zcreturns 2 things: a map from git branch to revision a map from revision to branches)s for-each-refs--formats%(objectname) %(refname)r»r8s refs/heads/ó refs/remotes/s/HEAD)r9rPrbÚendswithÚ setdefaultrï)r1Ú branch2revÚ rev2branchr,rRrxÚrefr#r#r$Ú _gitbranchmaps ÿÿzgitsubrepo._gitbranchmapc Csri}|D]2}| d¡r q| dd¡d}| dd|g¡}|r6| dd|g¡}||d|| dd¡df<q|S)z4return map of remote branch to local tracking branchrarSrwr[sbranch.%s.remotesbranch.%s.mergesrefs/remotes/%s/%s)rbrPr9)r1ÚbranchesÚtrackingÚbÚbnamerKrfr#r#r$Ú _gittrackings þÿ€zgitsubrepo._gittrackingcCs<d|vr| d¡}|dkrd|d|…vr|S||_t|ƒS)Ns://ó:rµrS)ÚfindrBrC)r1r½Úcolonr#r#r$rC)s  zgitsubrepo._abssourcecCs¨| ¡r$t |¡| |¡}|j tdƒ|j|f¡| d||j g¡|  |¡r+dS|j tdƒ|j|  d¡f¡|  dg¡|  |¡sRt  tdƒ||jf¡‚dS)Nrmscloneroóoriginsfetchs1revision %s does not exist in subrepository "%s" )rIrrrCrGr¶rrr%rrUrSr9r r/)r1r½rxr#r#r$Ú_fetch2s,  ÿ ÿÿ  ÿÿÿzgitsubrepo._fetchcCs^| ¡r |jddkS| ¡rdS|s|jd| ¡krdS| ¡| gd¢¡\}}|dkS)Nrr€T©ó diff-indexrÕrJ)rIr r^rLr`r7)r1r’r“r,rTr#r#r$rIJszgitsubrepo.dirtycCs| ¡Sr¨)rLr˜r#r#r$r™Xrîzgitsubrepo.basestatecsÜ|\}‰}ˆs ˆ ¡dSˆ |ˆ¡ˆ ¡r.ˆ gd¢¡ˆ ¡ˆkr-ˆ gd¢¡dSnˆ ¡ˆkrFˆrDˆ ddg¡ˆ gd¢¡dSˆ ¡\}}‡‡fdd„‰‡‡‡fdd„}ˆ|vrd|ƒdS|ˆ}d} |D]} | d krzˆd gƒdS| sƒ|  d ¡sƒ| } ql| rˆ| gƒdSˆ | ¡¡} |d } | | vr©|D] } | | vr¨| } nqž| | vr¾|   d d ¡d } ˆd| | gƒdSˆ  || | | ¡ré| | ˆ  ¡kr׈| | gƒˆ dd| g¡t ˆj ˆjdƒdS|ƒdS)N)r[r\sfalse)óresets--hardrJrtrJcsDdg}ˆrˆ ddg¡| d¡ˆ ||¡tˆjˆjdƒdS)Nr±rtrJó-frH)r9rïr^rGre)r2rÏ)r¤r1r#r$Úcheckoutrs  z gitsubrepo.get..checkoutcs6ˆj tdƒˆj¡ˆj tdƒ¡ˆdˆgƒdS)Ns1checking out detached HEAD in subrepository "%s" s5check out a git branch if you intend to make changes r_)rGrSrrr#)rvrxr1r#r$Ú rawcheckout}sÿÿÿz#gitsubrepo.get..rawcheckoutsrefs/heads/masterrarrSr1s-bómerges--ffrH)r£rqr^r9rLrgrbrlr˜rPrZrNr^rGre)r1rr¤r½rrrdrerwrhÚfirstlocalbranchrjrirKrJr#)rvr¤rxr1r$rp[sf   þ     € þ zgitsubrepo.getcCsl| ¡rt tdƒ|j¡‚ddd|g}tj ¡}|r!|d|g7}|r+t  |d¡|d<|j ||d|  ¡S) Nósubrepo %s is missingr²s-ars--authors%Y-%m-%dT%H:%M:%S %1%2sGIT_AUTHOR_DATE)rº) rIr r/rrr rÁrIrÚdatestrr9rL)r1rœrržrÏrºr#r#r$rŸ´s   ÿzgitsubrepo.commitcsʈ\}‰}ˆ |ˆ¡ˆ dˆˆjdg¡‰ˆ ¡ˆ gd¢¡\}}‡‡‡‡fdd„}ˆ ¡r`ˆ ¡ˆkr\ˆ ¡ˆjdkpB|dk}tˆjˆ|ˆjddd…ˆdd…ƒr^|ƒdSdSdS|ƒdS)NrVrrrcsFˆˆkr ˆ ˆ¡nˆˆjdkrˆ ddˆg¡tˆjˆjdƒdS)Nrrxs --no-commitrH)rpr r9r^rGrer#©rYrxr1rr#r$rˆÏs  z#gitsubrepo.merge..mergefuncré) rqr9r r`r7rIrLrMrG)r1rr½rrr,rTrˆrIr#r|r$rÇs   "ÿ û zgitsubrepo.mergec Cs\| d¡}|jds dS| ¡rt tdƒ|j¡‚| ¡\}}|jd|vr9||jdD] }| d¡r8dSq.t   |¡D]\}}| d¡rS|  |jd|¡rSdSq>dg}|r^|  d¡|  ¡}|rœ|  |jd|¡sz|j tdƒ|j¡d S|j td ƒ| d d ¡d |jf¡| |d |g¡} | ddkS|j tdƒ|j|jdf¡d S)Nr‹rTrzsrefs/remotes/origin/spushrs7unrelated git branch checked out in subrepository "%s" Fs(pushing branch %s of subrepository "%s" rSrwrprsDno branch checked out in subrepository "%s" cannot push revision %s )rpr rIr r/rrrgrbrÚ iteritemsrZrïrNrGrSr¶rPr7) r1r¦ròrdrerjrxrÏrMÚretr#r#r$r§àsZ    ÿ € ÿüÿÿÿ ÿüÿzgitsubrepo.pushc s| ¡rgS|jdddd}tƒ}|j|j|j|jfD]} | | ¡q|j} |   ˆ  ¡¡g} ‡fdd„t t| ƒƒDƒ} | D]:} ˆ  | ¡} dg}| rO|  d¡|jsT| s_| tdƒ|| ƒ¡| |vrk| rj|   | ¡q>| d¡sx| || g¡q>| D] } | td ƒ|| ƒ¡q{| S) NT)Úunknownr)crÐr#r#rÑrÓr#r$rÔ%rÕz"gitsubrepo.add..saddrus adding %s r£s%s already tracked! )rIr¶ÚsetÚmodifiedÚaddedÚdeletedr)rÞr€r¾r¿rÚexactrïÚverboserrpr9rS)r1rGr rªr«r¬r¦rÚtrackedÚlr¿Úrejectedr]r…rGr#rÓr$r­s6      €zgitsubrepo.addcCs˜| ¡rdS| ¡r|j tdƒ|j¡dS|j tdƒ|j¡| gd¢¡|j  ¡D]\}}|dkr7q.|t j krC|j  |¡q.|j  |¡q.dS)Nr rd)r[r\r]rH)rIrIrGrSrrrer9reÚreaddirÚstatÚS_IFDIRrqrU)r1r]rrr#r#r$r£:s$ÿÿ úzgitsubrepo.removeTcCsd}|j\}}|s |S| ||¡|jd|gdd}tj|dd} t|ƒ} |jjtdƒ| tdƒd } |   d¡| D]H} |   ¡rAq:t   | j ¡} |rN|| ƒsNq:|  ¡rV| j}n|  | ¡}|rb| ¡}n |j td ƒ| ¡q:| || | j|  ¡|¡|d 7}|  ¡q:|  ¡|S) NrsarchiveT)r5zr|)ÚfileobjrærÖr×)rØsskipping "%s" (unknown type)r)r rqr9Útarfiler?r:rGrÝrrÞÚisdirrÚfsencoderÁÚissymÚlinknameÚ extractfilerCrSrßræràrá)r1rârªr rÂrÙr½rxÚ tarstreamÚtarrãräÚinforkr™r]r#r#r$rèPs<  ÿ      zgitsubrepo.archivec Ksx|jd}| ¡r dS| ¡sdS| ¡D]$}| dd||fg¡}tj|j||j ||¡d} |   |¡|   ¡qdS)NrrOs%s:%s)Úpathnamer) r Úanypatsr¿r9rÚ makefileobjr„rerVrDrt) r1r r³r´rªr¦r9r]rÚÚfpr#r#r$rµvs  ÿ  zgitsubrepo.catc KsH|jd}| ¡s |st ggggggg¡Sggg}}}| ¡|r,ddd||g}ndd|g}| |¡}| d¡D]:} |  d¡} | dkrGq;| | d| …| | dd…} } | d krb| | ¡q;| d krl| | ¡q;| d kru| | ¡q;ggggf\} }}}gd ¢}|  d ¡rŽ|dg7}|  d¡r˜|dg7}| |¡}t ƒ}|  |¡|  |¡|  |¡| d¡D]E} | s¹q´| dd…}|  d¡dkrÒ| dd… d¡\}}n| dd…}d}|  |¡|ræ|  |¡|dkrð| |¡q´|dkrù| |¡q´|  d¡r| dg¡}| d¡D] } | |vr| | ¡q t |||| |||¡S)Nrs diff-treeó --no-renamesrrsr»ó rµóMóAóD)rñs --porcelains-zr€s--untracked-files=allÚignoreds --ignoredórrwr1s??s!!r)sls-files) r rIrr¶r`r9rPrnrïrprrÞr­)r1r·r¦rLr‚rƒÚremovedrGr,rRÚtabr¶r]r„r€r r)Ú changedfilesÚstÚ filename1Ú filename2r#r#r$r¶‰sr     "   €              €    €ÿzgitsubrepo.statusc KsR|jd}ddg}|dr| d¡n| d|j¡|jr*| d|d|g¡n | d |d |g¡|jr=| d ¡|jrE| d ¡| | d g¡¡dkrX|j rX| d¡| |¡|rd| |¡d} |  ¡rt| | |¡d7} n(|  |¡} dd„| j | j | jfDƒ} | D]} || ƒr›| | |d| g¡d7} qˆ|  ¡r§| | ¡dSdS)Nrr;r›r‹s--stats-U%ds--src-prefix=%s/s--dst-prefix=%s/s--src-prefix=a/%s/s--dst-prefix=b/%s/s--ignore-all-spaces--ignore-space-changerÔ)réés--ignore-blank-linesr€r»cSsg|] }|D]}|‘qqSr#r#)rÒÚsublistr]r#r#r$rÔósýþÿz#gitsubrepo.diff..s--)r rïÚcontextÚnoprefixr¾ÚignorewsÚignorewsamountr2r9ÚignoreblanklinesÚalwaysr¶r‚rƒr¢rÊrD) r1rGr¸r¹r rªr¦rRrÏrÚr¥r¿r]r#r#r$rºÍsJ  ÿÿ  ÿ    þ€ÿzgitsubrepo.diffc Os®|j tdƒ|d¡| d¡sI| d¡}|j}|D]-}tj |j|¡}t   |j|j |¡}|j  tdƒ|tj  |¡f¡t |j |¡|¡q| d¡sU|j|ddgS)Nr¡rr¢s#saving current version of %s as %s r£Tr¤)rGr¶rrpr‚rr rTr…rÚ backuppathrArerãrÚrenamere) r1ryrör¦r¶rZrÁÚ parentnameÚbaknamer#r#r$r÷ÿs$   ÿÿÿ zgitsubrepo.revertcCr§)Nr}r#rør#r#r$rúr¨zgitsubrepo.shortid)NF)NFNrrr)'r4r5r6r0r Ú staticmethodr2r+r9r7r%rIrLrNrSrUrZr^r`rgrlrCrqrErIr™rprŸrr§r­r£rèrµr¶rºr÷rúrªr#r#r"r$r=s^ -   #  6    X   2 &  &  C 1 r)rirkrj)FT)?Ú __future__rrIr&rrÖr‹r¼r<rŽÚxml.dom.minidomräÚi18nrr©rrrrxrr r r r r rÇrrrrrrrrrþÚutilsrrrrrvrr:rCrr%r*r/r+rErMr^rhrortr,r‚Úobjectrƒrr«rrqr#r#r#r$Úsj  @   ý exc ý