403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/__init__.cpython-39.pyc
a

�+�bĤ�	@sLdZddlmZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddl
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*dd	l+m,Z,mZm-Z-m.Z.m/Z/m0Z0m1Z2m3Z3m4Z4m5Z5m6Z6m7Z7ej8iZ9e#�8e9�Z8iZ:e#�;e:�Z;e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
dej<dgd�e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
ddd
�e;d
d dd
�e;d
d!dd
�e;d
d"dd
�e;d
d#dd
�e;d
d$d%d
�e;d
d&d'd
�e;d
d(d)d
�e;d
d*d+d
�e;d
d,d-d
�e;d
d.ej<�e;d
d/dd
�e;d
d0dd
�e;d
d1dd
�e;d
d2dd
�e;d
d3dd
�e;d4d5d6d6d7�e;d8d9dd
�e;d8d:d;d
�e;d<d=dd
�d>Z=e;d
d?e=d
�e;d
d@dAd
�fe;d
dBgdC�d
�e;d
dDdEd
�e;d
dFdGd
�e;d
dHdId
�e;d
dJdAd
�fe;d
dKdIgd
�e;d
dLdEd
�e;d
dMdNd
�e;d
dOdId
�dPZ>ej?Z@e@jA�Be,jC�e6jDZDdQdR�ZEdSdT�ZFdUdV�ZGdWdX�ZHdYdZ�ZId[d\�ZJd]d^�ZKd_d`�ZLdadb�ZMdcdd�ZNd�dedf�ZOdgdh�ZPdidj�ZQd�dkdl�ZRd�dmdn�ZSdodp�ZTd�dqdr�ZUdaVdsdt�ZWd�dudv�ZXdwdx�ZYe8dyge
dz�d6d{�d|d}��ZZd~d�Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zbe8d�d�d�de
d��fge
d��d6d{�d�d���Zce8d�d�d�de
d��fge
d��d6d{�d�d���Zde8d�dd�de
d��fdd�de
d��d�fge
d��d6d{�d�d���Zee8d�ge
d��d6d{�d�d���Zfe8d�ge
d���d�d���Zge8d�ge
d���d�d���Zhe8d�ge
d���d�d���Zid�d��Zje8d�d�d�ge
d��e
d��fdd4de
d��fd�d�de
d��fgejke
d��e8jld��d�d���Zme8d4dd�de
dÃdfdd�de
dŃdfdd�de
dǃdfge
dȃ�d�dʄ�ZndS)�aremotefilelog causes Mercurial to lazilly fetch file contents (EXPERIMENTAL)

This extension is HIGHLY EXPERIMENTAL. There are NO BACKWARDS COMPATIBILITY
GUARANTEES. This means that repositories created with this extension may
only be usable with the exact version of this extension/Mercurial that was
used. The extension attempts to enforce this in order to prevent repository
corruption.

remotefilelog works by fetching file contents lazily and storing them
in a cache on the client rather than in revlogs. This allows enormous
histories to be transferred only partially, making them easier to
operate on.

Configs:

    ``packs.maxchainlen`` specifies the maximum delta chain length in pack files

    ``packs.maxpacksize`` specifies the maximum pack file size

    ``packs.maxpackfilecount`` specifies the maximum number of packs in the
      shared cache (trees only for now)

    ``remotefilelog.backgroundprefetch`` runs prefetch in background when True

    ``remotefilelog.bgprefetchrevs`` specifies revisions to fetch on commit and
      update, and on other commands that use them. Different from pullprefetch.

    ``remotefilelog.gcrepack`` does garbage collection during repack when True

    ``remotefilelog.nodettl`` specifies maximum TTL of a node in seconds before
      it is garbage collected

    ``remotefilelog.repackonhggc`` runs repack on hg gc when True

    ``remotefilelog.prefetchdays`` specifies the maximum age of a commit in
      days after which it is no longer prefetched.

    ``remotefilelog.prefetchdelay`` specifies delay between background
      prefetches in seconds after operations that change the working copy parent

    ``remotefilelog.data.gencountlimit`` constraints the minimum number of data
      pack files required to be considered part of a generation. In particular,
      minimum number of packs files > gencountlimit.

    ``remotefilelog.data.generations`` list for specifying the lower bound of
      each generation of the data pack files. For example, list ['100MB','1MB']
      or ['1MB', '100MB'] will lead to three generations: [0, 1MB), [
      1MB, 100MB) and [100MB, infinity).

    ``remotefilelog.data.maxrepackpacks`` the maximum number of pack files to
      include in an incremental data repack.

    ``remotefilelog.data.repackmaxpacksize`` the maximum size of a pack file for
      it to be considered for an incremental data repack.

    ``remotefilelog.data.repacksizelimit`` the maximum total size of pack files
      to include in an incremental data repack.

    ``remotefilelog.history.gencountlimit`` constraints the minimum number of
      history pack files required to be considered part of a generation. In
      particular, minimum number of packs files > gencountlimit.

    ``remotefilelog.history.generations`` list for specifying the lower bound of
      each generation of the history pack files. For example, list [
      '100MB', '1MB'] or ['1MB', '100MB'] will lead to three generations: [
      0, 1MB), [1MB, 100MB) and [100MB, infinity).

    ``remotefilelog.history.maxrepackpacks`` the maximum number of pack files to
      include in an incremental history repack.

    ``remotefilelog.history.repackmaxpacksize`` the maximum size of a pack file
      for it to be considered for an incremental history repack.

    ``remotefilelog.history.repacksizelimit`` the maximum total size of pack
      files to include in an incremental history repack.

    ``remotefilelog.backgroundrepack`` automatically consolidate packs in the
      background

    ``remotefilelog.cachepath`` path to cache

    ``remotefilelog.cachegroup`` if set, make cache directory sgid to this
      group

    ``remotefilelog.cacheprocess`` binary to invoke for fetching file data

    ``remotefilelog.debug`` turn on remotefilelog-specific debug output

    ``remotefilelog.excludepattern`` pattern of files to exclude from pulls

    ``remotefilelog.includepattern`` pattern of files to include in pulls

    ``remotefilelog.fetchwarning``: message to print when too many
      single-file fetches occur

    ``remotefilelog.getfilesstep`` number of files to request in a single RPC

    ``remotefilelog.getfilestype`` if set to 'threaded' use threads to fetch
      files, otherwise use optimistic fetching

    ``remotefilelog.pullprefetch`` revset for selecting files that should be
      eagerly downloaded rather than lazily

    ``remotefilelog.reponame`` name of the repo. If set, used to partition
      data from other repos in a shared store.

    ``remotefilelog.server`` if true, enable server-side functionality

    ``remotefilelog.servercachepath`` path for caching blobs on the server

    ``remotefilelog.serverexpiration`` number of days to keep cached server
      blobs

    ``remotefilelog.validatecache`` if set, check cache entries for corruption
      before returning blobs

    ``remotefilelog.validatecachelog`` if set, check cache entries for
      corruption before returning metadata

�)�absolute_importN)�hex�wdirrev)�_)�open)�changegroup�	changelog�commands�configitems�context�copies�
debugcommands�dispatch�error�exchange�
extensions�hg�	localrepo�match�merge�
mergestate�patch�pycompat�	registrar�repair�repoview�revset�scmutil�smartset�streamclone�util�)�	constantsr
�fileserverclient�
remotefilectx�
remotefilelog�remotefilelogserver�repack�
shallowbundle�shallowrepo�shallowstore�shallowutil�shallowverifier�
remotefilelogsdebugF)�defaultsreponame�s	cachepaths
cachegroupscacheprocessscacheprocess.includepaths
cachelimits1000 GBsfallbackpath)r-sfallbackrepo)r.�aliassvalidatecachelogs
validatecacheson�serversservercachepathsserverexpiration��backgroundrepack�bgprefetchrevs�pullprefetch�backgroundprefetch�
prefetchdelay�x�prefetchdays�sstrip.includefiles�allsgetfilesstepi'sgetfilestypes
optimistics	batchsizesfetchwarningsincludepatternsexcludepattern�gcrepack�repackonhggc�repackschainorphansbysizeT)r.Zexperimentalspackssmaxpacksizesmaxchainleni�sdevelsremotefilelog.bg-waiti�'snodettlsdata.gencountlimit�sdata.generations)s1GB�100MBs1MBsdata.maxrepackpacks�2sdata.repackmaxpacksizes4GBsdata.repacksizelimitr@shistory.gencountlimitshistory.generationsshistory.maxrepackpacksshistory.repackmaxpacksizes400MBshistory.repacksizelimitsships-with-hg-corecCs�tj�tj�t�tjdt	�}|d�dddt
d�f�t�tjdtj�t�tjdtj
�t�tjd	t�t�tjd
t�dd�}t�tjd
|�d#dd�}t�d|�t�tjdt�tjt_t�tdtj�t�tdtj�t�tdt�t�td
t�t�tdt�t�tdt�t�t j!dt"�t�t#dt$�t�t%dt&�t�t'dt(�t�t)dt*�t�t j+dt,�t�t j!dt-�t�t.dt/�t�tdt0�t#j1�2d t3�t�t#d!t4�t�t5d"t6�t5j7t5j8d"<dS)$zUWraps user facing Mercurial commands to swap them out with shallow
    versions.
    scloner!r/sshallowNs5create a shallow clone which uses remote file historys
debugindexs
debugindexdotslog�pullc_s8t|�r |�d�r t�td���|||g|�Ri|��S)Nr;s(--all is not supported in a shallow repo)�	isenabled�getr�Abortr)�orig�ui�repo�args�opts�rK�B/usr/lib64/python3.9/site-packages/hgext/remotefilelog/__init__.py�	_manifest&szuisetup.<locals>._manifestsmanifestFcSs@d}zt�d�}Wnty$Yn0|r<|�tj�|t_dS)N�lfs)r�find�KeyErrorZwrapfilelogr%r#Z_lfsmod)ZloadedZlfsmodrKrKrL�
_lfsloaded/szuisetup.<locals>._lfsloadedrNs	debugdatas_addchangegroupfilessmakechangegroups	makestoresapplyupdatess_checkunknownfiless_checklookups_findrenamess_computeforwardmissings
runcommands_collectbrokencsetssfilectxstrydiffsverifyr-sgetrenamedfnsfilelog)F)9rZwirepeersetupfuncs�appendr#Z	peersetuprZwrapcommandr	�table�cloneshallowrr
Z
debugindexZ
debugindexdot�log�pullZafterloaded�debugdatashallowr(Zshallowcg1packerrZcgpacker�wrapfunctionZaddchangegroupfilesZmakechangegroupr�storewrapperr�exchangepullr�applyupdates�checkunknownfilesr�
workingctx�checklookupr�findrenamesr�computeforwardmissingr�
runcommandr�_collectbrokencsets�	changectx�filectx�workingfilectxr�trydiff�_verifyZfileprefetchhooks�add�_fileprefetchhook�getrenamedfnr�
filelogrevset�filelogZsymbols)rG�entryrMrQrKrKrL�uisetups`��	
�
�

