\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlmZddlmZmZmZm Z m Z m Z m Z m Z mZmZmZdZdZdZd Zd Zd Zd Zd ZdefdYZgZdZdefdYZdefdYZedefdYZ edefdYZ!edefdYZ"edefdYZ#edefdYZ$edefd YZ%d!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,d(Z-e.dd)Z0dS(*i(tabsolute_importNi(t_( t changelogterrortfilelogthgt localrepotmanifesttpycompattrevlogtscmutiltutiltvfscC@s ddhS(sObtain requirements required to be present to upgrade a repo. An upgrade will not be allowed if the repository doesn't have the requirements returned by this function. trevlogv1tstore((trepo((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytrequiredsourcerequirementsscC@s dddhS(sObtain requirements that will prevent an upgrade from occurring. An upgrade cannot be performed if the source repository contains a requirements in the returned set. t treemanifestt parentdeltatshared((R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytblocksourcerequirements(s cC@s tjhS(sObtain requirements that can be removed during an upgrade. If an upgrade were to create a repository that dropped a requirement, the dropped requirement must appear in the returned set for the upgrade to be allowed. (RtSPARSEREVLOG_REQUIREMENT(R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytsupportremovedrequirements9scC@sdddddtjhS(sObtain requirements that upgrade supports in the destination. If the result of the upgrade would create requirements not in this set, the upgrade is disallowed. Extensions should monkeypatch this to add their custom requirements. t dotencodetfncachet generaldeltaR R(RR(R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytsupporteddestrequirementsDs cC@sdddtjhS(sObtain requirements that can be added to a repository during upgrade. This is used to disallow proposed requirements from being added when they weren't present before. We use a list of allowed requirement additions instead of a list of known bad additions because the whitelist approach is safer and will prevent future, unknown requirements from accidentally being added. RRR(RR(R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytallowednewrequirementsUs cC@stS(N(tset(R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytpreservedrequirementsfst deficiencyt optimizationt improvementcB@s2eZdZdZdZdZdZRS(sRepresents an improvement that can be made as part of an upgrade. The following attributes are defined on each instance: name Machine-readable string uniquely identifying this improvement. It will be mapped to an action later in the upgrade process. type Either ``deficiency`` or ``optimisation``. A deficiency is an obvious problem. An optimization is an action (sometimes optional) that can be taken to further improve the state of the repository. description Message intended for humans explaining the improvement in more detail, including the implications of it. For ``deficiency`` types, should be worded in the present tense. For ``optimisation`` types, should be worded in the future tense. upgrademessage Message intended for humans explaining what an upgrade addressing this issue will do. Should be worded in the future tense. cC@s(||_||_||_||_dS(N(tnamettypet descriptiontupgrademessage(tselfR!R"R#R$((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt__init__s   cC@s#t|tstS|j|jkS(N(t isinstanceR tNotImplementedR!(R%tother((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt__eq__scC@s ||k S(N((R%R)((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt__ne__scC@s t|jS(N(thashR!(R%((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt__hash__s(t__name__t __module__t__doc__R&R*R+R-(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR ls    cC@stj||S(N(tallformatvarianttappend(tcls((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytregisterformatvariants t formatvariantcB@sSeZdZeZdZdZdZdZ dZ e dZ e dZ RS(s6an improvement subclass dedicated to repository formatcC@s tdS(N(tNotImplementedError(R%((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR&scC@s tdS(s.current value of the variant in the repositoryN(R6(R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytfromreposcC@s tdS(s1current value of the variant in the configurationN(R6(R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt fromconfigsN(R.R/R0RR"tNoneR!R#R$tdefaultR&t staticmethodR7R8(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR5s trequirementformatvariantcB@sAeZdZdZedZedZedZ RS(sformatvariant based on a 'requirement' name. Many format variant are controlled by a 'requirement'. We define a small subclass to factor the code. cC@stj|tj|S(N(Rtnewreporequirementstdefaultcreateopts(tui((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt_newreporequirementsscC@s%|jdk st|j|jkS(N(t _requirementR9tAssertionErrort requirements(R3R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR7scC@s.|jdk st|j|j|jkS(N(RAR9RBR@R?(R3R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR8sN( R.R/R0R9RAR;R@t classmethodR7R8(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR<s RcB@s2eZdZdZeZedZedZRS(RsYlong and reserved filenames may not work correctly; repository performance is sub-optimalssrepository will be more resilient to storing certain paths and performance of certain operations should be improved( R.R/R!RAtTrueR:RR#R$(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyRs  RcB@s2eZdZdZeZedZedZRS(RsLstorage of filenames beginning with a period or space may not work correctlysNrepository will be better able to store files beginning with a space or period( R.R/R!RARER:RR#R$(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyRs  RcB@s2eZdZdZeZedZedZRS(Rsdeltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slowersrepository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster( R.R/R!RARER:RR#R$(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyRs  t sparserevlogcB@s5eZdZejZeZedZ edZ RS(RFsXin order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.sRevlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.( R.R/R!RRRAtFalseR:RR#R$(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyRF s   tremovecldeltachaincB@sJeZdZeZedZedZedZ edZ RS(splain-cl-deltaschangelog storage is using deltas instead of raw entries; changelog reading and any operation relying on changelog data are slower than they could beszchangelog storage will be reformated to store raw entries; changelog reading will be faster; changelog size may be reducedc@s,|j}|jtfd|DS(Nc3@s!|]}||kVqdS(N((t.0trev(t chainbase(s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pys 5s(RRKtall(Rtcl((RKs7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR7/s  cC@stS(N(RE(R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR87s( R.R/R!RER:RR#R$R;R7R8(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyRH s   tcompressionenginecB@sJeZdZdZedZedZedZedZ RS(t compressiontzlibsMCompresion algorithm used to compress data. Some engine are faster than others;revlog content will be recompressed with the new algorithm.cC@s;x4|jD])}|jdr |jdddSq WdS(Nsexp-compression-t-iRP(RCt startswithtsplit(R3Rtreq((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR7FscC@s|jjddS(Nt experimentalsformat.compression(R?tconfig(R3R((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyR8Ms( R.R/R!R:RR#R$RDR7R8(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyRN;s   cC@s:g}x-tD]%}|j|s |j|q q W|S(s8returns a list of deficiencies that the repo suffer from(R1R7R2(Rt deficienciestfv((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytfinddeficienciesQs  c C@sg}|jtdddtdtddtd|jtdddtdtd dtd |jtdd dtdtd dtd |jtdddtdtddtd|S(s8Determine optimisation that could be used during upgradeR!t redeltaparentR"R#s]deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slowerR$sHdeltas within internal storage will choose a new base revision if neededtredeltamultibasesdeltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of mergessdeltas within internal storage will choose an optimal delta by computing deltas against multiple parents; may slow down execution time significantlyt redeltaallsdeltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not neededsndeltas within internal storage will be fully recomputed; this will likely drastically slow down execution timetredeltafulladdsevery revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.seach revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it(R2R t optimisationR(Rt optimizations((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytfindoptimizations_s,        cC@s[g}t|}xB|D]:}|j}||krF||krFqn|j|qW|S(sDetermine upgrade actions that will be performed. Given a list of improvements as returned by ``finddeficiencies`` and ``findoptimizations``, determine the list of upgrade actions that will be performed. The role of this function is to filter improvements if needed, apply recommended optimizations from the improvements list that make sense, etc. Returns a list of action names. (RR!R2(RRWt sourcereqstdestreqst newactionst knownreqstdR!((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytdetermineactionss    cC@sp|dkrtj|jS|jdrR|td }tj|jd|Stj|j|dd!SdS(s]Obtain a revlog from a repo path. An instance of the appropriate class is returned. s 00changelog.is 00manifest.ittreeiiN(RtsvfstendswithtlenRtmanifestrevlogR(Rtpathtmandir((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt_revlogfrompaths  c# @sd}d}d}d} d} d} d} d} d}d}d}d}d}d}d}d}d}d}x||jjD]k\}}}|jdrq|nt||}|jdtdtdtdt}||dpd7}|dpd}|dpd}||7}||7}t|tjrT|t|7}||7}||7}q|t|t j r|d7}|t|7}||7}||7}q|t|t j r| d7} | t|7} | |7} | |7} q|t j dq|W|sd S|jtd || ||f|jtd tj|tj|fd fd }t} x|jjD]\}}}|jdrqunt||}!t||}"t|!tjrbd | krb|jtd||tj||f|jtd|tj|tj|f| jd |jjtdd|nCt|!t j r#d| kr#|jtd| | tj|| f|jtd||tj|tj|f| jdrjn|jjtdd|nd| kr|jtd| | tj| tj| f| jdrjn|jjtdd| n|jtdt|!|f|!j||"d|d|d||"jdt}|dp d}| |7} t|"tjr5||7}qut|"t j rT||7}qu||7}quWj|jtd|tj||f|jtd|tj| |fd S(sCopy revlogs between 2 repos.is.dtexclusivefilestrevisionscountt trackedsizet storedsizeisunknown revlog typeNsPmigrating %d total revisions (%d in filelogs, %d in manifests, %d in changelog) s'migrating %s in store; %s tracked data c@sjdS(N(t increment(trlRJtnode(tprogress(s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytoncopiedrevisionstcsQfinished migrating %d manifest revisions across %d manifests; change in size: %s sKmigrating changelog containing %d revisions (%s in store; %s tracked data) schangelog revisionsttotaltmsOfinished migrating %d filelog revisions across %d filelogs; change in size: %s sNmigrating %d manifests containing %d revisions (%s in store; %s tracked data) smanifest revisionstfsMmigrating %d filelogs containing %d revisions (%s in store; %s tracked data) sfile revisionsscloning %d revisions from %s t addrevisioncbt deltareusetdeltabothparentss>finished migrating %d changelog revisions; change in size: %s sFfinished migrating %d total revisions; total change in store size: %s (RtwalkRiRnt storageinfoRER'RRjRRkRRtProgrammingErrortwriteRR t bytecountR9RtaddR?t makeprogresstcompletetnotetclone(#R?tsrcrepotdstrepottrR}R~trevcounttsrcsizet srcrawsizetdstsizetfcountt frevcounttfsrcsizetfrawsizetfdstsizetmcountt mrevcounttmsrcsizetmrawsizetmdstsizet crevcounttcsrcsizetcrawsizetcdstsizet unencodedtencodedtsizeRttinfotdatasizetrawsizeRwtseentoldrltnewrl((Rvs7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt _copyrevlogss                     #    cC@sM|jdrtS|jdr&tS|tjkr9tS|dkrItStS(sDetermine whether to copy a store file during upgrade. This function is called when migrating store files from ``srcrepo`` to ``dstrepo`` as part of upgrading a repository. Args: srcrepo: repo we are copying from dstrepo: repo we are copying to requirements: set of requirements for ``dstrepo`` path: store file being examined mode: the ``ST_MODE`` file type of ``path`` st: ``stat`` data structure for ``path`` Function should return ``True`` if the file is to be copied. s.is.dtundotlockR(s.is.d(RR(RiRGRRtstattS_IFREGRE(RRRCRltmodetst((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt_filterstorefile[s cC@sdS(sHook point for extensions to perform additional actions during upgrade. This function is called after revlogs and store files have been copied but before the new store is swapped into the original location. N((R?RRRC((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt_finishdatamigrationzsc C@s|jst|js$t|jtdd|krRtjj}n]d|krmtjj}nBd|krtjj}n'd|krtjj}n tjj}|j d&}t |||||d|kWdQXxt |j j jdd tD]\}}} t|||||| s8qn|jjtd ||j jj|} |j jj|} tj| | d tqWt|||||jtd tjd dd|j} tj | } tj|j jd| jd|jtdtj|j |jdhB|jtd|jtd| |jtdtj}tj|j | jdtj|j |j tj|}|jtd||jtdtj|j || j!d| S(syDo the low-level work of upgrading a repository. The upgrade is effectively performed as a copy between a source repository and a temporary destination repository. The source repository is unmodified for as long as possible so the upgrade can abort at any time without causing loss of service for readers and without corrupting the source repository. sP(it is safe to interrupt this process any time before data migration completes) R\RZR[R]tupgradeNtRs copying %s tcopystats,data fully migrated to temporary repository tprefixsupgradebackup.tdirtrequiress\marking source repository as being upgraded; clients will be unable to read from repository tupgradeinprogresss*starting in-place swap of repository data s'replaced files will be backed up at %s sreplacing store... RsCstore replacement complete; repository was inconsistent for %0.1fs sBfinalizing requirements file and making repository readable again s store/lock("t currentwlockRBRRR tDELTAREUSENEVERtDELTAREUSESAMEREVStDELTAREUSEFULLADDtDELTAREUSEALWAYSt transactionRtsortedRR treaddirRERR?trawvfstjoinR tcopyfileRRtmkdtempRltvfsmodR t writerequiresRCttimertrenametspathtunlink(R?RRRCtactionsR}RtptkindRtsrctdstt backuppatht backupvfsttstarttelapsed((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt _upgradereposZ      1 %   c@st|p g}jtj}|rhtjtdtdjt|nt j@}|rtjtdtdjt|nt j j t j j jtjt}|r4tjtdtdjt|njt}|rtjtdtdjt|nt}|rtjtdtdjt|nt} g} x=| D]5} | j|kr| j| |j| jqqW|rXtjtddjt|dtd nt} t| jjfd t| Dfd } fd }|s~g}g}xF| D]>}|jr|j|q|jr|j|qqW|s-|r|rwjtd x.|D]#}jd|j|jfqMWn|rjtdx.|D]#}jd|j|jfqWnjdnjtdjtd| |g| D]}|kr |^q }|rzjtdx4|D])}jtd|j|jfqJWndSjtd| |gD]}|j^q}jtdj9j&jtdt j!dddj"}d}zjtd|j j$j }t%j&|d|dt'}|j0|jt(||}WdQXWdQXWdjtd|j)j*|dt'|rj+td |j+td!nXWdQXWdQXdS("sUpgrade a repository in place.s2cannot upgrade repository; requirement missing: %ss, s=cannot upgrade repository; unsupported source requirement: %ss;cannot upgrade repository; requirement would be removed: %ss@cannot upgrade repository; do not support adding requirement: %ssEcannot upgrade repository; do not support destination requirement: %ss)unknown optimization action requested: %sthints0run without arguments to see valid optimizationsc3@s!|]}|kr|VqdS(N((RIto(R(s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pys sc@sjtdjtdtdjtj@jrjtdtdjtjnjrjtdtdjtjnjddS(Ns requirements s preserved: %s s, s removed: %s s added: %s s (RRRRRC((tnewreqsRR?(s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytprintrequirementss$ ' 'c@s2x+D]#}jd|j|jfqWdS(Ns %s %s (RR!R$(ta(RR?(s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytprintupgradeactions+s sBrepository lacks features recommended by current config options: s %s %s s?repository lacks features used by the default config options: s s7(no feature deficiencies found in existing repository) sEperforming an upgrade with "--run" will make the following changes: sKadditional optimizations are available by specifying "--optimize ": Ns-upgrade will perform the following actions: sbeginning upgrade... s repository locked and read-only Rsupgrade.Rs9creating temporary repository to stage migrated data: %s Rltcreates!removing temporary repository %s tforciblys'copy of old repository backed up at %s sqthe old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified (,Rt unfilteredRRCRtAbortRRRRRR=R?R>tupdateRRRRR`R!R2tdiscardRYRftextendR8R:RR#twlockRRRRlR9t __class__Rt repositoryRERR trmtreetwarn(R?Rtruntoptimizet missingreqst blockedreqst noremovereqst noaddreqstunsupportedreqstalloptimizationsR_RRWRRR8t onlydefaultRetitunusedoptimizeRtupgradeactionsttmppathRtrepouiR((RRRR?s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pyt upgraderepos ""  "  ""    #    $ $% *  (1t __future__RRti18nRRRRRRRRRR R R R RRRRRRRRR^tobjectR R1R4R5R<RRRRFRHRNRYR`RfRnRRRRRGR9R(((s7/usr/lib64/python2.7/site-packages/mercurial/upgrade.pytsJ L    * "   >    [