HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyc
�
1�3\c@@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZmZddlmZddlmZmZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(dd	l)m*Z*m+Z+d
Z,iZ-e$j.e-�Z.e.ddd
e/�e.ddd
d�e.ddd
d�e.ddd
d�e.ddd
e/�e.ddd
d�e.ddd
d�e.ddd
d�e.ddd
e/�e.ddd
d�e.ddd
e/�dZ0dZ1dZ2e*j3Z3e$j4�Z4e$j5�Z5d�a6e
j7d�j8Z9d�Z:d�Z;d�Z<d �Z=d!e>fd"��YZ?d#�Z@d$�ZAd%�ZBd&�ZCd'�ZDd(�ZEd)�ZFd*�ZGdd+�ZIe'jJd,��ZKd-�ZLd.�ZMd/�ZNd0�ZOd1�ZPd2�ZQddd3�ZRd4�ZSd
d5�ZTd6�ZUd7�ZVd8�ZWd9�ZXdd:�ZYd;�ZZe!j[d<�Z\ej]e3�d=��Z^dNej_e*j3<d>�Z`ejad?��Zbd@�ZcdA�ZddB�ZedC�Zfejge3dO�dI��ZhdJ�ZidK�ZjdL�ZkdM�ZldS(Ps�	 store some pushes in a remote blob store on the server (EXPERIMENTAL)

    [infinitepush]
    # Server-side and client-side option. Pattern of the infinitepush bookmark
    branchpattern = PATTERN

    # Server or client
    server = False

    # Server-side option. Possible values: 'disk' or 'sql'. Fails if not set
    indextype = disk

    # Server-side option. Used only if indextype=sql.
    # Format: 'IP:PORT:DB_NAME:USER:PASSWORD'
    sqlhost = IP:PORT:DB_NAME:USER:PASSWORD

    # Server-side option. Used only if indextype=disk.
    # Filesystem path to the index store
    indexpath = PATH

    # Server-side option. Possible values: 'disk' or 'external'
    # Fails if not set
    storetype = disk

    # Server-side option.
    # Path to the binary that will save bundle to the bundlestore
    # Formatted cmd line will be passed to it (see `put_args`)
    put_binary = put

    # Serser-side option. Used only if storetype=external.
    # Format cmd-line string for put binary. Placeholder: {filename}
    put_args = {filename}

    # Server-side option.
    # Path to the binary that get bundle from the bundlestore.
    # Formatted cmd line will be passed to it (see `get_args`)
    get_binary = get

    # Serser-side option. Used only if storetype=external.
    # Format cmd-line string for get binary. Placeholders: {filename} {handle}
    get_args = {filename} {handle}

    # Server-side option
    logfile = FIlE

    # Server-side option
    loglevel = DEBUG

    # Server-side option. Used only if indextype=sql.
    # Sets mysql wait_timeout option.
    waittimeout = 300

    # Server-side option. Used only if indextype=sql.
    # Sets mysql innodb_lock_wait_timeout option.
    locktimeout = 120

    # Server-side option. Used only if indextype=sql.
    # Name of the repository
    reponame = ''

    # Client-side option. Used by --list-remote option. List of remote scratch
    # patterns to list if no patterns are specified.
    defaultremotepatterns = ['*']

    # Instructs infinitepush to forward all received bundle2 parts to the
    # bundle for storage. Defaults to False.
    storeallparts = True

    # routes each incoming push to the bundlestore. defaults to False
    pushtobundlestore = True

    [remotenames]
    # Client-side option
    # This option should be set only if remotenames extension is enabled.
    # Whether remote bookmarks are tracked by remotenames extension.
    bookmarks = True
i(tabsolute_importN(tbinthex(t_(tprocutilt
stringutil(tbundle2tchangegrouptcommandst	discoverytencodingterrortexchanget
extensionsthgt	localrepotphasestpushkeytpycompatt	registrartutiltwireprototypestwireprotov1peertwireprotov1serveri(tbundlepartstcommonsships-with-hg-coretinfinitepushtservertdefaultt	storetypett	indextypet	indexpatht
storeallpartstreponamet
scratchbrancht	storepatht
branchpatterntpushtobundlestoretexperimentalsserver-bundlestore-bookmarksinfinitepush-scratchpushcC@stS(N(tFalse(tx((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt<lambda>�Rs^[a-f0-9]+$cC@s�|jddg�}|jdd�}|s?tjd��n|jddg�}|jdd�}|s~tjd��ndd	lm}|j||||�S(
NRtput_argst
put_binarysput binary is not specifiedtget_argst
get_binarysget binary is not specifiedi(tstore(t
configlisttconfigRtAbortRR/texternalbundlestore(tuiR+R,R-R.R/((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_buildexternalbundlestore�sc
C@s|jdd�}|s0tjtd���n|jd�\}}}}}|jdd�}|s~tjtd���n|jddd�}|jdd	d
�}	|jddd�}
d
dlm}|j|||||||t|�d	|	d|
�S(NRtsqlhostsplease set infinitepush.sqlhostt:R"s please set infinitepush.reponametlogfileRtwaittimeouti,tlocktimeoutixi(tsqlindexapi(	R1RR2Rtsplitt	configintRR;t_getloglevel(R4R6thosttporttdbtusertpasswordR"R8R9R:R;((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_buildsqlindex�scC@s\|jddd�}tt|j�d�}t|t�sXtjt	d�|��n|S(NRtlogleveltDEBUGsinvalid log level %s(
R1tgetattrtloggingtuppertNonet
isinstancetintRR2R(R4REtnumeric_loglevel((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR>�s
cC@sItj|�rE|jdd�d}|j|�rE|t|�Sn|S(s)returns a bookmarks with hoisted part removed

    Remotenames extension has a 'hoist' config that allows to use remote
    bookmarks without specifying remote path. For example, 'hg update master'
    works as well as 'hg update remote/master'. We want to allow the same in
    infinitepush.
    tremotenamesthoistedpeert/(RtisremotebooksenabledR1t
startswithtlen(R4tremotebookmarkthoist((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt	_tryhoist�s
	tbundlestorecB@seZd�ZRS(cC@s(||_|jjjdd�}|dkr^ddlm}|j|jj|j�|_n=|dkr�t|jj�|_ntjt	d�|��|jjjdd�}|dkr�dd	lm
}|j
|j�|_n=|d
krt|jj�|_ntjt	d�|��dS(NRRtdiski(R/texternals,unknown infinitepush store type specified %sR(tfileindexapitsqls,unknown infinitepush index type specified %s(
t_repoR4R1RR/tfilebundlestoreR5RR2RRZtindexRD(tselftrepoRR/RRZ((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt__init__�s"	!(t__name__t
__module__Ra(((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRW�scC@s|jdd�S(NRR(t
configbool(R4((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt	_isserver	scC@s.t|�r*|j�r*t|�|_ndS(N(RetlocalRW(R4R`((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt	reposetupscC@s1t|�t|�r#t|�n
t|�dS(N(tcommonsetupRetserverextsetuptclientextsetup(R4((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pytextsetups

cC@sJtdftjd<|jdd�}|rFtj|�\}}andS(Nsnamespace patternstlistkeyspatternsRR%(twireprotolistkeyspatternsRRR1Rt
stringmatchert_scratchbranchmatcher(R4tscratchbranchpattkindtpat((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRhsc@s�tjd��fd�}�j|_|tjd<tjd��fd�}�j|_|tjd<tjtjdt�tt	j
dd�dft	j
d<tjtd	t�tjtd
t
�dS(NRc@st�||�dS(N(tbundle2pushkey(targstkwargs(torigpushkeyhandler(sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pytnewpushkeyhandler#ssphase-headsc@st�||�S(N(tbundle2handlephases(RtRu(torighandlephasehandler(sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR*)stlistkeystlookupitkeytgetbundlechunkstprocessparts(RtparthandlermappingtparamsR
twrapfunctionRtlocalrepositorytlocalrepolistkeyst_lookupwrapRRRR}R~(R4Rwtnewphaseheadshandler((RyRvsA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRi s



$cC@s�tjtjdt�}|djdddtd�f�tjtjdt�tj	t
dt�tt
j_tj}|jd�}|j||j|jt���dS(	NtpushiRsbundle-stores/force push to go to bundle store (EXPERIMENTAL)tpullt
checkheadst	changeset(R
twrapcommandRttablet_pushtappendRJRt_pullR�R	t_checkheadsRlRtwirepeerRtb2partsgenorderR^tinserttpoptscratchbranchparttype(R4tentryt	partorderR^((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRj6s
		cC@s&|jjttt�rdS||�S(N(R4RdR'tconfigscratchpushR((torigtpushop((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR�HscC@s=tj|�}|jtj|�|�j�}tj|�S(N(Rt
decodelistRzR
ttolocalt	iteritemsRt
encodekeys(R`tprotot	namespacetpatternstd((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRmMs!c
C@s�|dkr�|r�|jj}i}|||�}x�|D]�}|j|j|��|jd�rzd|d d}ntj|�\}}	}
x3|j�D]%\}}|
|�r�|||<q�q�Wq:W|S|||�SdS(Nt	bookmarkst*sre:^i����s.*(RWR^tupdatetgetbookmarkstendswithRRnR�(
R�R_R�R�R^tresultsR�tpatternRqRrtmatchertbookmarktnode((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR�Rs
cc@s�|jd�sidfVntj�}|jjd|�itj|�d6tj	|�d6|fV|j
}|jjd|t|�f�tj
|�VdS(NRspreparing listkeys for "%s"
R�R�s$received listkey for "%s": %i bytes
(tcapableRJRtfutureR4tdebugR
t	fromlocalRt
encodelisttvalueRSRt
decodekeys(R_R�R�tfR�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRlcs	cC@st|jd��S(Nsbundle()(tlisttrevs(t
bundlerepo((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_readbundlerevsrsc
C@s�t�}|j}x(|D] }|j|j|�d�qW|sG|Sdj|�}g}t}xU|pngD]G}	|	jd�r�|jdj|	|f��t}qo|j|	�qoW|s�|jd|�n|S(s�Tells remotefilelog to include all changed files to the changegroup

    By default remotefilelog doesn't include file content to the changegroup.
    But we need to include it if we are fetching from bundlestore.
    issexcludepattern=(	tsett	changelogR�treadtjoinR(RRR�tTrue(
t
bundlecapsR�t
bundlerevsR4tchangedfilestcltrtnewcapstappendedtcap((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_includefilelogstobundleus"		
	cC@s�g}d}tj|d|d|g�}tj|||d�}tj|�j�}tjdd|�}|j	d|�|j
|�|S(s�
    Bundle may include more revision then user requested. For example,
    if user asks for revision but bundle also consists its descendants.
    This function will filter out all revision that user is not requested.
    t02tcommonheadstmissingheadsR�Rtdatatversion(R	toutgoingRt
makestreamRtchunkbufferR�Rt
bundleparttaddparamR�(R�tbundlerootstunknownheadtpartsR�R�tcgstreamtcgpart((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt	_rebundle�s
c	C@so|j}g}xY|D]Q}|j|�}|j|�}x*|D]"}||krA|j|�qAqAWqW|S(N(R�R�tparentsR�(	toldrepoR�R�R�R�trevR�R�tparent((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_getbundleroots�s	

cC@s@t|jd��}t|�dko>||dj�|kS(Nsheads(bundle())ii(R�R�RSR�(theadR�tbundleheads((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_needsrebundling�sc	C@s�g}t||�s{tj|d��O}tj|j||�}t|tj�r�t	j
dd|jj��}|j
dd�|j|�n�t|t	j�rct}x�|j�D]y}|jdkr�t}nt	j
|jd|j��}	x-|jj�D]\}
}|	j
|
|�qW|j|	�q�W|srtjddt|�dd	��qrntjd
��WdQXnt|||�}|S(smgenerates bundle that will be send to the user

    returns tuple with raw bundle string and bundle type
    trbRR�R�t01s,unexpected bundle without changegroup part, shead: %sthintsreport to administratorsunknown bundle typeN(R�Rt	posixfileRt
readbundleR4RKRtcg1unpackerRR�t_streamR�R�R�t
unbundle20R(t	iterpartsttypeR�R�R�RR2RR�(R�R�R�t
bundlefileR�R�t	unbundlertpartthaschangegrouptnewpartR|R�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_generateoutputparts�s4	c
@s�|p	g}i�g�g}g}i}g}	zKxD|D]<}
|
|jjkr:|
|kr?tj||
�}d|j|f}tj|j|�}
|	j|
|f�t	t
|
��}t||
||j�}|
j}t||
|�}xL|D]A}|j
|�}ttj��t|�<|
||f||<q�Wn�jt|
||
��|j|�|j|
�q:q:WWdxI|	D]A\}
}|
j�ytj|�Wq�ttfk
r�q�Xq�WXt���t}t}tjd�z���fd�}|tjd<t}��fd�}tjt j!d|�t}t"t	|�t	|�Bt	|��}|||d|d||�}Wd|r��tjd<n|r�tj#t j!d|�nX|S(Nsbundle:%s+%sRc@sE�|||�}x,�D]$}x|D]}|j|�q&WqW|S(N(taddpart(tbundlerRtRutresulttbundleR�(toldchangegroupparttscratchbundles(sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_changegroupparts


c@sT|||�}|dkrP�rP|jd�dkr@|d=n|j��n|S(NRt
publishingR�(tgetR�(R�R_R�t
origvalues(t	newphasestpullfrombundlestore(sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt	_listkeyss
RztheadsR�($R�tnodemapRtdownloadbundletrootRt
repositoryR4R�R�R�R�R�R�tstrRtdraftRR�textendtclosetostunlinktIOErrortOSErrortboolR(Rtgetbundle2partsmappingR�R
R�RR�R�tunwrapfunction(R�R`tsourceR�R�Rutnewheadstscratchheadst
nodestobundletallbundlestocleanupR�t
newbundlefilet
bundlepathR�R�R�R�R�R�R�twrappedchangegroupparttwrappedlistkeysR�R�R�((R�R�R�R�sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR}�sp
	


	


	&cC@s
d�}|S(NcS@s�tj|�}t|t�rht|�rh|jjj|�}|rSdd|fSddd|fSn}y't|j	|��}dd|fSWnSt
k
r�}|jjj|�r�dd|fStj
|�}dd|fSnXdS(Ns%d %s
iisscratch branch %s not found(R
R�RKRRoRWR^tgetnodeRR{t	Exceptiont	getbundleRtforcebytestr(R`R�R|tlocalkeytscratchnodeR�tinst((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_lookup0s((R�R((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR�/s	cK@sGtj|�}tj|j|�|jd��\}}i}|j�}g}x6|jdg�D]"}	|	|krd|j|	�qdqdW|jd�r�g}
|jd�p�g}x=|jd�D],}t|�r�d||<q�|
j|�q�W|rytj	|||�}
|
j
dd|�}xR|D]G}||krStjd|��n||||<|j||�q+Wn|
|d<||d<n|s�|r�t
jtdt�nztt|||�}||||tj|��}tj|�r|j|�t|||�n
t||�|SWd|rBt
jtd�nXdS(	NtbranchR�R�t
REVTOFETCHR�R�sremote bookmark %s not found!tfindcommonincoming(RtbyteskwargsRtparseurlt
expandpathR�t
unfilteredR�RotpeerRlRR2R
R�R	t_findcommonincomingt_readscratchremotebookmarkst	strkwargsRRQR�t_saveremotebookmarkst_savelocalbookmarksR
(R�R4R`RtoptstbranchestscratchbookmarkstunfitunknownnodesR�R�R�R�tothertfetchedbookmarkstremotescratchbookmarksR�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR�EsP*

	





c
C@s�tj|�r�tjd�}|j|j|�}i}|jj�x�|jdj	|�D]l}|j
|�\}}||kr]t|�r]|jdj||�}	|	r�t
|	d�||<q�q]q]W|SiSdS(NRNtremotebookmarksi(RRQR
tfindt
activepathR4t_remotenamest
clearnamestnamest	listnamestsplitremotenameRotnodesR(
R4R`R.tremotenamesextt
remotepathR�RTtpathtbooknameR9((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR%~s
	cC@s
tjd�}|j|j|�}tjt�}i}|j|�}x�|D]y\}}	}}
||krsqOn|	dkr�|
|kr�||
=n|||
<qO|	dkrO||
jt	|��qOqOWx$|j
�D]\}}|||<q�W|j||||�dS(NRNR�R*(R
R2R3R4tcollectionstdefaultdictR�treadremotenamesR�RR�tsaveremotenames(R`tnewbookmarkstremoteR:R;R*R�RNthexnodetnametypetrnameR�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR'�s"

cC@s�|s
dS|j���|j��y|jd��c}g}x=|j�D]/\}}||}|j||j�f�qIW|jj|||�WdQXWdQXWdQXdS(NR�(twlocktlockttransactionR�R�R�t
_bookmarkstapplychanges(R`R�ttrtchangestscratchbookR�t	changectx((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR(�s


cO@s%|||�\}}}|t|fS(N(R�(R�RtRuRtinctremoteheads((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR$�scO@s�tj|�}|jd�}t|�dkr=|d}nd}d}i|ttf6}|j|d��i|jd�}	t|�r�t	}	|j
tdt	�n|	r�g|d<|j
ttt	�tj
tdt�}n|jj|d	d�}
|
s#tjtd�dtd
���n|
jp2|
j}t|||�}|||||tj|��}
tj|�r�|r�|	r�tj|||�}|jdd|g�}|j|�nt|||�nWdQX|r�|t_ n|
S(NR�iiRRtbundle_storesbundle2.pushbackt_localphasemoveRsdefault-pushs"default repository not configured!R�ssee 'hg help config.paths'R�R�(sdefault-pushR(!RRR�RSRJR'tconfigbookmarktconfigoverrideRoR�t	setconfigR�R
R�Rt
_phasemovetpathstgetpathRR2RtpushloctlocR%R&RRQRR#RlR�R'RS(R�R4R`tdestRtR)R�toldphasemovet	overridestscratchpushR<tdestpathR0R�R.R/((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR��sF

	!cC@sXtjd�}d}d}d}g|j|�D]}|||kr1|^q1}	g|	D] }||dkrZ||^qZ}