���rnc	s�|�d�rbg��fdd�}t�td|�dd���fdd�}t�td	|�ddd�}t�td
|�zF|||g|�Ri|��W|�d�rֈD]}t�|d�r�|j��q�n,|�d�rԈD]}t�|d�r�|j��q�0dS)N�shallowcs�t|�s���|���t|j|���t|tj�rL|jjd|��jf|j_|j	�
tj�|�
��t�|�Wd�n1s�0Yt||g|�Ri|��S||g|�Ri|��SdS�Nr)rCrRZ
unfiltered�setupclientrG�
isinstancer�	__class__�	__bases__�requirementsrhr"�SHALLOWREPO_REQUIREMENT�lockrZwritereporequirementsrZ)rF�selfrI�kwargs)�reposrKrL�pull_shallowas
�
(z"cloneshallow.<locals>.pull_shallowrBcs ��fdd�}t��d|�dS)Ncs\���}tj|vrRi}�jr,d��j�|d<�jrBd��j�|d<�jdi|��S|�SdS)N��includepattern�excludepattern�stream_out_shallow)r)Zcapabilitiesr"ZNETWORK_CAP_LEGACY_SSH_GETFILESr}�joinr~Z_callstream)rFZcapsrJ��remoterHrKrL�stream_out_shallow�s
zAcloneshallow.<locals>.setup_streamout.<locals>.stream_out_shallows
stream_out)rrX)rHr�r�rKr�rL�setup_streamout~sz%cloneshallow.<locals>.setup_streamoutcs�|j|j�||�S�N)rHr�)rF�op)r�rKrL�stream_wrap�sz!cloneshallow.<locals>.stream_wrapsmaybeperformlegacystreamcloneFcSs`d|j�dg�vr,dd�|jdD�|jd<|r4dS|||d�\}}|durX|�tj�||fS)N�v2sstreamcSsg|]}|dkr|�qS)r�rK)�.0�crKrKrL�
<listcomp>�sz?cloneshallow.<locals>.canperformstreamclone.<locals>.<listcomp>)FN)�bundle2)Zremotebundle2capsrDrhr"rv)rFZpullopr�Z	supportedrurKrKrL�canperformstreamclone�s�z+cloneshallow.<locals>.canperformstreamclonescanperformstreamclonesfileservice)F)	rDrrXrrr �safehasattr�fileservice�close)	rFrGrHrIrJr{r�r��rrK)rzr�rLrT]s.
�
�
�
rTcOs<tjj}z$dd�tj_||i|��W|tj_S|tj_0dS)NcSsdS)Nr!rK)�xrKrKrL�<lambda>�r/z"debugdatashallow.<locals>.<lambda>)r%�__len__)rFrI�kwds�oldlenrKrKrLrW�s�rWcCsn|��sdS|�ddt�|�ddt�|�dd�}t|�}|rL|rLtd��|rZt||�|rjt�||�dS)Nshookssupdate.prefetchscommit.prefetchr-r1s+Cannot be both a server and shallow client.)	�localZ	setconfig�wcpprefetch�
configboolrC�RuntimeErrorrqr&Zsetupserver)rGrHZisserverenabledZisshallowclientrKrKrL�	reposetup�s
r�cCs>t|tj�sdSt�|�t|�t�|�t�	|j
�|_
dSr�)rrr�localrepositoryr&Zonetimesetup�onetimeclientsetupr)Zwraprepor*�	wrapstore�store)rGrHrKrKrLrq�s

rqcCs$||||�}tj|vr t�|�}|Sr�)r"rvr*r�)rFru�pathZvfstype�srKrKrLrY�s

rYc
Ksjt|�rP|��}g}	|�tjg�D] \}
}}|	�|
t||
�f�q"|j�|	�|||||||fi|��Sr�)	rC�manifestZ
getactions�
mergestatemodZ
ACTION_GETrRrr��prefetch)
rFrH�mresult�wctx�mctxZ	overwriteZwantfiledatarJr��files�frI�msgrKrKrLr[�sr[cOs�t|�r�g}|�|���}	|��D]t\}
\}}}
|	r>|	|
�s>q"|tjtjtjfvrl|�|
t	|�
|
��f�q"|tjkr"|d}|�|t	|�
|��f�q"|j�
|�||||||g|�Ri|��Srp)rC�maybesparsematch�revZfilemapr�ZACTION_CREATEDZACTION_DELETED_CHANGEDZACTION_CREATED_MERGErRr�filenodeZACTION_LOCAL_DIR_RENAME_GETr�r�)rFrHr�r��forcer�rIryr��sparsematchr��mZ
actionargsr��f2rKrKrLr\�s"�
r\c	Cs`|j}t|�rTg}|jD].}|D]$}||vr |�|t|�|��f�q q|j�|�||||�Sr�)�_reporCZ_parentsrRrr�r�r�)rFrxr�Zmtime_boundaryrHZ
prefetchfiles�parentr�rKrKrLr^s
r^c
Osht|�rLg}|d��}|D]"}	|	|vr|�|	t||	�f�q|j�|�|||||g|�Ri|��S)N�.)rCr�rRrr�r�)
rFrHZmatcher�added�removedrIryr�Zpmfr�rKrKrLr_sr_cCs�||||d�}|j}t|�r�|��}g}|�|���}|rvt�}	|D],}
||
�rD|�|
t||
�f�|	�|
�qD|	}|j	�
|�|S)N)r)r�rCr�r�r��setrRrrhr�r�)rF�a�br�missingrHZmbr�r�Z
sparsemissingr�rKrKrLr`&sr`cOsRd}|rt|�r|j}z(|||g|�Ri|��W|r<|��Sn|rL|��0dSr�)rCr�r�)rFZluirHrIryr�rKrKrLra<s��racs*t��rt�fdd�|D��}|�||�S)Ncsg|]}��|�s|�qSrK)�shallowmatch�r�r��rHrKrLr�Mr/z'_collectbrokencsets.<locals>.<listcomp>)rC�list)rFrHr�ZstriprevrKr�rLrbKsrbcCsN|dur|�|�}t|j�r>|j�|�r>tj|j||||d�S|||||d�S)N)�fileidrcrl)r�rl)r�rCr�r�r$)rFrxr�r�rlrKrKrLrdRs
�rdcCs8t|j�r*|j�|�r*tj|j|||d�S||||d�S)N)r]rl)rl)rCr�r�r$Zremoteworkingfilectx)rFrxr�rlrKrKrLre\s

