^c[7ddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z m Z mZmZddlmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z&m'Z(m)Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1mZm2Z2m3Z3m4Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;ZZ?m@Z@mAZAmBZBmCZDmEZEddlFmGZGmBZHdd lImJZJmKZKmLZLmMZMdd lNmOZPmQZRmSZTe&jUZUeBjVZVeBjWZWeXZYGd d e9jZZ[Gd de[Z\Gdde[Z]Gdde]Z^Gdde]Z_Gdde[Z`dZaGddeBjbZcGddeBjbZddZedZfhdZgeghdhZieHjjeGjkGd d!ZleHjjeGjmGd"d#eGjnZoeHjjeGjpGd$d%eoZqeXZrd&Zsd'ZtdFd(ZudFd)Zvd*Zwd+Zxd,Zyd-Zzd.Z{d/Z|d0Z}d1Z~eHjjeGjGd2d3ZeHjjeGjGd4d5Zd6ZeGjd7feGjd8fgZeHjjeGjGd9d:Zd;Zd<ZdGd=Zd>ZdFd?Zd@ZdAZdBZdCZdGdDZdEZdS)HN)futures)_)binhexnullrevsha1nodeconstantsshort)delattrgetattr), bookmarks branchmapbundle2 bundlecaches changegroupcolorcommitcontextdirstate dirstateguard discoveryencodingerrorexchange extensionsfileloghooklockmatch mergestate mergeutil namespaces narrowspecobsoletepathutilphasespushkeypycompatrcutilrepoview requirementsrevlogrevset revsetlangscmutilsparsestore subrepoutiltags transactiontxnutilutilvfswireprototypes) repositoryr6)hashutilprocutil stringutilurlutil)concurrency_checker constantssidedatac.eZdZdZdfd ZfdZxZS)_basefilecachezHAll filecache usage on repo are done for logic that should be unfilteredNc||S|} |j|jS#t$rYnwxYwt t |||SN) unfiltered__dict__snameKeyErrorsuperrB__get__selfrepotypeunfi __class__s 5/usr/lib/python3/dist-packages/mercurial/localrepo.pyrJz_basefilecache.__get__lsp <K   =, ,    D ^T**224>>>s - ::cztt|||SrD)rIrBsetrE)rLrMvaluerPs rQrSz_basefilecache.setws-^T**..t/@/@%HHHrD)__name__ __module__ __qualname____doc__rJrS __classcell__rPs@rQrBrBiseRR ? ? ? ? ? ?IIIIIIIIIrUrBc(eZdZdZfdZdZxZS) repofilecachez3filecache for files in .hg but outside of .hg/storectt|j||D]}t|dfdS)Nplain)rIr]__init__ _cachedfilesaddrLpathspathrPs rQr`zrepofilecache.__init__~sR+mT""+U33 / /D   dH- . . . . / /rUc6|j|SrD)r7joinrLobjfnames rQrgzrepofilecache.joinsw||E"""rUrVrWrXrYr`rgrZr[s@rQr]r]{sM==///// #######rUr]c(eZdZdZfdZdZxZS) storecachez filecache for files in the storectt|j||D]}t|dfdS)NrU)rIrmr`rarbrcs rQr`zstorecache.__init__sQ(j$(%00 * *D   dC[ ) ) ) ) * *rUc,||SrD)sjoinrhs rQrgzstorecache.joinsyyrUrkr[s@rQrmrmsM*******        rUrmc(eZdZdZfdZdZxZS)changelogcachezfilecache for the changelogctt|tdtddS)N 00changelog.irU) 00changelog.nrU)rIrrr`rarbrLrPs rQr`zchangelogcache.__init__sO nd##,,...0111011111rUc||dg}|jjjddr)|||d|S)Nrupersistent-nodemapFrvrgr1openeroptionsgetappendrLrirds rQ tracked_pathszchangelogcache.tracked_pathss`3 0112 9  # ' '(=u E E ; LL3(899 : : : rUrVrWrXrYr`rrZr[s@rQrrrrsM%%22222 rUrrc(eZdZdZfdZdZxZS)manifestlogcachezfilecache for the manifestlogctt|tdtddS)N) 00manifest.irU) 00manifest.nrU)rIrr`rarbrws rQr`zmanifestlogcache.__init__sP %%..000/000/00000rUc||dg}|jjjddr)|||d|S)NrryFrrzrs rQrzmanifestlogcache.tracked_pathss^3001 9  # ' '(=u E E : LL388 9 9 9 rUrr[s@rQrrsM''11111 rUrc(eZdZdZfdZdZxZS)mixedrepostorecachez2filecache for a mix files in .hg/store and outsidecvtt|j|t|dSrD)rIrr`raupdate)rLpathsandlocationsrPs rQr`zmixedrepostorecache.__init__s< 2!4((13DEE-.....rUc|\}}|dkr|j|S|dkrtjd|z||S)Nr_rUsunexpected location: %s)r7rgrProgrammingErrorrp)rLrifnameandlocationrjlocations rQrgzmixedrepostorecache.joinsd*x x  7<<&& &3,.999U## #rUrkr[s@rQrrsM<<///// $ $ $ $ $ $ $rUrcv|j|d}|sdS|jdfS)z{check if a repo has already cached "name" filecache-ed property This returns (cachedobj-or-None, iscached) tuple. NNFT)rE _filecacher}ri)rMname cacheentrys rQ isfilecachedrs@ ""-11$==J { >4 rUc$eZdZdZdfd ZxZS)unfilteredpropertycachez0propertycache that apply to unfiltered repo onlyNc|}||ur(tt||St ||jSrD)rErIrrJr rrKs rQrJzunfilteredpropertycache.__get__sL   4<<0$77??EE EtTY'''rUrD)rVrWrXrYrJrZr[s@rQrrsC::((((((((((rUrceZdZdZdZdS)filteredpropertycachez1propertycache that must take filtering in accountcHt||j|dSrD)object __setattr__r)rLrirTs rQ cachevaluez filteredpropertycache.cachevalues"3 511111rUN)rVrWrXrYrrUrQrrs);;22222rUrcH|t|vS)z?check if a repo has an unfilteredpropertycache value for )varsrE)rMrs rQhasunfilteredcachers 4))** **rUcFtjfd}|S)z@decorate method that always need to be run on unfiltered versionc@|g|Ri|SrD)rE)rMargskwargsorigs rQwrapperz!unfilteredmethod..wrappers-tDOO%%7777777rU) functoolswraps)rrs` rQunfilteredmethodrs:_T88888 NrU>knownlookupunbundle branchmap getbundlepushkeyschangegroupsubsetc2eZdZdZdZdZdZdZdZdS)localcommandexecutorc0||_d|_d|_dSr)_peer_sent_closed)rLpeers rQr`zlocalcommandexecutor.__init__s   rUc|SrDrrLs rQ __enter__zlocalcommandexecutor.__enter__ rUc.|dSrD)close)rLexctypeexcvalueexctbs rQ__exit__zlocalcommandexecutor.__exit__s rUc|jrtjd|jrtjdt |jt j|}tj } |dit j |}| |n>#t$r1t j |tjddYnwxYw|S)Ns1callcommand() cannot be used after sendcommands()s*callcommand() cannot be used after close()rr)rrrrr rr(sysstrrFuture strkwargs set_result Exceptionfuture_set_exception_infosysexc_info)rLcommandrfnfresults rQ callcommandz localcommandexecutor.callcommand s : (D  < (=  TZ!9!9 : : N   !R33(,T2233F LL  F F F  .q#,..2D E E E E E F s2B""8CCcd|_dSNT)rrs rQ sendcommandsz!localcommandexecutor.sendcommands#s  rUcd|_dSr)rrs rQrzlocalcommandexecutor.close&s  rUN) rVrWrXr`rrrrrrrUrQrrsn 4rUrceZdZdZdfd ZdZdZdZdZdZ d Z d Z d Z dd Z dd ZdZdZdZdZdZdZdZdZxZS) localpeerz8peer for a local repo; reflects only the most recent APINcrtt||t}|d|_|j|_|jr,tj |}| d|z| ||_ dS)Nservedsexp-wanted-sidedata=)rIrr` moderncapscopyfiltered_repoui_wanted_sidedatarformat_remote_wanted_sidedatarb_restrictcapabilities_caps)rLrMcaps formattedrPs rQr`zlocalpeer.__init__.s i''))) <??$$D]]9-- '   :=dCCI HH,y8 9 9 9//55 rUc4|jSrD)rurlrs rQrz localpeer.url>sz~~rUc|jSrD)rrs rQlocalzlocalpeer.localA zrUc|SrDrrs rQrzlocalpeer.peerDrrUcdSrrrs rQcanpushzlocalpeer.canpushGtrUc8|jdSrD)rrrs rQrzlocalpeer.closeJs rUc4|jSrD)rrrs rQrzlocalpeer.branchmapQsz##%%%rUc|jSrD)rrs rQ capabilitieszlocalpeer.capabilitiesTrrUcJ|jtjSrD)rtryreadrCB_MANIFEST_FILErs rQ clonebundleszlocalpeer.clonebundlesWsz!!,"?@@@rUcd||tj|tj|tj|fzS)z+Used to test argument passing over the wire%s %s %s %s %sr(bytestrrLonetwothreefourfives rQ debugwireargszlocalpeer.debugwireargsZD    U # #  T " "  T " " $   rUc tj|j|f||||d|d}tj|}tj|rt j|j|Stjd|dS)N)headscommon bundlecapsremote_sidedatar01) rgetbundlechunksrr6 chunkbufferbundle2requestedr getunbundlerrr) rLsourcerrrrrchunkscbs rQ getbundlezlocalpeer.getbundleds) J  !+        f % %  $Z 0 0 ='44 4+E2t<< >F!.tw??C    !&>CC9%.tz}==G%--,,,,!-g.?.?.A.ABBF,TWf==A)$*a888! "   %/""J$;C$@$@  s1BB EB&EEE F4F  Fc t|SrD)rrs rQcommandexecutorzlocalpeer.commandexecutors#D)))rUrDNNN)NNNN)rVrWrXrYr`rrrrrrrrrrrrrrr'r!r%r7rZr[s@rQrr*spBB 6 6 6 6 6 6    &&&AAA     ====8"""'''...&&&<<<PPP###R*******rUrc:eZdZdZfdZdZdZdZdZxZ S)locallegacypeerzcpeer extension which implements legacy methods too; used for tests with restricted capabilitiescftt||tdS)N)r)rIr:r` legacycaps)rLrMrPs rQr`zlocallegacypeer.__init__s, ot$$--d-DDDDDrUc6|j|SrD)rbetween)rLpairss rQr>zlocallegacypeer.betweensz!!%(((rUc6|j|SrD)rbranchesrs rQrAzlocallegacypeer.branchessz""5)))rUctj|j||j}t j|j|d|SN) missingroots ancestorsofr)routgoingrrrmakechangegroup)rLrr rFs rQrzlocallegacypeer.changegroupsK% JU 8H8H8J8J   *4:xOOOrUcrtj|j||}tj|j|d|SrC)rrFrrrG)rLbasesrr rFs rQchangegroupsubsetz!locallegacypeer.changegroupsubsets=% JU   *4:xOOOrU) rVrWrXrYr`r>rArrJrZr[s@rQr:r:sEEEEE )))***PPP PPPPPPPrUr:cf|dd}tj|vr't j||}tj|d}| s)tj td|j z|S)zreturns the vfs object pointing to root of shared source repo for a shared repository hgvfs is vfs pointing at .hg/ of current repo (shared one) requirements is a set of requirements of current repo (shared one) sharedpath T)realpaths1.hg/sharedpath points to nonexistent directory %s)readrstriprequirementsmodRELATIVE_SHARED_REQUIREMENTr6normpathrgvfsmodr7existsr RepoErrorrbase)hgvfsr+ sharedpath sharedvfss rQ _getsharedvfsr[sM**11%88J2lBB]5::j#9#9::  :555I      o B C Cn     rUcv|r|jn|j}t|dS)zreads the require file present at root of this vfs and return a set of requirements If allowmissing is True, we suppress FileNotFoundError if raisedrequires)rrOrS splitlines)r7 allowmissingrOs rQ _readrequiresr`s:' 43;;CHD ttK  ++-- . ..rUc |}|j|_tj|dd}|d}tj|d}d}d}|s |nU#t $rYnIt$r=} tj td|tj | fzd} ~ wwxYwtj td|zt|d} tj| vp tj| v}d} |r8t%|| }tj|d } n'tj|d } td } tj| vr|rtjt|dvr|d d } |d d }|d d}|dvr#ddlm}||||| || |n:|dkr#tj td| tj td|z| | t| dz} n|rt|d}tj|vr|d d}|d d} |d d}|dvr"ddlm}|||| | || |nO|dkr#tj td| tj td|z| t5|||| |r:t7|||| t9j|t9j|dt9j|D}t?|}tA| |tC|| tE}|r<|j#}|d}|$tJj&n|j#}|d}|d}tO| |d}|j(|_(|j} tS|| || _*tj+| vstj,| vr>|$tJj-|.tJj/tj|d}|j(|_(tj|d}|j(|_(g}i}t`D]l\}}|||| ||||| | j*||||| }tc|tdstj3d!|z|4|mtkj6d"|j#d#to| fz} te| tq|i}!|!|||||| |||||||$ S)%aeCreate a local repository object. Given arguments needed to construct a local repository, this function performs various early repository loading functionality (such as reading the ``.hg/requires`` and ``.hg/hgrc`` files), validates that the repository can be opened, derives a type suitable for representing that repository, and returns an instance of it. The returned object conforms to the ``repository.completelocalrepository`` interface. The repository type is derived by calling a series of factory functions for each aspect/interface of the final repository. These are defined by ``REPO_INTERFACES``. Each factory function is called to produce a type implementing a specific interface. The cumulative list of returned types will be combined into a new type and that type will be instantiated to represent the local repository. The factory functions each receive various state that may be consulted as part of deriving a type. Extensions should wrap these factory functions to customize repository type creation. Note that an extension's wrapped function may be called even if that extension is not loaded for the repo being constructed. Extensions should check if their ``__name__`` appears in the ``extensionmodulenames`` set passed to the factory function and no-op if not. T expandpathrN.hg cacheauditedFNsinvalid path %s: %ssrepository %s not foundstores?see `hg help config.format.use-share-safe` for more informationsshares"safe-mismatch.source-not-safe.warnssafe-mismatch.source-not-safes-safe-mismatch.source-not-safe:verbose-upgrade)sdowngrade-allowallowsdowngrade-abortrupgradeaborts4share source does not support share-safe requirementhintsfshare-safe mismatch with source. Unrecognized value '%s' of `share.safe-mismatch.source-not-safe` set.ssafe-mismatch.source-safessafe-mismatch.source-safe.warns)safe-mismatch.source-safe:verbose-upgrade)s upgrade-allowrhs upgrade-abortsWversion mismatch: source uses share-safe functionality while the current share does notsbshare-safe mismatch with source. Unrecognized value '%s' of `share.safe-mismatch.source-safe` set.c"h|] \}}|j SrrV.0nms rQ z&makelocalrepository..sMMM41aAJMMMrUcachewcachec.tj|dS)NTre)rTr7)rWs rQz%makelocalrepository..sVZ4888rU)rintentsr+featureswdirvfsrXr1storevfs storeoptionscachevfs wcachevfsextensionmodulenames extrastate baseclassessunable to construct type for %ssderivedrepo:%s<%s>,) baseuirorigrootr{rXr+supportedrequirementsrYr1r~rrzry)9rrTr7rgisdirstatFileNotFoundError ValueErrorrr rr<r-rVr`rQSHARED_REQUIREMENTrRr[SHARESAFE_REQUIREMENT configboolconfigrjdowngrade_share_to_non_safeupgrade_share_to_safeloadhgrc afterhgrcloadrloadall populateuigathersupportedrequirementsensurerequirementsrecognizedensurerequirementscompatiblerSrWrbr9REPO_FEATURE_SHARED_STORAGE makestore createmoderesolvestorevfsoptionsr|REVLOGV2_REQUIREMENTCHANGELOGV2_REQUIREMENTREPO_FEATURE_SIDE_DATAdiscardREPO_FEATURE_STREAM_CLONEREPO_INTERFACES isinstancerNrr~r(rsortedtuple)"rreryrr{hgpathrXsharedrZer+r|rm mismatch_warnmismatch_configmismatch_verbose_upgraderjsourcerequiresrrrz storebasepath cachepath wcachepathr1r~rrIrifacertyprclss" rQmakelocalrepositoryrs{> BkBGj$>>>G\\& ! !F JvD 1 1 1E FI ;;== D  JJLLLL     D   +())T:3J13M3M,NN   oa :;;dBCCC --L*l: G  6, F H 4!%66 :innX6677:ejj2233 O P PD, << / ;5 D1122MM?M!ii:O(*}}J(( $# &%%%%%33 #!,!H,,kMNN k! & &  M(E:: :LL +&y%88  0N B B ii2NOOOMM;M(*}}F(( $# &%%%%%-- #!,!H,,kK kQ& &  GUL)<<"b'5,7772b!!!NM:3H3L3LMMM7;;!/DEEE!\222$uuH )! NN8,,  Z;<<<< JJx(( I&&J 88  E 'EyH-b,IIH , <<  2l B B Z6777=>>>z)$777H*H :D999I +I EJ$ rbbdd%!)!5!   "#t$$ (2U:   S ?tyy 9M9M/N/N OO  D tU5\\2 & &C 3 !3    s<B C# C#&8CC#ctjsdSd}tj|vrE|rC ||d|jd}n#t$rYnwxYw ||d|jd}n#t$rYnwxYw ||d|jd}n#t$rYnwxYw|S)aLoad hgrc files/content into a ui instance. This is called during repository opening to load any additional config files or settings relevant to the current repository. Returns a bool indicating whether any additional configs were loaded. Extensions should monkeypatch this function to modify how per-repo configs are loaded. For example, an extension may wish to pull in configs from alternate files or sources. sharedvfs is vfs object pointing to source repo if the current one is a shared one FhgrcrootTshgrc-not-shared)r) use_repo_hgrcrQr readconfigrgrWIOError)rr{rXr+rZr/s rQrrPs*   ! !u C, <<<  MM)..11 M G G GCC    D   ejj)) ===        ejj!3447< HHH       Js51A A('A(,1B B+*B+/1C!! C.-C.cdgdgdgd}t|D]>\}}||vr |D]1}|d|s|d|dd2?d S) aQPerform additional actions after .hg/hgrc is loaded. This function is called during repository loading immediately after the .hg/hgrc file is loaded and before per-repo extensions are loaded. The function can be used to validate configs, automatically add options (including extensions) based on requirements, etc. git largefileslfs)rrrs extensionsrUsautoload)r N)ritems hasconfig setconfig)rr{rXr+autoextensions requirementnamesrs rQrrzs%N %^%9%9%;%;<<KK U l * *  K KD<< t44 K ]D#k JJJ K KKrUcttj}dtj|D}tD]}|j|vr |||t jD]}t j|}|rc| rO| d|z| dkr| tj |S)z6Determine the complete set of recognized requirements.c"h|] \}}|j Srrorps rQrtz.gathersupportedrequirements..s@@@daqz@@@rUexp-compression-%szstd)rSlocalrepository_basesupportedrfeaturesetupfuncsrWr6 compengines available revlogheaderrbrrQREVLOG_COMPRESSION_ZSTD)r supportedmodulesrrengines rQrrsO233IA@j&;B&?&?@@@G =G # # Br9    GG!$'      G&"5"5"7"7 G MM/$6 7 7 7{{}}'' oEFFF rUct}|D][}||vr|r|dds!tjt d||\|rStjt ddt|zt ddS) aValidate that a set of local requirements is recognized. Receives a set of requirements. Raises an ``error.RepoError`` if there exists any requirement in that set that currently loaded code doesn't recognize. Returns a set of supported requirements. rrs.hg/requires file is corrupts:repository requires features unknown to this Mercurial: %s sJsee https://mercurial-scm.org/wiki/MissingRequirement for more informationrlN)rSisalnumrRequirementErrorrrbrgr)r+rmissingrs rQrrseeG#!! ) # #  M+ac"2":":"<"< M(+J)K)KLL L K     $ K L Liiw(( )(      rUctj|vr-tjs#t jt ddSdS)aValidates that a set of recognized requirements is mutually compatible. Some requirements may not be compatible with others or require config options that aren't enabled. This function is called during repository opening to ensure that the set of requirements needed to open a repository is sane and compatible with config options. Extensions can monkeypatch this function to perform additional checking. ``error.RepoError`` should be raised on failure. sfrepository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to accessN)rQSPARSE_REQUIREMENTr0enabledrrVr)rr+s rQrrsR *l:: ;o 1      ;:::rUctj|vrGtj|vr$tj|v}t j|||St j||St j||S)z,Construct a storage object for a repository.)rQSTORE_REQUIREMENTFNCACHE_REQUIREMENTDOTENCODE_REQUIREMENTstoremod fncachestore encodedstore basicstore)r+revfstype dotencodes rQrrsf(L88  ., > >'=MI(w BB B$T7333  tW - --rUc`i}tj|vrd|d<|dd}|||d<tj|vstj|vr%|t |||nd|d<tj|vrd|d<n!|d d }d }||vrd |d<|S) zResolve the options to pass to the store vfs opener. The returned dict is used to influence behavior of the storage layer. T treemanifestformatsmanifestcachesizeNsrevlogv0changeset-sidedatascopies-storage experimentalscopies.write-to)schangeset-onlys compatibilitysextra) rQTREEMANIFEST_REQUIREMENT configintREVLOGV1_REQUIREMENTrrresolverevlogstorevfsoptionsCOPIESSDC_REQUIREMENTr)rr+rzr|manifestcachesize writecopiestocopiesextramodes rQrrs G/<??#'  Y0DEE$(9$% , <<  /< ? ?3B hOOPPPP# , <<%:!"" /3EFF ? O + +)1G% & NrUcN i}i|d<tj|vrd|d<tj|vrd|d<tj|vrd|d<tj|vrd|d<|dd}|||d<|d d }||d <|d d|d<|d d}||d<|d d}d}|r|d d}|tj| }||d<||d<| dd} d| kr| |d<| dd} | | |d<|dd} t| dd} | dd} | |d<| |d<| |d <tj |v}||d!<|rd|d<d }|r tj}|dd"|}|||d"<|D]>}|j}|d#s |d$r|d%d&d&|d'<?|d d(|d)<|d)Ad|d)cxkrd*ks.nt#d+}t%j||d)z|d d,|d-<|d-Ad|d-cxkrd.ks.nt#d/}t%j||d-ztj|vrd|d0<|dd1rd|d1<tj|vr| d d2}|d3vrk|d d2}t#d4}|||z|js%|t#d5|z|}t#d6}t#d7}t2jsc|d8krAd9|zd:z}|||jsd;|zdd|d?<tj|vr| d d@}|d3vrk|d d@}t#dA}|||z|js%|t#d5|z|}t#dB}t#dC}t8jsc|d8krAd9|zd:z}|||jsd;|zd|d dDrd|dE<|dFd?rd|dG<|S)Hz+Resolve opener options specific to revlogs.sflagprocessorsTrevlogv1revlogv2s changelogv2s generaldeltarschunkcachesizeNstorages#revlog.optimize-delta-parent-choicesdeltabothparentssdebugsrevlog.debug-deltas debug-deltasrevlog.issue6528.fix-incomingsissue6528.fix-incomingsrevlog.reuse-external-deltaFs"revlog.reuse-external-delta-parents lazydeltas lazydeltabasersmaxdeltachainspanrsmmapindexthresholds sparse-readssparse-read.density-thresholdssparse-read.min-gap-sizeswith-sparse-readssparse-read-density-thresholdssparse-read-min-gap-size sparse-revlogs maxchainlensrevlog-compression-sexp-compression--s compenginesrevlog.zlib.levels zlib.level s8invalid value for `storage.revlog.zlib.level` config: %dsrevlog.zstd.levels zstd.levels8invalid value for `storage.revlog.zstd.level` config: %dsenableellipsiss rust.indexs#revlog.persistent-nodemap.slow-path)rhwarnrksMunknown value for config "storage.revlog.persistent-nodemap.slow-path": "%s" s"falling back to default value: %s sQaccessing `persistent-nodemap` repository without associated fast implementation.s@check `hg help config.format.use-persistent-nodemap` for detailsrs warning: rM(s) rkrlrysdirstate-v2.slow-paths7unknown value for config "dirstate-v2.slow-path": "%s" sJaccessing `dirstate-v2` repository without associated fast implementation.s9check `hg help config.format.use-dirstate-v2` for detailssrevlog.persistent-nodemap.mmapspersistent-nodemap.mmapdevelsdevel-force-nodemap)rQrrrGENERALDELTA_REQUIREMENTrrr/ gddeltaconfig configbytesfloatrSPARSEREVLOG_REQUIREMENT revlogconstSPARSE_REVLOG_MAX_CHAIN_LENGTH startswithsplitrrr NARROW_REQUIREMENTNODEMAP_REQUIREMENTconfig_defaultwarnquietr,HAS_FAST_PERSISTENT_NODEMAPDIRSTATE_V2_REQUIREMENTrHAS_FAST_DIRSTATE_V2)rr+rzr|chunkcachesizedeltabothparents issue6528 lazydelta lazydeltabase chainspanmmapindexthresholdwithsparsereadsrdensitythres srmingapsize sparserevlog maxchainlenrprefixmsg slow_pathdefaultrms rQrrsG!#G +|;;# +|;;# .,>>"&/<??#' \\)->??N!%3!"}}:$4G   mmH6KLLGN j*JKKI)2G %& j*HIIIM  =  #1"555 %GL -G 0DEEII~~(1$%9NOO%);%&]]?NCCN /#CDDN>>/3NOOL#1G  0>G ,-+7G '(";|KL ,G (#' KA!@ ,,y.+FFK"- 99  6( ) ) 9VV4G-H-H 9%&WWT1%5%5a%8GM "\\*6JKKGM})W]+0000q0000OPPC+cGM$::;; ;\\*6JKKGM})W]+1111r1111OPPC+cGM$::;; ;)\99%)!" }}_m44&!% *l::II >   9 9 9''BGIC GGC)O $ $ $8 M@AAGKLLLI $     1 2G##"S(50 x"$;/DGGDMMMH$$k#D1111)-%&.,>>IIj*BCC 9 9 9'' 4LMMGOPPC GGC)O $ $ $8 M@AAGKLLLI $   L  , 2G##"S(50 x"$;/DGGDMMMH$$k#D1111 }}Z!BCC3.2*+ }}X455/*.&' NrUc tS)z6Produce a type conforming to ``ilocalrepositorymain``.)r)rs rQmakemainr!s rUceZdZdZdZdS)revlogfilestoragez File storage when using revlogs.ct|dr |dd}tj|j|SN/r)rrsvfsrLres rQfilezrevlogfilestorage.files7 ??4  8Dty$///rUNrVrWrXrYr)rrUrQr#r#s)**00000rUr#ceZdZdZdZdS)revlognarrowfilestoragez1File storage when using revlogs and narrow files.c|dr |dd}tj|j||jSr%)rr narrowfilelogr'_storenarrowmatchr(s rQr)zrevlognarrowfilestorage.files= ??4  8D$TYd6LMMMrUNr*rrUrQr,r,s.;;NNNNNrUr,c |tj|tjtj|vrt StS)z=Produce a type conforming to ``ilocalrepositoryfilestorage``.)rbr9 REPO_FEATURE_REVLOG_FILE_STORAGErrQrr,r#)r+rzrs rQmakefilestorager2sF LL<=== LL5666)\99&&  rUctSrD)r!rrUrQrxrxshrUctSrD)r2rrUrQrxrxs_rUceZdZdZejejejejej ej ej ej ej ejejejejejejejejejejejhZhdZ ddZdZdZdZdZd Z e!d Z"e!d Z#d Z$d Z%dZ&ddZ'e(dddddZ)dZ*e!dZ+e,dddZ-e,ddZ.e/dZ0e1dZ2e3ddZ4d Z5d!Z6e,e7j8d"Z9e,e7j8d#Z:e,e7j8d$Z;dd&Zd(Z?e>d)Z@eAd*ZBe!d+ZCd,ZDd-ZEd.ZFeFZGd/ZHd0ZId1ZJd2ZKdd3ZLd4ZMdd5ZNeOd6ZPd7ZQd8ZRd9ZSd:ZTd;ZUd<ZVd=ZWeAd>ZXd?ZYdd@ZZdAZ[dBZ\dCZ]dDZ^dEZ_dFZ`dGZadHZbddIZcddJZddKZeddLZfdMZgdNZhe>dOZie>dPZjdQZkdRZlddSZmdTZndUZoddVZpdWZqdXZreAdYZsdZZtdd[ZueAd\Zvd]ZweAdd^Zxd_Zyd`ZzdaZ{ddbZ|dcZ}eAddZ~deZdfZddhZddiZdjZdkZdlZeA ddnZeAddoZeAdpZeAdqZ ddsZdtZduZdvZddwZddxZdyZdzZd{Ze>d|Zd}Zd~ZddZdZdZ ddZdS)raQMain class for representing local repositories. All local repositories are instances of this class. Constructed on its own, instances of this class are not usable as repository objects. To obtain a usable repository object, call ``hg.repository()``, ``localrepo.instance()``, or ``localrepo.makelocalrepository()``. The latter is the lowest-level. ``instance()`` adds support for creating new repositories. ``hg.repository()`` adds more extension integration, including calling ``reposetup()``. Generally speaking, ``hg.repository()`` should be used. > bisect.statercache/dirstater]Nc||_||_||_||_|j|_||_|j|_||_t|_ |j j |_ ||_ ||_ | |_| |_| |_| |_d|_|jdds|jddr)||jj|j_g|_t/j|j|jj|_|jj|_|jj|_|jdds|jddrwt;j|jdr4||jjj|jj_n)||jj|j_d|_ tCj"|_#d|_$i|_%i|_&dx|_'x|_(|_)i|_*i|_+g|_,t[j-|_.i|_/i|_0tcj2||_3d|_4tjj6|jvrd|_4to|_8i|_9tuj;|dS)aCreate a new local repository instance. Most callers should use ``hg.repository()``, ``localrepo.instance()``, or ``localrepo.makelocalrepository()`` for obtaining a new repository object. Arguments: baseui ``ui.ui`` instance that ``ui`` argument was based off of. ui ``ui.ui`` instance for use by the repository. origroot ``bytes`` path to working directory root of this repository. wdirvfs ``vfs.vfs`` rooted at the working directory. hgvfs ``vfs.vfs`` rooted at .hg/ requirements ``set`` of bytestrings representing repository opening requirements. supportedrequirements ``set`` of bytestrings representing repository requirements that we know how to open. May be a supetset of ``requirements``. sharedpath ``bytes`` Defining path to storage base directory. Points to a ``.hg/`` directory somewhere. store ``store.basicstore`` (or derived) instance providing access to versioned storage. cachevfs ``vfs.vfs`` used for cache files. wcachevfs ``vfs.vfs`` used for cache files related to the working copy. features ``set`` of bytestrings defining features/capabilities of this instance. intents ``set`` of system strings indicating what this repo will be used for. Nr all-warnings check-lockssvfsFr)DG"--dhn==DHN! DGZ_ JN Z_ 7  h 8 8 EDG>> !#  *,, &("#% &2266"  0D4E E E"7D  ##% .t44444rUcDtjdfd }|S)zbuild a ward for self.vfsNc|}}|*tj|drtj|dsdS|dvrdS|jrt |jdzddr"d}|j|zdd d }tfd |Dr;||j  |jd zdd n\||j B j D]}|rdS|jdzdd |S)Nmodes _wlockref_lockrefNrsrbrr7s2accessing cache with vfs instead of cachevfs: "%s"s cache-vfs) stacklevelr)sjournal.sundo.s strip-backup/r7c3BK|]}|VdSrD)r)rqrres rQ z@localrepository._getvfsward..checkvfs..s/KKv4??6**KKKKKKrUwrite with no lock: "%s"r;swrite with no wlock: "%s") r6r&rrelenr develwarnany _currentlockrMrN_wlockfreeprefix) rer\r/rMrvfs_path_prefixesrorigfuncrrefrLs ` rQcheckvfsz-localrepository._getvfsward..checkvfss(4d+++C466D 'l;;'k::***ty)) 2C NNQ.001y)) QK!!#*<!PPP!  KKKK9JKKKKK $$T]33;G%%3d:#$-& ""4>22:#3Fv..!!047 )" JrUrDweakrefref)rLrkrmrls`` @rQr@zlocalrepository._getvfswardsD{4  + + + + + + + + ZrUc@tj|dfd }|S)zbuild a ward for self.svfsNcX||}}|tj|dsdS|dvrdS||jr|t |jdzd}||j|jd|zd|S)Nr[r]r^rrd)ra) r6r&rrYrerhrMrrf)rer\r/rMrkrls rQ checksvfsz/localrepository._getsvfsward..checksvfss(4d+++C466D|4#3D+#F#F|***t// 8C0014667  //7!!/$61"JrUrDrn)rLrkrtrls ` @rQrEzlocalrepository._getsvfswards>{4          rUc.|dSrD) _writecachesrs rQrzlocalrepository.closes rUcJ|jr|jdSdSrD)rIwriters rQrvzlocalrepository._writecachess2   )  & & ( ( ( ( ( ) )rUc~|jddrgt|}tjtj|d}|dt|z|jddr|tj |S)Nrsbundle2-advertisesclient)rolesbundle2=snarrow) rrrSr encodecaps getrepocapsrburlreqquoter8 NARROWCAP)rLrcapsblobs rQrz%localrepository._restrictcapabilitiess 7  o/C D D ;t99D)#Dy999H HH[6<<#9#99 : : : 7  oy 9 9 / HH^- . . . rUcBtj|j|jS)N)callbackr% pathauditorr _checknestedrs rQauditorzlocalrepository.auditor#s#DI8IJJJJrUcFtj|j|jddS)NFT)rrealfscachedrrs rQ nofsauditorzlocalrepository.nofsauditor)s,# I 1%    rUc||jsdS|t|jdzd}tj|}|d}tj|}|r~d|}||jvrJ||krdS||}| |t|dzdS| |~dS)z/Determine if path is a legal nested repository.FrNr&T) rrrer6pconvert splitpathrgsubstatesub checknestedpop)rLresubpath normsubpathctxpartsrrs rQrzlocalrepository._checknested1sty)) 5s49~~)++,mG,, &4jw'' YYu%%F%%[((4''&//C??73v;;?3D3D+EFFF  urUc t|SrD)rrs rQrzlocalrepository.peerWsrUc|S)zaReturn unfiltered version of the repository Intended to be overwritten by filtered repo.rrs rQrEzlocalrepository.unfilteredZs  rUc|jd|vr |dz|jz}tj|j}||||S)aReturn a filtered version of a repository The `name` parameter is the identifier of the requested view. This will return a repoview object set "exactly" to the specified view. This function does not apply recursive filtering to a repository. For example calling `repo.filtered("served")` will return a repoview using the "served" view, regardless of the initial view used by `repo`. In other word, there is always only one level of `repoview` "filtering". N%)rTr*newtyperErP)rLrvisibilityexceptionsrs rQrzlocalrepository.filtered`sZ   *t4/?/?$;!44Dt00:;;s43444rU) bookmarksr_)sbookmarks.currentr_)rrUrtcR|tj|SrD)_refreshchangelogr bmstorers rQ _bookmarkszlocalrepository._bookmarksrs(n     &&&rUc\dt|vr||`dSdSdS)z7make sure the in memory changelog match the on-disk one changelogN)rcurrenttransactionrrs rQrz!localrepository._refreshchangelogs; $t** $ $)@)@)B)B)J % $)J)JrUc|jjSrD)ractivers rQ_activebookmarkzlocalrepository._activebookmarks %%rU phaserootsruc6tj||jSrD)r& phasecacherBrs rQ _phasecachezlocalrepository._phasecaches t':;;;rUsobsstorec6tj|j|SrD)r$rrrs rQobsstorezlocalrepository.obsstores!$'4000rUc|j|jt j|jtj|j dS)N changelog)concurrencychecker) rprefetch_parentsr1rr5mayhavependingr revlogchecker get_checkerr)rMs rQrzlocalrepository.changelogsY &&(((z##  "49 - -,8,OO$   rUcB|j||jSrD)r1 manifestlogr/rs rQrzlocalrepository.manifestlogsz%%dD,BCCCrUr8c*|SrD) _makedirstaters rQrzlocalrepository.dirstates!!###rUc d}tjrfd}tj}tj}|jv}|jv}t jjjj j |j ||S)z3Extension point for wrapping the dirstate per-repo.Nc,tjSrD)r0matcherrsrQrxz/localrepository._makedirstate..sFN4$8$8rU)use_tracked_hint) r0 use_sparserQr DIRSTATE_TRACKED_HINT_V1r+rr7rr_dirstatevalidater=)rL sparsematchfnv2_reqthuse_dirstate_v2rs` rQrzlocalrepository._makedirstates  T " " 98888M 8  5 D$55!22 H G I  "    -    rUc |j||S#tj$rO|js>d|_|jtdt|z|j cYSwxYw)NTs-warning: ignoring unknown working parent %s! ) rrevr LookupErrorrFrr rr r>rLnodes rQrz!localrepository._dirstatevalidates  N  t $ $ $K    / /3, GHHDkk";    sAA<;A<c*tj|S)zdmatcher patterns for this repository's narrowspec A tuple of (includes, excludes). )r#loadrs rQ narrowpatszlocalrepository.narrowpatss t$$$rUctj|jvrtjS|j\}}t j|j||SN)includeexclude) rQrr+matchmodalwaysrr#rrrLrrs rQr/z!localrepository._storenarrowmatchsG  -T5F F F?$$ $? 7GLLLLrUctj|jvrtjSt j||j\}}t j|j ||Sr) rQrr+rrr#checkworkingcopynarrowspecrrrrs rQ _narrowmatchzlocalrepository._narrowmatchsX  -T5F F F?$$ $-d333? 7GLLLLrUFc*|r|ro|jsVtj|}tj|j|g}tj||Stj||jS|jS)amatcher corresponding the the repo's narrowspec If `match` is given, then that will be intersected with the narrow matcher. If `includeexact` is True, then any exact matches from `match` will be included even if they're outside the narrowspec. )rrrexactfiles unionmatcherintersectmatchers)rLr includeexactemnms rQ narrowmatchzlocalrepository.narrowmatch s  H =D$5$<$<$>$> =^EKKMM22*D,=r+BCC1%<<<-eT5FGG G  rUc^tj||||ddS)NTclearfilecache)r#save invalidate)rL newincludes newexcludess rQ setnarrowpatszlocalrepository.setnarrowpatss0k;777 t,,,,,rUcdt|jjftt|jjf|jt|jfiS)Nnull)rr=r>rs rQ_quick_access_changeid_nullz+localrepository._quick_access_changeid_null!s< gt189 gt189 K'4;/  rUc|j}|j}|jD]}||jkr|j|}|+||f}|||<|||<| |D]1}|tkr| |}||f}|||<|||<2|j }||jkr |||d<|S)N.) rrrErrparentsr>indexget_rev parentrevsrrp1) rLquickclrrpairrrrp1nodes rQ_quick_access_changeid_wcz)localrepository._quick_access_changeid_wc)s05577 __   (M))++  Dt{""(""4((C{;DE#JE$K]]3''  <<GGAJJ1vaa  !!## T[ -E$K rUc<dt|vr |jd=dSdS)Nr)rrFrs rQ!_quick_access_changeid_invalidatez1localrepository._quick_access_changeid_invalidateHs, &$t** 4 4 9::: 5 4rUcD|jtjvr|jS|jS)zan helper dictionnary for __getitem__ calls This contains a list of symbol we can recognise right away without further processing. )r?r* filter_has_wcrrrs rQ_quick_access_changeidz&localrepository._quick_access_changeidMs& ?h4 4 41 1//rUc |tjSt|tjr|St|tr5fdt |tDSj |}||\}}tj ||dS|dkrIj }j |}tj ||S t|trj |}|}n|dkrGj}j |}nnt|jjkr |}j |}n2#t*j$rt/|}t0$rr`|jvr3t7d}t+j|t;|zt/|}wxYwt|djjzkr*t=|}j |}n8t+jd|tAj!tE|fztj ||S#t*j#t*jf$r7t+j$t7d tAj!|ztJt0f$r7t+j&t7d tAj!|zt*j'$rtjcYSwxYw) Nc<g|]}|jjv|Sr)r filteredrevs)rqirLs rQ z/localrepository.__getitem__..bs7DN777Q777rUF)maybe_filteredtiprs*working directory has unknown parent '%s'!rs$unsupported changeid '%s' of type %ssfiltered revision '%s'unknown revision '%s')(r workingctxrbasectxslicerangeindicesrerr} changectxrtiprintrrrrEr=nodelenrFilteredLookupErrorrrrrrr r rrr(rrNFilteredIndexErrorFilteredRepoLookupError IndexErrorRepoLookupErrorWdirUnsupported)rLchangeid quick_accessrrrs` rQ __getitem__zlocalrepository.__getitem__Xs  %d++ + h 0 0 O h & &  0 0T ; ;< 266x@@  #$IC$T3UKKK K v  >%%''D.$$T**C$T355 52 ,(C(($ ~**844T!!}''))oo''155d;;X$"4"<<<#D.,,X66CC0"8}}H"     A$(9(9(B(J(J(L(LLL MNN#k#h*?@@@"8}}H X!d&8&@"@@@8}}n((..,;!1$x..!A!ABC $T355 5(%*CD   /+,,x/?/I/II K(   '*++h.>x.H.HH $ , , ,%d++ + + + ,s.BL %GL B-I00BL B9OOcD ||dS#tj$rYdSwxYw)z!True if the given changeid existsTF)rr)rLrs rQ __contains__zlocalrepository.__contains__s:  NN4$   55 s  cdSrrrs rQ __nonzero__zlocalrepository.__nonzero__rrUcR|}t|jSrD)rErer)rLrOs rQ__len__zlocalrepository.__len__s!  4>"""rUc*t|jSrD)iterrrs rQ__iter__zlocalrepository.__iter__sDN###rUc`tj|g|R}tj||S)aFind revisions matching a revset. The revset is specified as a string ``expr`` that may contain %-formatting to escape certain types. See ``revsetlang.formatspec``. Revset aliases from the configuration are not expanded. To expand user aliases, consider calling ``scmutil.revrange()`` or ``repo.anyrevs([expr], user=True)``. Returns a smartset.abstractsmartset, which is a list-like interface that contains integer revisions. )r.spectreer- makematcher)rLexprrtrees rQrevszlocalrepository.revss7"4/$///'v!$''---rUc'@K|j|g|RD] }||V dS)aVFind revisions matching a revset and emit changectx instances. This is a convenience wrapper around ``revs()`` that iterates the result and is a generator of changectx instances. Revset aliases from the configuration are not expanded. To expand user aliases, consider calling ``scmutil.revrange()``. N)r")rLr rrs rQrSzlocalrepository.setsD4'$'''  Aq'MMMM  rUch|dgkrtjtgS|dgkr7|jd}|tj|dgS|r0tj|j|tj||}ntjd||}||S)a<Find revisions matching one of the given revsets. Revset aliases from the configuration are not expanded by default. To expand user aliases, specify ``user=True``. To provide some local definitions overriding user aliases, set ``localalias`` to ``{name: definitionstring}``. rrNr)r localalias)r%)r-basesetrrr}matchanyrlookupfn)rLspecsuserr% quick_datarss rQanyrevszlocalrepository.anyrevss WI  >7),, , TF??488>>J%~z!}o666  Dt,,% AAe CCCAqwwrUcd|jzS)Nsfile:rrs rQrzlocalrepository.urls$)##rUc 6tj|j|||fi|S)zCall a hook, passing this repo instance. This a convenience method to aid invoking hooks. Extensions likely won't call this unless they have registered a custom hook or are replacing code that is expected to call a hook. )rr)rLrthrowrs rQrzlocalrepository.hooks$y$e<.tagscachec>dx|_|_dx|_|_dSrD)r3tagtypes nodetagscachetagslistrs rQr`z6localrepository._tagscache..tagscache.__init__s% -10 DM599"T]]]rUN)rVrWrXr`rrUrQ tagscacher2s# : : : : :rUr7) _findtagsr3r4)rLr7caches rQ _tagscachezlocalrepository._tagscachesT : : : : : : : : %)^^%5%5" EN rUci}|jjr|\}}n |jj}|jj}|D]2\}} |||||<#tjtf$rY/wxYw|S)zreturn a mapping of tag to node) rrr8r:r3rrrrr)rLtr3ttrkvs rQr3zlocalrepository.tagss  > & (~~''HD""?'Dn JJLL  DAq A!%z2    sA**BBctj|j|}d|D}tj|j|||i}|D]*\}\}}||jkr||t j|<+|j |d<d|D}||fS)auDo the hard work of finding tags. Return a pair of dicts (tags, tagtypes) where tags maps tag name to node, and tagtypes maps tag name to a string like 'global' or 'local'. Subclasses or extensions are free to add their own tags, but should be aware that the returned dicts will be retained for the duration of the localrepo object.ci|]}|dS)sglobalr)rqtags rQ z-localrepository._findtags..6s666sC666rUrc>i|]\}}tj||Sr)rtolocal)rqrrTs rQrCz-localrepository._findtags..Cs6   .;tUH T " "E   rU) tagsmodfindglobaltagsr readlocaltagsrr>rrErr)rLalltagsr4r3rrhists rQr8zlocalrepository._findtags%s($7766g666dgtWh??? $+MMOO 4 4 T.Ys"'H'H'H71aA'H'H'HrU)r:r6r3rr~rrr)rLlr<rrs rQr6zlocalrepository.tagslistSs' IA ))++ 8 81$.,,Q//A67777'H'HfQii'H'H'HDO $''rUcf|jjsi}|jjD].\}}||g|/|D]}|||j_|jj|gS)z&return the tags associated with a node) r:r5r3r setdefaultr~valuessortr})rLrr5r<rrr3s rQnodetagszlocalrepository.nodetags]s, :M,2244 : :1((B//66q9999%,,..   ,9DO ),00r:::rUc6|j|S)z;return the list of bookmarks pointing to the specified node)rrrs rQ nodebookmarkszlocalrepository.nodebookmarkshs$$T***rUc|j|S)zkreturns a dictionary {branch: [branchheads]} with branchheads ordered by increasing revision number)rHrs rQrzlocalrepository.branchmapls!$''rUct|js+tj||_|jSrD)rIrrevbranchcacherErs rQrZzlocalrepository.revbranchcacheqs4# O#,#;DOO>##--f55 5     +A.D,E,E,NOOO  s&)0AActj||}|$tjt d|z|S)Nr)r/ revsymbolrrrr)rLrrs rQrzlocalrepository.lookupsI s++0022 <'*B(C(Cc(IJJ J rUc||r|Stj||SrD)r hasbranchr/rdrars rQ lookupbranchzlocalrepository.lookupbranchsF >>   % %c * * J s++22444rUc|j}|jj}|j}g}|D]+}||}|dup||v }||,|SrD)rrrrr~) rLrrrrrrrrresps rQrzlocalrepository.knownsj ^("?  A AT 2Q(]3D MM$     rUc|SrDrrs rQrzlocalrepository.localrrUc<|jdddS)NphasesspublishT) untrusted)rrrs rQ publishingzlocalrepository.publishings!w!!)Z4!HHHrUc|sdS|sdS|djj S)NFTvisible)rrnrrrrs rQcancopyzlocalrepository.cancopysIzz|| 5   4==,,6CCCrUc*|j|jkrdSdS)z2the type of shared repository (None if not shared)rgN)rYrers rQrzlocalrepository.shareds ?di ' '8trUc4|jj|j|g|RSrD)r7reljoinr)rLrinsidefs rQwjoinzlocalrepository.wjoins#tx 17w7777rUcx||j}|d|||dSrD)r> setparentsr)rLrp2s rQrxzlocalrepository.setparentss@ :B T b"%%% ..00000rUc4tj|||||S)zcchangeid must be a changeset revision, if specified. fileid can be a file revision or node.)r)rfilectx)rLrerfileidrs rQr{zlocalrepository.filectxs( $&I    rUc4|jSrD)rgetcwdrs rQr~zlocalrepository.getcwds}##%%%rUc8|j||SrD)rpathto)rLrcwds rQrzlocalrepository.pathtos}##As+++rUc@||jvrg}|j|D]\}}|dkr tj|jd|g}d}|}|jD]G\}} ||r-| }|t|d }nH|s d}d|_ tj |ds|} | fd}d| j z|_ ||||f||j|<|j|S)N!rUc,tj||SrD)r;filter)scrs rQrxz-localrepository._loadfilter..s10E0ErU commandfilterrc|||SrDr)rroldfnrs rQrxz-localrepository._loadfilter..sUU1a[[rUzcompat-)rJr configitemsrrrrKrrrelstriprVr( getargspecr~) rLrrPpatcmdmfrparamsrfilterfnrs rQ _loadfilterzlocalrepository._loadfiltersS ) ) )A G//77 + +S$;;^DIsSE::&*&7&=&=&?&?ND(~~d++%!$SYY[[!1!8!8!:!:2EEB"1BK*2..q1=E,1HHHB"+en">(++D||D2HdCCCrUc >||j||}d|vr|j||nS|jj||fd|i|d|vr|j|ddn|j|ddt |S)zwrite ``data`` into ``filename`` in the working directory This returns length of written (maybe decoded) data. lbackgroundclosexFT)rrr<symlinkrxsetflagsre)rLrrflagsrrs rQwwritezlocalrepository.wwrite s ||D2HdCC 5== I  dH - - - - DIO$  0? CI   u}} ""8UD9999 ""8UE:::4yyrUc:||j||SrD)rrrs rQ wwritedatazlocalrepository.wwritedata s||D2HdCCCrUcr|jr|}nd}|r|r|SdS)z4return the current transaction or None if non existsN)rLrunning)rLtrs rQrz"localrepository.currenttransaction sC > !!BBB  "**,, ItrUc  jddsjddr.jt jdSj dr0t j tdtd d tj tj fz}ttj|}d |z}d d |dD}|r|}n jj}jjd}t/jdjdd} dkr!| rjfdfd} fd} t7j|j|ddt9|jj| | t> tAj!d<tEj!d<gj!d<ij!d<|j#d<j#d<j!j#d <$d!jj%fd"} $d#| &d$'fd%} (d&| &d'j)t/j_*tWj,S)(Nrr:r;stransaction requires locking)rjournalsabandoned transaction founds(run 'hg recover' to clean up transactionrls%.40f#%fsTXN:s pretxnopenT)r/txnnametxnidc8g|]\}}||t|fSrundonamerqr7xs rQrz/localrepository.transaction..= s)LLLVS!CHQKK(LLLrU)r_rgcdSrDr)rs rQrxz-localrepository.transaction..f sdrUrshook-track-tagsstripc}|Jtj|j|}|j}tj|j||}tj|j|||}|rRd|jd<|ddd5}tj||ddddS#1swxYwYdSdS)N1s tag_movedschanges/tags.changeswT) atomictemp) rF fnoderevsrrheadrevsdifftagshookargsr7 writediff) tr2rM oldfnodesnewheads newfnodeschanges changesfileoldheadsreporefs rQ tracktagsz.localrepository.transaction..tracktagsn s>wyy'''#-dgtXFF >2244#-dgtXFF "*47D)YOO@15CL./$"@$ )+w??? @@@@@@@@@@@@@@@@@@@@sCC Cc x|}|Jd}|jj|}|r^|jj|d}|dd}|ddrd}nd}t j||||t j|jd rtj d  D]l\}\}} j } | tj||| |j dd d it!j| mt j|jd r|j} j dD]\} \}} | D]} j } t)| | }| t-j||| |j dd d it!j| |j dd d it!jj dS)zwill run pre-closing hooksN)rssingle-head-per-branchrsaccount-closed-headsFspublic-changes-onlys immutablerppretxnclose-bookmarkrr/Tpretxnclose-phaserl pretxnclose)r)r)r)rrconfigsuboptionsr}r/enforcesingleheadrhashookrrrrrrr preparehookargsr(rrErrrr&)rrM singleheadopt singlehead singleheadsub accountclosedr?rrrrrr"rrdescrrrs rQvalidatez-localrepository.transaction..validate s$ IcNNN799D###HM++];J  8 8- H K - 1 1+U!! !$$%;UCC,!-JJ!+J)#t]J|DG%<== (.J|,2244))  $D*3;++--DKK 9$S I IJJJDI/"#,T22 |DG%9:: __&&0(* 9(=  $D*3#!{//11"2773<<00 F$:4c$J$JKKK! 0"&'066  DI  &* .6.@.M.M     rUc}|dS|r|jddStjdtjd|jdd|ddS)Njournal.narrowspecjournal.narrowspec.dirstatejournal.dirstateTr)rrxr# restorebackuprestorewcbackupr)rsuccessrMrrLs rQ releasefnz.localrepository.transaction..releasefn s799D|  5  ##D)))))(/DEEE*41OPPP ++D2EFFFt44444rUundo) validatorrcheckambigfilesr origrepolens obsmarkersrlrstxnidstxnnameschangess flush-fncachecl|jfd}}|J||dS)z@To be run if transaction is successful, will schedule a hook runc  }|Jtj|jdrtjd}|D]l\}\}}j}|tj ||||j d dditj |mtj|jdr| j}tjdd}|D]\} \}}| D]} j}t|| } |t#j | |||j d dditj ||j d dditj dS) Ntxnclose-bookmarkrr/Ftxnclose-phaserlc|ddS)Nrr)rs rQrxzUlocalrepository.transaction..txnclosehook..hookfunc.. sQqT!WrU)rtxnclose)r)r)r)rrrrrrrrrr rr(rrErrrr&)unused_successrM bmchangesrrrrrphasemvr"rrrrrs rQhookfunczClocalrepository.transaction..txnclosehook..hookfunc s*wyy'''<)=>>  &rz,'?'E'E'G'G H HI,5(jsC!{//11 I$=dC$M$MNNN! 0"''066 <):;;**4B$ 9-3D3DG-4  (jsC#'C#%;#3#3#5#5D#&rwws||#4#4D KK(>tS#(N(NOOO%DI 1&+#+"4T":":  ',080B80L0LrUN)r _afterlock)rrrMrrrs @rQ txnclosehookz1localrepository.transaction..txnclosehook sb |H! ! ! ! ! ! ! F799D### OOH % % % % %rUs txnclose-hooks -warm-cachecr}|J|j ddditj|jdS)z#To be run if transaction is abortedNtxnabortr/F)r)rr(rr)rrMrs rQ txnaborthookz1localrepository.transaction..txnaborthook) s_799D### DI  #( ,4,>s|,L,L     rUs txnabort-hooksrefresh-filecachestats)-rrrhrMrrrnestr'rUrVrrandomtimerr:sha1digestr _writejournal _journalfilesr r7rorprrr4 aftertransr1rrarerrSr addfinalizerx addpostclose_buildcacheupdateraddabort_refreshfilecachestatsrLr/registersummarycallback)rLrreportidbaseharrenamesrpvfsmapshouldtracktagsrrrrrrrrs`` @@@@rQr4zlocalrepository.transaction& s 7  h 8 8 NDG777%% % 9  J ' ' /011BCC   == v&&--// 0 0"  -tT GGG 4   LLt7I7I7K7KLLL  BBB H ::+d##D#N ',, /   8   ~..00H @ @ @ @ @ @&> > > > > > > > @ 5 5 5 5 5 50 $  I    w   J !(    &)YY >"$'EE =! " 9#% < % H"& J"$* J ')9:::- &- &- &- &- &- &^ '666 (?(?(C(CDDD      $l333 143NOOO R'b$777 rUcB|jdf|jdf|jdf|jdff}g}|jd}|||j|f|jdf|jdft j|df|jdff}|t|z|zS) Nrrrrjournal.branch journal.descjournal.bookmarksjournal.phaseroots)r'r7rdata_backup_filenamer~r bookmarksvfsr)rLfirstmiddle dirstate_dataends rQrzlocalrepository._journalfiles9 s Y # Y- . X5 6 X* +    ::;NOO  $ MM48]3 4 4 4 X( ) X '  #D ) )+? @ Y- .   uV}}$s**rUc>d|DS)Nc6g|]\}}|t|fSrrrs rQrz-localrepository.undofiles..M s'FFFvsAhqkk"FFFrU)rrs rQ undofileszlocalrepository.undofilesL s"FF1C1C1E1EFFFFrUcR|jddtj|dtj|d|jdt j|j|jddt||fztj |}|d| d|j d |j d dS) Nrrrrrs%d %s rrrr)r savebackupr# savewcbackupr7rxr fromlocalrarer rrr')rLrrs rQrzlocalrepository._writejournalO s    ':;;;&DEEEd$9:::  x1$-2F2F2H2HII     s4yy$6G(GHHH -d33  ,"6"6|"D"D    -ty/@/@/O/OPPPPPrUc|5|jdr|jt d|j|jd}tj|j|d|jj t|  ddddS|j t d ddddS#1swxYwYdS)Nrs%rolling back interrupted transaction )rUr_rTs%no interrupted transaction available F) rr'rUrstatusrr7r4rollbackr rar)rLrs rQrecoverzlocalrepository.recover^ sO YY[[  y ++ q!JKKLLL"h$IGL$0 !!!        " QHIIJJJ%                  sBC*5(C**C.1C.cdx}x}} |}|}|jdr=t j|d}||||t |||S|jtd t |||dS#t |||wxYw)Nrsrollbacks"no rollback information available r) wlockrr'rUr _rollbackreleaserr r)rLdryrunforcer(rdsguards rQr%zlocalrepository.rollbacks s!%%%w *JJLLE99;;Dy(( '5dKHH~~feW== GT5 ) ) ) ) QEFFGGG GT5 ) ) ) ) )GGT5 ) ) ) )sA-C'CCc|j} |jd}t |d|dd}}}t |dkr|d}|dz } |r|jrtd| ||fz} ntd| |fz} n!#t$rtd} d}YnwxYw|sH|d |d kr6|d kr0tj td td | | |rdS|j } ||j|jd} t!j|j| d|jt&t)j|} | dr| ddd|jdr|jddd||jjjt9fd| D}|r|t=j|dt=j |d|j dd |jd}|j !tEj#|nL#t$r?|td|j $zYnwxYwtKd|d D} t | dkr&| td| zn%| td | ztLj'(||)dS)!Ns undo.descrrr`rs8repository tip rolled back to revision %d (undo %s: %s) s4repository tip rolled back to revision %d (undo %s) s!rolling back unknown transaction rrcommits;rollback of last commit while not checked out may lose datasuse -f to forcerl)r_rUrr#sundo.bookmarksrT) checkambigsundo.phaserootsrc30K|]}| VdSrDr)rqphas_nodes rQrcz,localrepository._rollback.. s-::QXXa[[::::::rUsundo.narrowspecsundo.narrowspec.dirstates undo.dirstates undo.branchs>named branch could not be reset: current branch is still '%s' c6g|]}|Sr)r)rqr2s rQrz-localrepository._rollback.. s CCCQUUWWCCCrUs3working directory now based on revisions %d and %d s+working directory now based on revision %d )*rr7rOr^r reverboserrrr r$rr destroyingr'r4r%r rar rrUrenamerrrr3rgrr#rr setbranchrrErar mergestatemodr clean destroyed)rLr+r,r-rroldlenrdetailoldtiprrrr parentgonerar3s @rQr)zlocalrepository._rollback s] W 8==..99;;D&)$q'llDGT6TV4yyA~~aaZF #"* #(T6*+ LTN#   9::CDDD  dtF|33 8I8I+%)**   #  1-''))  H4955 Ivw    !-d33   0 1 1    !'0::::':::::  1 MMOOO  $T+= > > >  &t-H I I I M ' '.> ? ? ? ~66 ''(8(@(@AAAA   <m**,, - CCd4j.@.@.B.BCCCDDG7||a 1  EFFP  $ * *4 0 0 0 qs&BB))CC&AK--AL65L6c:tj|fd}|S)zcalled during transaction to build the callback updating cache Lives on the repository to help extension who might want to augment this logic. For this purpose, the created transaction is passed to the method. cN}|J||dSrD) updatecaches)rrMrs rQupdaterz3localrepository._buildcacheupdater..updater s4799D###   b ! ! ! ! !rUrn)rLnewtransactionrCrs @rQrz"localrepository._buildcacheupdater s4+d## " " " " " rUcV| |jddkrdS|}|rHd}|j|dt j}|dkr t j}t j}n| t j}t j |vr||j dt|kr|j d| d | d |j|t j|vr|j| t j|vr|j| t j|vrG|}|jD]}|||t j|vr1|d D]}|t j|vr2t=j|j||j t j!|vr|"t j#|vr'| d "t j$|vr]tJj&'D]@} | | } | | ?dSdS) awarm appropriate caches If this function is called after a transaction closed. The transaction will be available in the 'tr' argument. This can be used to selectively update caches relevant to the changes in that transaction. If 'full' is set, make sure all caches the function knows about have up-to-date data. Even the ones usually loaded more lazily. The `full` argument can take a special "post-clone" value. In this case the cache warming is made after a clone and of the slower cache might be skipped, namely the `.fnodetags` one. This argument is 5.8 specific as we plan for a cleaner way to deal with this for 5.9. Nssourcerza`full` argument for `repo.updatecaches` is deprecated (use `caches=repository.CACHE_ALL` instead)s5.9s post-clonersupdating the branch cache rs served.hidden)r4r)(rr}rEr deprecwarnr9 CACHES_ALLCACHES_POST_CLONECACHES_DEFAULTCACHE_BRANCHMAP_SERVEDrrerrrrH write_delayedCACHE_CHANGELOG_CACHEr update_cachesCACHE_MANIFESTLOG_CACHErCACHE_REV_BRANCHrZ branchinforxCACHE_FULL_MANIFESTrmanifestCACHE_FILE_NODE_TAGSrFrr"CACHE_TAGS_DEFAULTr3CACHE_TAGS_SERVEDCACHE_BRANCHMAP_ALLr* filtertablekeys) rLrfullcachesrOrrbcrrfiltrs rQrBzlocalrepository.updatecaches s >bkooi88HDD F    />  G  sF + + +*F}$$#5*FF ^.F  , 6 6zRZ7#d))CC <=== i((22444 .//99;;;"00666  +v 5 5 N ( (R ( 8 8 8  - 7 7   * *r * : : :  && 0 0%%''C^ " "q!!!! IIKKK  )V 3 3Dz))++     *f 4 4  dgtT^-@-@-B-B C C C  (F 2 2 IIKKK  '6 1 1 MM) $ $ ) ) + + +  )V 3 3 !,1133 5 5==..""$$**84444 4 3  5 5rUcdt|vr|jd=|j||jdS)Nr:)rrFrHclearinvalidatevolatilesetsrQrs rQinvalidatecachesz localrepository.invalidatecachesB s_ 4:: % % l+   """ ##%%% "((*****rUc|jtj||dSrD)rOr^r$clearobscachesrrs rQr_z&localrepository.invalidatevolatilesetsL s@ ##%%%%%% ..00000rUct|drY|jjD](} t|j|#t$rY%wxYwt|ddSdS)aInvalidates the dirstate, causing the next call to dirstate to check if it was modified since the last time it was read, rereading it if it has. This is different to dirstate.invalidate() that it doesn't always rereads the dirstate. Use dirstate.invalidate() if you want to explicitly read the dirstate again (i.e. restoring it to a previous known good state).rN)rrrr AttributeErrorrE)rLr>s rQinvalidatedirstatez"localrepository.invalidatedirstateQ s dJ / / 3]-  DM1----%D DOO%%z 2 2 2 2 2  3 3s6 AAc|}t|jD][}|dkr |dkr!|r |jjr0|r|j|= t||L#t$rYXwxYw| |s|j dSdS)a9Invalidates both store and non-store parts other than dirstate If a transaction is running, invalidation of store is omitted, because discarding in-memory changes might cause inconsistency (e.g. incomplete fncache causes unintentional failure, but redundant one doesn't). r8rN) rElistrrXrr_delayedr rdr`r1)rLrrEr>s rQrzlocalrepository.invalidateb s __&& do**,,--  AK\!!++--"N+" 'OA&  A&&&&!     &&(( * J ' ' ) ) ) ) )  * *s6B BBcV||dS)zyFully invalidates both store and non-store parts, causing the subsequent operation to reread any outside changes.N)rrers rQ invalidateallzlocalrepository.invalidateall s,  !!!!!rUc|jD]=\}}tj|}|dks ||jvr)|>dS)z>Reload stats of cached files so that they are flagged as validrN)rrr(rrFrefresh)rLrr>ces rQrz&localrepository._refreshfilecachestats se_**,,  EAr""AJ!4="8"8 JJLLLL   rUc d}d}|r6|jdd}|jdd}|jdd} tj|j||||||||  } | S)Nruistimeouts timeout.warnssignal-safe-lock)r acquirefnr signalsafe)rrrlockmodtrylock) rLr7locknamewaitrrprtimeout warntimeoutrqrPs rQ_lockzlocalrepository._lock s  Dg''z::G'++E?CCKW''/BCC O G    ! rUc|j|jfD]4}|o |}|r$|jr|j|dS5|ddS)zadd a callback to be run when the repository is fully unlocked The callback will be executed when the outermost lock is released (with wlock being higher level than 'lock').TN)rNrMheld postreleaser~)rLrrprPs rQrzlocalrepository._afterlock sk NDM2  C A QV  $$X... HTNNNNNrUTc ||j}|||S||jd|d|jt d|jz}tj ||_|S)a]Lock 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.) If both 'lock' and 'wlock' must be acquired, ensure you always acquires 'wlock' first to avoid a dead-lock hazard.Nslocks repository %s)r7rtrurrpr) rhrMrrxr'rrrrorp)rLrurPs rQrzlocalrepository.lock s   dm , , = FFHHHH JJ o#$$t}4    A rUc jrnd}||jr||S|rjjddsjddr4jjdfd}j d||j tdj z}tj|_|S) a8Lock 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. If both 'lock' and 'wlock' must be acquired, ensure you always acquires 'wlock' first to avoid a dead-lock hazard.Nrr:r;s"wlock" acquired after "lock"cjrjnjdjddS)Nr8)rpendingparentchangerrxrrlrsrQunlockz%localrepository.wlock..unlock se}0022 * ((**** ##D))) OK ( 0 0 2 2 2 2 2rUswlocksworking directory of %s)rNrzrrrrhrMrfrxr7rerrrorp)rLrurPrs` rQr(zlocalrepository.wlock s!% 8DNN   D =QV= FFHHHH  D G  x 9 9 Dw!!(N;; D  //;!!"BCCC 3 3 3 3 3 JJ H     # ( ) )DM 9   !QrUc8|dS|}||jsdS|S)z3Returns the lock if it's held, or None if it's not.N)rz)rLlockrefrPs rQrhzlocalrepository._currentlock s, ?4 GII 9AF94rUc6||jS)z4Returns the wlock if it's held, or None if it's not.)rhrNrs rQ currentwlockzlocalrepository.currentwlock s  000rUc|s|r)t|j|jz|jz}|D]}|j|}|dks ||vs ||j vr0||j vr||td|j |s'||r;|dz}|D]}||rn||td||jvr||tddSdS)z2check for commit arguments that aren't committablersfile not found!r&sno match under directory!sfile not tracked!N)isexactrrSmodifiedaddedremovedrr normalizerdeletedrr<rrhasdirr) rLwctxrr$failmatchedrdrs rQcheckcommitpatternsz#localrepository.checkcommitpatterns sx ==?? 5ellnn 5&/FL86>IJJG[[]] 5 5M++A..99W T]0B0B&&DA0112229??1%%5)9)9!)<)<5DA%AA==++"!E"Q"> ? ?@@@dm++DA233444% 5 5 5 5rUrUc l |i}d}|stj}|s||_55d} t | dk} |s7| r5|s!tjtd ||} |r| j | j tjj| | ||\} } }|s| || |t%j| ||||}t(j}t/j||rbjddsGjd | dddddddS| r5|r!tjtd |r||| |_||jk}|j}| rtAj!}tE| D]}| #|}j td |tj$|z|%|j||}||d |f||<tj&|j'\}}tQ||j)krtQ|pd c *dd+d5,|dt[j.||g|/|dddn #1swxYwYn\#|rTj0td|zj0td|zxYwdddn #1swxYwYdddn #1swxYwYfd}1|S)zAdd a new revision to current repository. Revision information is gathered from the working directory, match can be used to filter the committed files. If editor is supplied, it is called to get a commit message. Nc4tjd||fz)Ns%s: %s)r InputError)rrs rQrz$localrepository.commit..fail8 s"93x#788 8rUrsBcannot partially commit a merge (do not specify files or patterns))rr:)r,rosallowemptycommits(nothing to commit, clearing merge state s&cannot commit merge with missing filesscommitting subrepository %s rrUs precommitT)r/parent1parent2r/s!note: commit message saved in %s s6note: use 'hg commit --logfile %s --edit' to reuse it cjr(dtdSdS)Nr/)rrr)rhasnoderr)rhookp1hookp2r/rLs rQ commithookz*localrepository.commit..commithook s[~%%c**  CHHff  rU)2rrbadr(rrerrr rr$rextendr:r2 precommitrrrworkingcommitctxr9r rOr!checkunresolvedisemptyrrresetr_textsavecommitmessager/ getuipathfnrr subrelpathr writestaterrr>rr4 commitctxr r markcommittedrxr)rLtextr*daterr,editorextrarrmerger$subs commitsubsnewstatecctxmseditedmsg_pathuipathfnrrsrrryrrrr/s` @@@rQrzlocalrepository.commit$ s0" =E 9 9 9 &O%%E EIZZ\\[ [ 499;;[ [ :D ''!+E U 5<<>> k>[[uE[::F &&L *5)>vuE*** &D*h  D((ufdCCC+fdD$D)..t44B  %b ) ) )||~~ dg&8&8*''  JKKK Q[ [ [ [ [ [ [ [ [ [ [ [ [ [ T P Pk!$M"N"NOOO 6#VD$55 TZ'F --dj99H 7".t44 ++77A((1++CGNN:;;"(;#9##>#>??@DJd;;B#+A;q>2"6HQKK&tX666]**,,FB WWrT['8'DSWW'KNFF   ff%%i00..t44C$TB8S999&&s+++HHJJJ   GMM?@@8KGMM8# #w[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ z          ### sR FQ5 R 0E>Q5/.P AP5 P P P P P  Q5 AQ&&Q5) R 5Q9 9R <Q9 =R  RRc2tj||||S)N)rorigctx)rr)rLrrrs rQrzlocalrepository.commitctx scHHHHrUc^dt|vr|jdSdS)aInform the repository that nodes are about to be destroyed. Intended for use by strip and rollback, so there's a common place for anything that has to be done before destroying history. This is mostly useful for saving state that is in memory and waiting to be flushed when the current lock is released. Because a call to destroyed is imminent, the repo will be invalidated causing those changes to stay in memory (waiting for the next unlock), or vanish completely. rN)rrrxrs rQr6zlocalrepository.destroying s8 DJJ & &   " " $ $ $ $ $ ' &rUc|j||j||dS)zInform 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)r filterunknownrxrBrrs rQr;zlocalrepository.destroyed s\ &&t,,,      rUrcB||||||||S)z3a convenience method that calls node1.status(node2))r$)rLnode1node2rignoredr:unknown listsubreposs rQr$zlocalrepository.status s-E{!! 5'5'<   rUc:|j|dS)aAdd a callback to run within the wlock, at the point at which status fixups happen. On status completion, callback(wctx, status) will be called with the wlock held, unless the dirstate has changed from underneath or the wlock couldn't be grabbed. Callbacks should not capture and use a cached copy of the dirstate -- it might change in the meanwhile. Instead, they should access the dirstate via wctx.repo().dirstate. This list is emptied out after each status run -- extensions should make sure it adds to this list each time dirstate.status is called. Extensions should also make sure they don't call this for statuses that don't involve the dirstate. N)rPr~)rLpss rQaddpostdsstatuszlocalrepository.addpostdsstatus s!( !!"%%%%%rUc|jS)zAUsed by workingctx to get the list of post-dirstate-status hooks.rPrs rQ postdsstatuszlocalrepository.postdsstatus s !!rUc|jdd=dS)z7Used by workingctx to clear post-dirstate-status hooks.Nrrs rQclearpostdsstatusz!localrepository.clearpostdsstatus s  qqq ! ! !rUc|6|jt}fd|DS|j|}t ||jjdS)Nc:g|]}|Sr)r)rqrrs rQrz)localrepository.heads.. s#555SBGGCLL555rUT)rreverse)rreversedrrrr)rLstartrrrs @rQrzlocalrepository.heads sm =B ..H5555H555 5$$U++e!3TBBBBrUcv||d}|}||sgStt |||}|=t |j|g|dfd|D}|S)aVreturn a (possibly filtered) list of heads for the given branch Heads are returned in topological order, from newest to oldest. If branch is None, use the dirstate branch. If start is not None, return only heads reachable from start. If closed is True, return heads that are marked as closed as well. N)closedrcg|]}|v| Srr)rqhfbheadss rQrz/localrepository.branchheads..) s888A1<$Z&&((F>>##!!&)) Ihx33F63JJKKLL  $.55ugvFFqIJJG8888888F rUc(|s|jg}g}|D]p}|} |j|}|d|jks|d|jkr&||||d|dfn |d}kq|S)NTrr)rrrr>r~)rLrr5rrr<r2s rQrAzlocalrepository.branches, s +^''))*E   AA N**1--Q44;&&!A$$+*=*=HHaAaD!A$/000aD  rUc&g}|D]\}}|gd}}}d}||krc||jkrX|j|d} ||kr|||dz}| }|dz }||kr ||jkX|||S)Nrrr)r>rrr~) rLr?rtopbottomrrrPrrr2s rQr>zlocalrepository.between: s   KC2q!qAAv++!t{"2"2N**1--a066HHQKKKAAQ v++!t{"2"2 HHQKKKKrUcdS)zExtensions can override this function if additional checks have to be performed before pushing, or call it if they override push command. Nr)rLpushops rQ checkpushzlocalrepository.checkpushM srUc(tjS)zReturn util.hooks consists of a pushop with repo, remote, outgoing methods, which are called before pushing changesets. )r6hooksrs rQprepushoutgoinghooksz$localrepository.prepushoutgoinghooksS s z||rUc }i}|||jtj|}|d<|d<|d<|d<jd ddi|n}#t j$rk}j td|z|j r/j td |j zYd}~d Sd}~wwxYwj d fztj  fd }| S)Nrrrr prepushkeyr/Tspushkey-abort: %s s(%s) Fspushing key for "%s:%s" c>ddS)Nr)rrrrr/)r)rrrrrr/rLs rQrunhookz(localrepository.pushkey..runhookn s: II#      rU)r)rrrr(rrr HookAbortr write_errrrmrr'pushr) rLrrrrrrr1rr/s ````` @rQr'zlocalrepository.pushkeyZ s ((**BH~ ,,,)(33H$-H[ !!HUO!HUO!HUO DI < <4 <8 < < < <    G  a 677#= > > >x ;!!!I,,"9:::55555    2i5EEFFFl4Cc::               sA)A22C,A C''C,c|dd||jd|ztj||}|d|||S)Ns prelistkeysT)r/rslisting keys for "%s" slistkeys)rrS)rrrr'rg)rLrrSs rQrzlocalrepository.listkeys{ sb . BBB  09<===dI.. +6 BBB rUcd||tj|tj|tj|fzS)z+used to test argument passing over the wirerrrs rQrzlocalrepository.debugwireargs rrUc$|dd} |||n#|wxYw||jt |jdzdS)Nslast-message.txtswbr)r7rxrrrrer)rLrfps rQrz!localrepository.savecommitmessage sw XX)5 1 1  HHTNNN HHJJJJBHHJJJJ{{273ty>>A#5#7#78999s AActj|jvrdS|jt j|dSrD)r9rrzrrbr(r)rLcategorys rQregister_wanted_sidedataz(localrepository.register_wanted_sidedata s?  ,DM A A F !!("28"<"<=====rUc|tjvr&td}tj||zt j|}||j|gv}|r(|s&td}tj||z|r(|s&td}tj||z|j |i|||f|j||<dS)Nsunexpected revlog kind '%s'.s<cannot register a sidedata computer twice for category '%s'.sKcannot replace a sidedata computer that isn't registered for category '%s'.) r ALL_KINDSrrrr(rrVr}rR) rLkindrrXcomputerrreplaceralready_registereds rQregister_sidedata_computerz*localrepository.register_sidedata_computer s {, , ,344C(t44 4#H--%)A)E)EdB)O)OO  9g 9OC(x88 8  9- 9&C(x88 8  ++D"55548(E3J &x000rUrDr)FN)Fr8)FF)NFN)T)rUNNNFNN)rNNFFFF)NNF)rVrWrXrYrQARCHIVED_PHASE_REQUIREMENTBOOKMARKS_IN_STORE_REQUIREMENTrrrr rrrINTERNAL_PHASE_REQUIREMENTrrRrrrrrrrrrrir`r@rErrvrpropertyrrrrrErrrrrrmrrrrrrrr]rrrr#FILENAMErr/rrrrrrrrrrrr__bool__rrr"rSr,rrrr:r3r8rMr6rUrWrrZr^r`rrgrrrnrqrrvrxr{r~rrrrrrrrrrr4rrrr&r%r)rrBr`r_rerrjrrxrrr(rhrrrrr6r;r$rrrrrrAr>rrr'rrrrrrrUrQrrs[    26/-0/-+02+3,,*-*0)0)N2@Y5Y5Y5Y5v111f,)))   KKXK   X $$$L 5555$ (  2'2'  2'h &&X& Z /00<<10<Z 111^   DDD];$$ $   *   Z #$$%%%$%Z #$$MM%$M Z #$$MM%$M!!!!&---   <;;;00X0M,M,M,^H### $$$...   2$$$====,"! ! ! F 5 5 5((( ; ; ;+++((( $$$ >>>  555   III DDD 8881111     &&&,,,,(((4   ++++++)))DDD$DDD   QQQQf+++&GGG Q Q Q* * * * *ZZZx"O5O5O5O5b+++111 333""*"*"*"*H"""<   .''''R111555,  CCCCJIIII%%%"B     &&&,""""""CCCC*   &    B    :::>>>>CKKKKKKrUrc*d|Dfd}|S)Nc,g|]}t|Sr)r)rqr<s rQrzaftertrans.. s+++588+++rUcD]B\}}}|| |||3#t$rY?wxYwdSrD) tryunlinkr7r)r7srcdest renamefiless rQazaftertrans..a sr)  NCd MM$     3%%%%$      s7 AAr)rrrs @rQrr s6++U+++K      HrUctj|\}}|dsJtj||dddS)Nrrr)osrerrrgr)rrWrs rQrr sWr""JD$ ??: & &&&& 7<<dll:wBB C CCrUcddlm}tj||rt |fd}|}|||}|S)Nrri createoptsc(tS)N)ry)r)ry localpathrsrQ repo_makerzinstance..repo_maker s"2y'BBBBrU)rrjr= urllocalpathcreaterepositorymay_auto_upgrade) rrecreateryr rjr rMr s ` ` @rQinstancer s$T**I ?Y:>>>>CCCCCCC :<|tj|tj|ddr|tj|dd}|dkr|tj|dd}|dkr>|tj|tj|ddr|tj|ddr|tj|dr|tj|dr|d|ddr|tj |dd r|tj!|dd!r|tj"d"|vrtG|d"j$}tj"|vr|}nFtG} |D]+} | tj%vr| |vr| | ,|| z}||z}|d#r |tj&n|tj'|dd$rt|(dd%} td&} td'} | d(kr|)| | z| n|tj*|S))zDetermine the set of requirements for a new local repository. Extensions can wrap this function to specify custom requirements for new repositories. rsFbackend key not present in createopts; was defaultcreateopts() called?rsCunable to determine repository requirements for storage backend: %srsusestores usefncaches dotencodesrevlog-compressionsIcompression engines %s defined by format.revlog-compression not available, c3 K|] }d|zV dS)s"%s"Nr)rqrs rQrcz&newreporequirements..-s&::1::::::rUs;run "hg debuginstall" to list available compression enginesrlrsrevlog-compression-zstdszlibrrsuse-dirstate-v2s"exp-use-copies-side-data-changesetrrsexp-use-changelog-v2s*enable-unstable-format-and-corrupt-my-datarsuse-internal-phasesexp-archived-phase narrowfilesrsbookmarks-in-storesuse-persistent-nodemapuse-share-safe sharedreposharedrelativesuse-dirstate-tracked-hints!use-dirstate-tracked-hint.versions)ignoring unknown tracked key version: %d s<see `hg help config.format.use-dirstate-tracked-hint-versionr)+rrr rrQrrrbrrr configlistr6rrrrgr/ gdinitconfigrrr rrrrrrrrr}rrrrrSr+rrRrrr r)rr r+r compenginer changelogv2revlogv2source_requirementsto_dropreqversionrrms rQrrs]##$ /   *,,k '  $  %   $89L }}Y ,,H:;;; ==M 2 2 H   _@ A A A}}Y 55 H  !FGGG-- +@AAK!  ) ) )%j1F!! f&9&9&;&; k ;  jj::k:::::  ; '    W34444 w  .;<<<BGABBB ==$4 5 5 G   _E F F F }}Y 233B@AAA }}Y EFF@@AAA>??? }}_o66CABBB))I'>??KCCC@AAAyy+66H@@@_ABBB=>>> }}Y 566ECDDD }}Y 566ECDDD~~n%%=;<<<~~f!    }}Y 566IGHHH }}Y 9::><=== }}Y 122@>??? ""!*]";"HII  08K K K/LLeeG# ! !/BBB--- C    G #L / /L >>+ , , A   _H I I I I   _? @ @ @ }}Y <== G,,y*NOO=>> K   a<< GGC'MG - - - -   _E F F F rUc$t}tj|vrtj|vrA|t d|tjtj|vstj|vr!tj t dtj |vrY| ddr$t d}|||tj |S)zChecks compatibility of repository requirements enabled and disabled. Returns a set of requirements which needs to be dropped because dependend requirements are not enabled. Also warns users about itsvignoring enabled 'format.bookmarks-in-store' config beacuse it is incompatible with disabled 'format.usestore' config s\cannot create shared repository as source was created with 'format.usestore' config disabledrr"srignoring enabled 'format.use-share-safe' config because it is incompatible with disabled 'format.usestore' config ) rSrQrrr rrbrrRrr rr)rr+droppedrs rQcheckrequirementscompatr0s eeG( <<  9\ I I GG4    KKF G G G  ., > >:lJJ+?   0L @ @||I'899 !  KK= > > > NrUcLhdfd|DS)a%Filters a dict of repo creation options against options that are known. Receives a dict of repo creation options and returns a dict of those options that we don't know how to handle. This function is called as part of repository creation. If the returned dict contains any items, repository creation will not be allowed, as it means there was a request to create a repository with options not recognized by loaded code. Extensions can wrap this function to filter out creation options they know how to handle. >shallowfilestorerrr#r! shareditemsr$c$i|] \}}|v || Srr)rqr>r?rs rQrCz)filterknowncreateopts..s$ B B BTQ1E>>Aq>>>rU)r)rr rs @rQfilterknowncreateoptsr5s=   E C B B BZ--// B B BBrUc*||d}tj|i}nt||}t||}t |t stjd|rStjtddt|ztdt||}|t||z}tj |d d }tj |d }|r$tjtd |zd |vr|d j}|dr t$j||j}t-j|}nN#t0t2f$r:} tjtdt5j| d} ~ wwxYw|s||d d |vr|d|dt>j |v} | r/d |vr+|d|!ddtEj#|\} } tEj$|| | rBd |vr>tj |dd } tEj$| | d |vr|%d||drCdt|ddz}|%d|dSdS)a7Create a new repository in a vfs. ``path`` path to the new repo's working directory. ``createopts`` options for the new repository. ``requirement`` predefined set of requirements. (incompatible with ``createopts``) The following keys for ``createopts`` are recognized: backend The storage backend to use. lfs Repository will be created with ``lfs`` requirement. The lfs extension will automatically be loaded when the repository is accessed. narrowfiles Set up repository to support narrow file storage. sharedrepo Repository object from which storage should be shared. sharedrelative Boolean indicating if the path to the shared repo should be stored as relative. By default, the pointer to the "parent" repo is stored as an absolute path. shareditems Set of items to share to the new repository (in addition to storage). shallowfilestore Indicates that storage for files should be shallow (not all ancestor revisions are known). Ns/cannot specify both createopts and requirementsrs-filterknowncreateopts() did not return a dictsBunable to create repository because of unknown creation option: %srs#is a required extension not loaded?rlTrbrdsrepository %s already existsr#r$scannot calculate relative path) notindexedrurvrgrus9 dummy changelog to prevent using the old repo layoutrerLr3rMsshared)&rrrr5rrr rrgrrr0rTr7rUrVrYr}rrerelpathrWr6rrrr<r-makedirsmakedirmkdirrQrr~r/filterrequirements writerequiresrx)rrer r+r unknownoptsr{rXrYr has_storewcreqstorereqr|rs rQrrs<  !DC(-- - &rjAAA +B ;; +t,, (@   ++**VK0011 2 =>>  +2*EEE /LAAA j$>>>G Jw||F++ , ,E ||~~Ioa ?@@4GHHH "" .9 >>+ , ,  W__ZDD !]:66 Z(   k788#033  >>   MMTM"""J&& H KK 1\AI ]*44 H      0>>OE8 %''' 2M33:ejj22FFFh111 "" M:...~~n%%'F:n#=>>??%G Iv&&&&&''s>9F88H 5G>>Hc|Gdd}t|d|dS)z9Poison a repository instance so it can no longer be used.ceZdZdZdZdS),poisonrepository..poisonedrepositorycl|dkrt||Stjd)Nrs/repo instances should not be used after unshare)r__getattribute__rr)rLitems rQrFz=poisonrepository..poisonedrepository.__getattribute__gs9w..tT:::(B rUcdSrDrrs rQrz2poisonrepository..poisonedrepository.closeos DrUN)rVrWrXrFrrrUrQpoisonedrepositoryrDfs2        rUrIrPN)rrr)rMrIs rQpoisonrepositoryrJ\sZ JJLLL         t[*<=====rUrD)NN)rrrrrro concurrentri18nrrrrrr r r(r r rr rrrrrrrrrrrrrrrrrrrrrr r9r!r"r#r$r%r&r'r)r*r+rQr,r-r.r/r0r1rr2r3rFr4r5r6r7rTr8 interfacesr9 interfaceutilutilsr:r;r<r= revlogutilsr>rr?rr@rWr*urlerrr}rSra filecacherBr]rmrrrrr propertycacherrrrrunionr< implementeripeercommandexecutorr ipeercommandsrripeerlegacycommandsr:rr[r`rrrrrrrrrr!ilocalrepositoryfilestorager#r,r2ilocalrepositorymainrrrrrrrrrr0r5rrJrrUrQr[s --------------------------------------------------------------------------------------------^  /   suu IIIIIW&III$ # # # # #N # # #               Z        z   $$$$$.$$$*   (((((d0(((22222D.222+++    34 5 5 ::;;*******<;*Z:344Q*Q*Q*Q*Q* Q*Q*54Q*l:9::PPPPPiPP;:PJCEE2 / / /||||~ ''''TKKK60   >   4 . . .$$$NbbbJ :ABB0000000CB0:ABBNNNNNNNCBN!!!"$&6&67+-D-DE ::;;~"K~"K~"K~"K~"K~"K~"K<;~"KDF   "DDD "    ,RRRj(((VCCC6{'{'{'{'|>>>>>rU