x>|D]6}||
kr�tjtd�j||���q�q�Wi}tjt	�}
xe|	D]]\}}}}|dkr||kr|||<q�|dkr�|
|j
t|��q�q�W|j|||
|�dS(	sqPrune remote names by removing the bookmarks we don't want anymore,
    then writing the result back to disk
    RNiiiR�s6infinitepush bookmark '{}' does not exist in path '{}'R*N(
R
R2R@RR2RtformatR>R?R�R�RRA(R4R`R<R6R:tnametype_idxt
remote_idxtname_idxt
remotenameRNtremote_bm_namestnameR�R*R�RERC((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_deleteinfinitepushbookmarks�s**

cC@s&|tjkr"||||�ndS(s�prevent commits from being marked public

    Since these are going to a scratch branch, they aren't really being
    published.N(Rtpublic(R�R�R9tphase((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRWsc@s�jjtt�}�jjtt�}d�jks@|rDdSttj	�j
�kr`dS�jjd��jj
s��jjtd��d�_dS|jdd�tj�j�j
�j�j|�}x|D]}|j|�q�W�fd�}|S(Nt
changesetssno changes found
iRR�c@s
d�_dS(Ni(tcgresult(top(R�(sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pythandlereply2s(R4R1R'RTRdR�t	stepsdoneR�Rtbundle2capsRCtaddR�tmissingtstatusRRlR�RtgetscratchbranchpartsR`R�(R�R�R�R_tscratchpartstscratchpartRn((R�sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pytpartgens*		
cC@sbg|jd�D]}||^q}|dkr6|S||kr^t|jd|��r^|S|S(s.extracts and validates the revs to be importedssort(bundle())sbundle() & %s::N(R�RJR�R�(R�toldnodetforceR�R�R�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_getrevs:s&$c	k@s�tj�}||dd|�y0dV||dddtj�|d|�WnItk
r�}||dddtj�|ddt|�|��nXdS(Nt	eventtypetstarttsuccesst	elapsedmsi�tfailureterrormsg(ttimeRR(tloggertserviceRuR|te((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pytlogservicecallHsc
C@s�|jd}|s�|jj}ytj�}Wntk
rHd}nXtj�tjdd�}t	j
�}tj|j
dd|d|d|d	|jdd	��}|jjd|�n
|d}|S(
Ntinfinitepushloggertunknownii�5wRRBt	requestidthostnameR"(trecordsR`R4RtgetuserRtrandomtseedtrandinttsockettgethostnamet	functoolstpartialtlogR1Rq(RmR�R4tusernameR�R�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_getorcreateinfinitepushloggerVs"



	
c
C@s|jjtd��tj|j�}tj|||��1}x'|D]}d
}|jdkrutj||�n�tj	|jd|j
��}x-|jj�D]\}}	|j
||	�q�W|jdkr3|jd
k	r3|jjd|j�}
|
j
dd|jd	t�|
j
d
dd	t�q3n|jj|jidd
6�|rG|j|�qGqGWWd
QXtj|j��}tj�\}}
zKz)tj|d�}|j|j
��Wd
|j�Xt|i|
�Wd
ytj|
�Wnt k
r	nXXd
S(smstores the incoming bundle coming from push command to the bundlestore
    instead of applying on the revlogss&storing changesets on the bundlestore
t	replycapsR�RRsreply:%ssin-reply-tos%dt	mandatorytreturnt1iNtwb(RR(!R4RsRRtbundle20tpartiteratorRJR�t_processpartR�R�R�R�R�treplyR�tidR(R�RqR�RR�t	getchunksRtmkstempRtfdopentwriteRtstorebundleRR(R�R`RmR�R�R�R�R�R|R�trparttbuftfdR�tfp((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pytstoretobundlestorens@

c
C@s>|jdkr||||�S|jjdd�rGt||||�S|jjd�dkro||||�S|jjdd�}tj|j�}d}tj	|||���}x�|D]�}d}	|j
dkr�tj||�ng|j
tj
kr~|jjdd�}
tjd	d
|j��}	|	jd|
�|j}|sP|jjt
dt�|jjt
d
t�qPn�|r@tj|j
d
|j��}	x-|jj�D]\}}|	j||�q�W|j
dkrP|jdk	r=|jjd�}
|
jdt|j�dt�|
jdddt�q=qPntj||�|rv|jj|j
idd6�n|	r�|j|	�q�q�WWdQX|r:tj|j��}tj�\}}zKz)t j!|d�}|j"|j��Wd|j#�Xt$|||�Wdyt j%|�Wnt&k
r5nXXndS(NtunbundleRR&R�R!R�t	cgversionR�RR�R�t_skippushkeyt_skipphaseheadsRs
reply:pushkeysin-reply-toR�R�R�iR�('RR4RdR�R�R�RR�RJR�R�R�RR�R�R�R�R�RqR�R�R�R�RR�R(R�RR�R�RR�RR�R�RR�RR(R�R`RmR�thandleallpartsR�tcgparamsR�R�R�R�R|R�R�R�R�R�R�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR~�sh
	

c@s}t|�}tj�}|tdd�|jjj�|jjj}|jjtdt	�d�z�y�d|jj|f}tj
|jj|��|jd�}|jdd�}|jd�}	|r��j|�}
nd}
�jd	�}|r$t|�d
kr$tjtd���nt�|
|	|�}t|�d
krQdnd}
|jjjtd
�t|�|
f�d}xltdtt|�|��D]L}�||j�jd�dd }|jjjd|||f�q�Wt|�|d
krg|jjjd��|dj�jd�dd }|jjjd|d|f�ng|D]}�|^qn}��fd��|r�t�fd�|D��}nd}|r�|dj�nd}d}|r�t|d���}|j�}t |ddt|���Ud&}t|�|krddd}tj|t|�f��n|j!|�}WdQXWdQXnt |dd|��Z��M|r��j"||�n|r��j#||�t$|||||�nWdQXWdQX|tdd d!tj�|d"�WnFt%k
r`}|tdd#d!tj�|d"d$t&|���nXWd�rx�j'�nXdS('NR{R|R�sbundle:%s+%sR�tbookprevnodeRRysheads(bundle())is2cannot push more than one head to a scratch branchtsspushing %d commit%s:
i
is
i2s    %s  %s
s    ...
i����c@st�j�|j���S(N(RRR(R�(R�R^(sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR* Rc3@s|]}�|�VqdS(N((t.0R�(tinindex(sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pys	<genexpr>"sR�RWt
bundlesizeidisbundle is too big: %d bytes. smax allowed size is 100 MBR^t
newheadscountR}R~i�RR�i�i@((R�R�R�R`RWR^R/R�RqR�RJR�RR�R4R�RR�RSRR2RRztwarntrangetmintdescriptionR<tsumRtopenR�R�R�t	addbundletaddbookmarkt_maybeaddpushbackpartRRR(RmR�R�R�tparthandlerstartR/RR�R�RyRxR�R�tpluralt	maxoutputtit	firstlineR�tnodesctxR�tbookmarknodeR|R�t
bundledatatbundlesizelimitt	error_msgR�((R�R^R�sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR��s�)%%%%$
R�R�RytpushbackbookmarksR�c
C@stj|jj�}|jjdd�}tjdd|j��}|jd|�|j	|�t
j|j��}t
j�\}}zNz)tj|d�}|j|j��Wd|j�Xt||j|�Wdytj|�Wn+tk
r}	|	jtjkr�qnXXdS(	s9unbundle a bundle2 part containing a changegroup to storeR�R�RR�R�R�Ni(RR�R`R4R�R�R�R�R�R�RR�R�RR�RR�R�RR�RRterrnotENOENT(
RmR�R�R�R�R�R�R�R�R�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pytbundle2scratchbranchJs&
cC@sr|jd�rn|jrnd|jjkrnidd6|d6|d6|d6}|jjdd	|j��qnndS(
NR�tpushbackR�R�R|tnewtoldRtmandatoryparams(R�R�tcapabilitiesR�R�(RmR�tnewnodeRxR�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyR�hs
cC@s{|jtdrn|jdk	rj|jjd�}|jdt|j�dt�|jdddt�ndS|||�S(	s�Wrapper of bundle2.handlepushkey()

    The only goal is to skip calling the original function if flag is set.
    It's set if infinitepush push is happening.
    R�s
reply:pushkeysin-reply-toR�R�R�iN(	R�R�R�RJR�R�RR�R((R�RmR�R�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRssscC@s"|jtdrdS|||�S(s�Wrapper of bundle2.handlephases()

    The only goal is to skip calling the original function if flag is set.
    It's set if infinitepush push is happening.
    R�N(R�R�(R�RmR�((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyRx�scC@s�d}t|�|krdSg}x(|D] }|jd�|j|�q)Wttjd��]}tj�dd|g|}tjt	j
tj|�dt
dtd	|d
|d|�WdQXdS(s�starts a separate process that fills metadata for the nodes

    This function creates a separate process and doesn't wait for it's
    completion. This was done to avoid slowing down pushes
    i2Ns--nodesw+btdebugfillinfinitepushmetadatas-Rt	close_fdstshelltstdintstdouttstderr(RSR�R�RtdevnullRthgexecutablet
subprocesstPopenRtrapplyRttonativestrR�R((R�R9tmaxnodest	nodesargsR�R�tcmdline((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt_asyncsavemetadata�s

((R�R�RyR�R�(mt__doc__t
__future__RR>t
contextlibR�R�RHRR�treR�R�R�tmercurial.nodeRRtmercurial.i18nRtmercurial.utilsRRt	mercurialRRRR	R
RRR
RRRRRRRRRRRRRt
testedwithtconfigtablet
configitemR(R'RTR�R�trevsetpredicatettemplatekeywordRotcompiletsearcht
_maybehashR5RDR>RVtobjectRWReRgRkRhRiRjR�RmRJR�t	batchableRlR�R�R�R�R�R�R}R�R�R%R'R(R$R�RhRiRWtb2partsgeneratorRwR�RztcontextmanagerR�R�R�R~R�tparthandlerR�R�RsRxR�(((sA/usr/lib64/python2.7/site-packages/hgext/infinitepush/__init__.pyt<module>Ss�v																				
		$T	9			
	1	!	$			2	V	T