�rec

Os�t|�r�g}|��}
|||D]\}||
vrP|	||���}|rP|�|t|�f�||vr |	||���}|r |�|t|�f�q |j�|�||||||||||	g	|
�Ri|��Sr�)rCr�r�rRrr�r�)rFrH�revsZctx1Zctx2Zmodifiedr�r��copyZ
getfilectxrIryr�Zmf1�fname�fnoderKrKrLrfes8�
��rfcCs0|��}zt�|���W|��S|��0dSr�)rwr,Zverify�release)rFrH�levelrwrKrKrLrg�s�rgcsNtrdSdag�d�fdd�	}t�tjd|��fdd�}t�tjd|�dS)	NTcsLt|t�r,��|||||||||	|
f
�|S||||||||||	|
d�
SdS)N)�
_metatuple)rr�intrR)rFrxZrawtextZtransaction�link�p1�p2�node�flagsZ
cachedeltar��ZpendingfilecommitsrKrL�addrawrevision�s6
���z*onetimeclientsetup.<locals>.addrawrevisionsaddrawrevisioncs�t|�}||g|�Ri|��}t|�}||kr��D]T}|\
}}	}
}}}
}}}}|�|�}||kr||�|	|
|||
||||�	q2t�d��q2n tdd��D��dkr�t�d���dd�=|S)Ns4pending multiple integer revisions are not supportedcSsh|]}|d�qS)�rK)r�r�rKrKrL�	<setcomp>�r/z;onetimeclientsetup.<locals>.changelogadd.<locals>.<setcomp>r!)�lenr�r�rZProgrammingError)rFrxrIryr�r�ZnewlenZoldargsrUZrt�trr�r�r��nZflr�r�Zlinknoder�rKrL�changelogadd�s$
��
z(onetimeclientsetup.<locals>.changelogaddsadd)NN)�
clientonetimerrXr%r)rGr�r�rKr�rLr��s�+�r�cs2t��rt���r|�|�Si���fdd�}|S)Ncs�|��|i�vr�||Sz^�|�|�}|��D]0}|��|kr4|��}|oV|d�||��<q4|��}|ox|dWStjy�YdS0dS)z�looks up all renames for a file (up to endrev) the first
        time the file is given. It indexes on the changerev and only
        parses the manifest if linkrev != changerev.
        Returns rename info for fn at changerev rev.rN)�
setdefaultrd�	ancestorsr��renamedr�r�LookupError)�fnr��fctxZancestorr��ZrcacherHrKrL�
getrenamed�sz getrenamedfn.<locals>.getrenamed)rCrZusechangesetcentricalgo)rFrHZendrevr�rKr�rLrj�s

rjcst|�s||||�St�|td��}tj|j|��|gd|dd��t��t�	|�s�|D]<}||}|�
�}��
�D]}||vrt��|���qXqtqXnX�fdd�|dD�}	|	D]<}|d�
|�}
��|
���|
��D]}��|���q�q�t��fdd�|D��S)	a``filelog(pattern)``
    Changesets connected to the specified filelog.

    For performance reasons, ``filelog()`` does not show every changeset
    that affects the requested file(s). See :hg:`help log` for details. For
    a slower, more accurate result, use ``file()``.
    sfilelog requires a patternsrelpathN)r.�ctxc3s|]}�|�r|VqdSr�rKr�)r�rKrL�	<genexpr>1r/z filelogrevset.<locals>.<genexpr>csg|]}|�vr|�qSrKrK�r�r�)r�rKrLr�8r/z!filelogrevset.<locals>.<listcomp>)rCrZ	getstringr�matchmodr�root�getcwdr�Zpatkindr�rhr�rdZlinkrevr�rZbaseset)rFrHZsubsetr��patr�r�Zcfilesr�r�r�ZactxrK)r�r�rLrks,	�

rksgcshg gc [REPO...])Znorepoc	Os�t�}tj|dd�}|r"|�|�g}|j�d�}|r@|�|�|�|�g}|D]T}z:t�	|i|�}	|�|	�tj|	j
dd�}
|
r�|�|
�WqRtjy�YqR0qR|D]}t
||�q�|D]}	t�||	j�q�dS)z4garbage collect the client and server filelog cachesT)Z
allowemptysPWDN)r�r+Zgetcachepathrh�environrDrR�extendr�peerrGr�	RepoError�gcclientr&Zgcserverr�)rGrIrJZ
cachepathsZsystemcacheZ	repopaths�pwdrzZrepopathrHZ	repocache�	cachepathrKrKrL�gc;s.



r�cs~tj�|d�}tj�|�s0|�td�|�dSt|d�}dd�|��D�}|��g}t	�}d}d}d}	|j
td�dt|�d	�}
|D�]r}|
�|	�|	d
7}	zt
�tj�|��}WnPt�y}z6|�td�||f�t��WYd}~q�WYd}~n
d}~00zt�|i|�}
|
j}Wntj�y8Yq�Yn0|�|�t|��sPq�t
�|d��sr|�td
�|�q�|j�dd�}|j�dd�}|�r�|�r�zt�|�d}Wq�Wnttj f�y�Yn0|j!�|�s�|j"}�fdd�}tj#|||d�}q�|
�$�t�%d�}z4t|d�}|�&dd�|D��|��Wt�%|�nt�%|�0|du�rf|�'|�n|�sz|�td��dS)Nsrepossno known cache at %s
srbcSsh|]}|dd��qS)N���rKr�rKrKrLr�ir/zgcclient.<locals>.<setcomp>Frsanalyzing repositories)Zunit�totalr!swarning: malformed path: %r:%s
snames.repo %s is a misconfigured remotefilelog repo
r-r=r<Tcst��|t|��Sr�)r#�getcachekeyr�r�r��ZreponamerKrL�keyfn�szgcclient.<locals>.keyfn)r�Zlastkeepkeysr?swbcSsg|]}d|�qS)�%s
rKr�rKrKrLr��r/zgcclient.<locals>.<listcomp>s$warning: no valid repos in repofile
)(�osr�r��exists�warnrr�	readlinesr�r�Zmakeprogressr��updater Z
expandpath�normpath�	TypeError�	traceback�	print_excrr�r�rr�rRrCr�rGr��	repackmod�incrementalrepack�IOError�RepackAlreadyRunning�nameZsharedstore�keepsetZcomplete�umask�
writelinesr�)rGr�Z	repospathZ	reposfilerzZ
validreposZkeepkeysZsharedcacheZ
filesrepacked�countZprogressr��er�rHZrepackonhggcZgcrepackr�ZoldumaskrKr�rLr�as|
�

"




�




r�c
Os�t|�s |||g|�Ri|��S|�d�}|�d�}|r�|r@|rHd|d<|s�|s�t�|d|t�|��}|��}|r�|��D]}	tj	�
|�|	��s~d}q�q~|r�|�t
d��|||g|�Ri|��S)N�followr�Tr�r�FsEwarning: file log can be slow on large repos - use -f to speed it up
)rCrDrrr�byteskwargsZanypatsr�r�r��isfileZwjoinr�r)
rFrGrH�patsrJrr�rr	�filerKrKrLrU�s,


��rUcCs$|�dd�}|dkr d||f}|S)z�Update revset so that only changesets no older than 'prefetchdays' days
    are included. The default value is set to 14 days. If 'prefetchdays' is set
    to zero or negative value then date restriction is not applied.
    r-r9rs(%s) & date(-%s))�	configint)rGrZdaysrKrKrL�revdatelimit�sr
cCsx|j�dd�}|j�d�}d}t|d��<tj�|�}t��||krVt�	|d�d}Wd�n1sj0Y|S)z�Check that enough time has passed since the last background prefetch.
    This only relates to prefetches after operations that change the working
    copy parent. Default delay between background prefetches is 2 minutes.
    r-r7slastprefetchF�aNT)
rGrZvfsr�rr�r��getmtime�time�utime)rH�timeoutr�ZreadyZmodtimerKrKrL�readytofetch�s"rcsbt��}|�dd��t��}|r(�r(|s,dS�j�dd��t|������fdd�}��|�dS)z�Prefetches in background revisions specified by bgprefetchrevs revset.
    Does background repack if backgroundrepack flag is set in config.
    r-r4Nr3cs.t��d�r�jrdSd�_�j��d�dS)NsranprefetchT�r')r r�Zranprefetch�backgroundprefetch)Zunused_success��bgprefetchrevs�bgrepackrHrKrL�anonszwcpprefetch.<locals>.anon)rC�configrrGr�r
Z
_afterlock)rGrHryroZisreadyrrKrrLr�s
r�cOs�|||g|�Ri|��}t|�r�|�dd�}|j�dd�}|j�dd�}|r�|�td��t�||g�}	|d��}
|r�|j	||d�q�|j
|	|
d�|r�tj|d	d
�n|r�tj|d	d
�|S)Nr-r5r3r6sprefetching file contents
r�r)�baseT��incremental)
rCrrGr��statusrr�revranger�rr�r��backgroundrepack)rFrGrHr
rJ�result�prefetchrevsetrZ
bgprefetchr�rrKrKrLrVs"rVcOsPddd�}t�|d�r||_nt�|d�r8t�|d|�|||g|�Ri|��S)Nc[s.|s
t�}|�tj�||f|||d�|��S)N)�heads�common�
bundlecaps)r�rhr"ZBUNDLE2_CAPABLITY)rF�sourcer#r$r%ryrKrKrL�localgetbundle4s���z$exchangepull.<locals>.localgetbundles_callstreams	getbundle)NNN)r r�Z
_localreporrX)rFrHr�rIryr'rKrKrLrZ1s�

rZc	Cs�t|�r�g}|D]r\}}|tks|dur*q||}|��}|�|���}|�|�D].}|rb||�rR||vrR|�|t||�f�qRq|j�	|�dSr�)
rCrr�r�r��walkrRrr�r�)	rHZ
revmatchesZallfilesr�rr�Zmfr�r�rKrKrLriFsrisdebugremotefilelog�ds
decompresssdecompress the filelog firstshg debugremotefilelog <path>cKstj||fi|��Sr�)r
�debugremotefilelog�rGr�rJrKrKrLr*Us	r*sverifyremotefilelogsdecompress the filelogs firsts#hg verifyremotefilelogs <directory>cKstj||fi|��Sr�)r
�verifyremotefilelogr+rKrKrLr,as	r,s
debugdatapackslongsprint the long hashessnodesdump the contents of nodesNODEshg debugdatapack <paths>cOstj|g|�Ri|��Sr�)r
�
debugdatapack)rG�pathsrJrKrKrLr-ms
r-sdebughistorypackshg debughistorypack <path>cKst�||�Sr�)r
�debughistorypackr+rKrKrLr/zsr/sdebugkeepsetshg debugkeepsetcs�fdd�}t��|�dS)Ncst��j|t|��Sr�)r#r�rrr�r�rKrLr��szdebugkeepset.<locals>.keyfn)r�r)rGrHrJr�rKr�rL�debugkeepsetsr0sdebugwaitonrepackshg debugwaitonrepackcKs
t�|�Sr�)r
�debugwaitonrepack�rGrHrJrKrKrLr1�sr1sdebugwaitonprefetchshg debugwaitonprefetchcKs
t�|�Sr�)r
�debugwaitonprefetchr2rKrKrLr3�sr3cCs�|�d�spddg}|�ddd�}|r2|�d|�|�ddd�}|rR|�d|�d�|�}t||�}|g|d<|�d	�s�d|d	<|S)
N�revr�sdraft()r-r5s(%s)r4�+�base)rDrrRr�r
)rGrJrr"rrKrKrL�resolveprefetchopts�s




r7sprefetch�rr4s prefetch the specified revisionssREVsrun repack after prefetch�br6s'rev that is assumed to already be localshg prefetch [OPTIONS] [FILE...])ZhelpcategorycOsnt�|�}t|�s t�td���t||�}t�||�	d��}|�
||�	d�||�|�	d�rjtj|dd�dS)atprefetch file revisions from the server

    Prefetchs file revisions for the specified revs and stores them in the
    local remotefilelog cache.  If no rev is specified, the default rev is
    used which is the union of dot, draft, pullprefetch and bgprefetchrev.
    File names or patterns can be used to limit which files are downloaded.

    Return 0 on success.
    srepo is not shallowr4r6r>TrN)
rrrCrrErr7rrrDr�r�r )rGrHr
rJr�rKrKrLr��s


r�s
backgroundsrun in a background processsincrementalsdo an incremental repack�	packsonlys&only repack packs (skip loose objects)shg repack [OPTIONS]c
Os�|�d�r,tj||�d�|�dd�d�dSd|�d�i}z,|�d�rVtj||d�ntj||d�Wn6tjy�}z|j�d|�WYd}~n
d}~00dS)	NZ
backgroundr�	packsonlyF)rr;r:)�optionsr�)rDr�r r�Z
fullrepackrrGr�)rGrHr
rJr<�exrKrKrL�repack_�s

�
r>)N)NN)N)N)N)o�__doc__Z
__future__rr�rr�Zmercurial.noderrZmercurial.i18nrZmercurial.pycompatrZ	mercurialrrr	r
rrr
Zhgdebugcommandsrrrrrrrr�rrr�rrrrrrrrrr �r"r#r$r%r&r'r�r(r)r*r+r,ZcommandZcmdtableZconfigtableZ
configitemZdynamicdefaultZ
_defaultlimitZ
testedwithr�Z	repoclassZ_basesupportedrhrvrCrnrTrWr�rqrYr[r\r^r_r`rarbrdrerfrgr�r�rjrkr�r�rUr
rr�rVrZrir*r,r-r/r0r1r3r7ZwalkoptsZCATEGORY_MAINTENANCEr�r>rKrKrKrL�<module>s@xp8

�
�QV	
	



	/
W
(
%^#��
��
��	


	

���
���

Youez - 2016 - github.com/yon3zu
LinuXploit