�8�c@sudZddlZddlZddlmZmZmZmZmZm Z
mZmZm
Z
mZmZddlmZddlmZddlmZddlZddlZddlZd�Zd�Zd �Zd
�Zd�Zd�Zd
�Zd�Z d�Z!d�Z"e#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)e#d�Z*d�Z+e#d�Z,d�Z-d�Z.de0d�Z1dd�Z2d�Z3dd�Z4d �Z5d!�Z6e0ddddd"�Z7dd#�Z8d$�Z9d%�Z:d&�Z;dd'�Z<dd(�Z=d)�Z>giddd*�Z?d+�Z@d,�ZAd-�ZBd.�ZCd/�ZDd0�ZEdS(1sHOverridden Mercurial commands and functions for the largefiles extensioni�N(thgtcommandstutiltcmdutiltscmutiltmatchtnodetarchivalterrortmerget discovery(t_(thex(trebasecs4d�gitd��fd�}t|��dS(sUoverrides scmutil.match so that the matcher it returns will ignore all
largefilestrelpathcs��|||||�}tj|�}�fd��t�|j�|_t|j�|_t|_|j���fd�|_|S(Ncs#tj|�p!tj|��kS(N(tlfutilt isstandintstandin(tf(tmanifest(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt<lambda>"scs�|�r�|�pdS(N(tNone(R(tnotlfiletorigmatchfn(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR(s(tcopytfiltert_filestsett_fmaptFalset_alwaystmatchfn(tctxtpatstoptstglobbedtdefaultRtm(Rtoldmatch(RRs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt
overridematchs N(RRtinstallmatchfn(RR'((RR&s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytinstallnormalfilesmatchfns cCs&tj}t|d|�|t_|S(NR&(RRtsetattr(RR&((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR(,s cCsttjdtj�t_dS(s�restores scmutil.match to what it was before installnormalfilesmatchfn
was called. no-op if scmutil.match is its original function.
Note that n calls to installnormalfilesmatchfn will require n calls to
restore matchfn to reverseR&N(tgetattrRR(((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytrestorematchfn2scOsJ|jdd�}tj|tj|�|jdd��}d}tj|�r�|jtjddg�}|r�tj|j dt
|��}q�ng}tj|d||�} d�| _|d}
xS|j
| �D]B}| j|�}tj|�|
k}
||
k}|
p|}|rO|rO|
r�|jtd�|�q�q�n|s\|r�tj|�r�|j|�}tjj|�s�q�n|o�tj|�j|ddk}|s�|s�|r||�r|j|�|js�r|jtd �| j|��qqq�q�Wg}g}|j�}z�jd
�s7tj||�}x�|D]}}tj|�}tj ||dddtj!|j|���|j|�||d
kr�|j"|�qd|j#|�qdW|j$�|g|dj#|�D]'}|| j%�krtj&|�^q7}nWd|j'�X|S(NtlargetlfsizetpatternsR$tcSsdS(N(R(txty((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyRGss%s already a largefile
isadding %s as a largefile
tdry_runthasht
executabletr((tpopRRt
getminsizetislfilesrepot
configlisttlongnametmatch_RtroottlistRtbadtwalktexactRtwarnRRtwjointostpathtexiststlstattst_sizetappendtverbosetstatustreltwlocktgettopenlfdirstatetwritestandint
getexecutabletnormallookuptaddtwritetfilestsplitstandintrelease(tuitrepoR!R"R-R.t lfmatchertlfpatstlfnamesR%twctxRRAtlfiletnfileRFtwfiletaboveminR?tstandinsRMt
lfdirstatetstandinname((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt
addlargefiles:sf$$
-
/cs1|jd�}|r5|r5tjtd���ntj|d||��z%t|_|j d�dt�}Wdt
|_X|dj�}g|d|d|d|dgD]4}g|D]!}tj
|�|kr�|^q�^q�\} }
}}��fd �}
d}|rD|g}}|
| |
|td
��}nA||g}}|
| td��}|
|
td��p�|}xTt||�D]B}�js��j|�r��j td
��j|��q�q�W|j�}z7tj�|�}xl|D]d}|s[t|dt
�r<�j td
�|�ntj|j|�dt�n|j|�qW|j�g|D]}tj
|�^q}}g|D]}tj
|�^q�}|dj|�t|dt
�s
x-|D]"}tj|j|�dt�q�n|dj|�Wd|j�X|S(Ntaftersno files specifiedRtcleaniiiicsAx(|D] }�j|�j|��qWtt|�dk�S(Ni(RBRLtinttlen(RUtmsgR(R%RX(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyRB�s
s#not removing %s: file still exists
s<not removing %s: file is modified (use -f to force removal)
sCnot removing %s: file has been marked for add (use forget to undo)
sremoving %s
t_isaddremovet
ignoremissing(RNRtAbortRRRRtTruetlfstatusRKRRRRtsortedRJRARLRMROR+t
unlinkpathRCtremoveRTtforgetRW(RXRYR!R"RftsRR>RtmodifiedtaddedtdeletedRgRBtresultRrRsRMRc((R%RXs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytremovelargefilessV
f
'
""
#cCstj|�p|S(N(RRV(torigRE((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt
decodepath�scOs�|jd�}|rO|jd�r<tjtd���n|||||�St||||�}t|dj��|||||�}t �|dks�|r�dp�dS(NtnormalR-s$--normal cannot be used with --largeii(
R7RNRRmRReR)RRR,(RzRXRYR!R"R|R?Rx((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverrideadd�scOsIt|dj��|||||�}t�t||||�pH|S(N(R)RRR,Ry(RzRXRYR!R"Rx((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverrideremove�scKs4z t|j_||||�SWdt|j_XdS(N(Rnt_repoRoR(RzRYtrev2R"((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridestatusfn�scOs1z t|_|||||�SWdt|_XdS(N(RnRoR(RzRXRYR!R"((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridestatus�s cCs1zt|j_|||�SWdt|j_XdS(N(RnRRoR(RzRYtignoreupdate((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt
overridedirty�scs_gitd�fd�}t|��z t|_|||||�SWdt|_t�XdS(NRc
s��|||||�}tj|�}g|jD]}tj|�^q1}|jj|�t|j�|_t|_|j ��fd�} | |_ |S(s�Matcher that merges root directory with .hglf, suitable for log.
It is still possible to match .hglf directly.
For any listed files run log on the standin too.
matchfn tries both the given filename and with .hglf stripped.
cs;tj|�}|dk r+�|�r+tS�|�}|S(N(RRVRRn(RtlfR6(R(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt lfmatchfns
(
RRRRtextendRRRRR(
R R!R"R#R$RR%RRbR�(R&(Rs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR'�s% (RR(RnRoR,(RzRXRYR!R"R'((R&s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridelog�s c Os�|jdt�}|jdt�}|jdt�}|||||�}|s]|s]|r~|pxtj||||�}n|S(NR-tlfatlfc(R7Rt
lfcommandstverifylfiles( RzRXRYR!R"R-talltcontentsRx((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverrideverifys!cOsB|jdt�}|r+tj||�n|||||�dS(NR-(R7RR�t
debugdirstate(RzRXRYR!R"R-((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridedebugstatescOstj||�}|jtj|j|j��gttt�}|\}}} }
}}}
}|j�}z�drt |�dk}xe|D]]}tj
|�}|d|j�j�tj
|j|��kr�}q�|j|�q�W|j�|rtjtd���qn|ds]x2||| D]}tj|tj
|��q7WnWd|j�X|||||�S(Ntcheckit.suncommitted local changesRg(RRORKR<talwaysR=tgetcwdRRMRiRtdatatstripthashfileRCRnR|RTRRmRt
updatestandinRW(RzRXRYR!R"RcRttunsureRuRvtremovedtmissingtunknowntignoredRgRMtmodR^R((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverrideupdate's,$
$cCs8tj|jj|��|kr%tS|||||�S(N(RRtdirstatet normalizeR(torigfnRYR]tmctxR((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridecheckunknownfileOs!c Cs<|o
|} |||||||||�}
g}x|
D]�| rZ|j|�q;n|\}
}}}td�td�f}tj|
�}|dkrZ|dk rZ||krZ|
|krZ|}|
}td�|}|jj||d�dkr>|j|dd|f�|j|d|j|�f|f�q4|j|dd|f�q;|dkr'tj|
�|kr'|
|kr'tj|
�}|
}td�|}|jj||d�dkr�j|dd|f�q4|j|dd|f�|j|d|j|�f|f�q;|j|�q;W|S(Ns
&Largefiles&Normal filetgsM%s has been turned into a largefile
use (l)argefile or keep as (n)ormal file?iR6sO%s has been turned into a normal file
keep as (l)argefile or use (n)ormal file?( RIRRRVRRXtpromptchoicetflagsR(R�RYtp1tp2tpatbranchmergetforcetpartialtacceptremotet overwritetactionst processedtactionRR%targsRjtchoicesRVR^R((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridemanifestmergens@
(- (c
Cs�|||}}} tj|�s<||||||| �S|j|�sOdS| |krn|j�d} n||j�kr�|jjtd�tj |�tj |j��tj |j��f�n)|jjtd�tj |j���| j�|j�kr*|j
�| j
�kr*dS| j�|j�kr�|j
�| j
�kr�|j|j�|j
�|j��dS|jj
td�tj |�td�td�fd�dkr�dS|j|j�|j
�|j��dSdS(Nismerging %s and %s to %s
smerging %s
s?largefile %s has a merge conflict
keep (l)ocal or take (o)ther?s&Locals&Other(RRtcmpRtparentsRERXRKRRVR�twwriteR�R�(
R�RYtmynodeRztfcdtfcotfcatfcdesttfcothert
fcancestor((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridefilemerge�s6!!%
$%cst|�dkr(||�|�|�S�fd�}tj|�}|d}tjj|�r�tjj||��s�tj||��q�nt} t}
zzy0t�dj
��||�|�|�}WnCtjk
r}t
|�td�kr|�nt} d}nXWdt�Xy�j�Wntk
rF|SXz�yN�j�}
�dj
��d�gitd��fd�}t|��g}xF|D]>}tj|�dk r�|j|�q�|j||��q�WzPtj�g�����fd�}|t_|||�|�|�7}Wd�t_Xtj|��}x3�D]+\}}tj|kr^|j�jtj��r^|j�jtjd ��d �}|j�jtjd ��d �}tjj �j|��p�}tjj|�stj|�n|rWtj!�j|��j|��|j"|�n"tj�j|��j|��|j#|�q^q^W|j$�Wn=tjk
r�}t
|�td�kr�|�q�t}
nXWdt�|
j%�X|
r| rtjtd���n|S(Nics@tj�j�j�|�}tjj�jtj |���S(N(
Rt canonpathR=R�RDREtjoinRCRR(RRE(RY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytmakestandin�si�sno files to copyiRcsg}x^|D]V}tj|�dkrVtj|krV|j|jtjd��q
|j|�q
W�|||||�}tj|�}�fd�} g|jD]!}
| |
�r�tj |
�^q�|_t
|j�|_t|_
|j���fd�|_|S(NR0cstj|��kS(N(RR(R(R(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR
scs4tj|�r0|�kr0�tj|��p3dS(N(RRRVR(R(RR(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyRs(R<tpatkindRRt shortnameRItreplaceRRRRRRRR(R R!R"R#R$tnewpatstpatRR%R^R(RR&(Rs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR'�s
$4 cs�tj|krw|j�jtj��rw|jtjd�}�drwtjj|�rwtdt d���qwn�j
||f��||�dS(NR0R�s$destination largefile already exists(RR�t
startswithRCR�RDRERFtIOErrorRRI(tsrctdestt destlfile(tcopiedfilesR"torigcopyfileRY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridecopyfilesR0R�(&RiRt
expandpatsRDREtisdirtmakedirsRR)RRRRmtstrRRnR,R�tOSErrorRMR(R<R�RItcopyfileRROR�R�RCR�RtdirnametrenameRrRSRTRW(RzRXRYR!R"R�R�tfullpatsR�t
nonormalfilestnolfilesRxteRMR'tlistpatsR�R�RcR�tsrclfileR�tdestlfiledir((R�RR&R"R�RYs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridecopy�s�
$$!" c s��j�}z�tj|��}tj|��dj��\}}} }
}}}
|j�x'|D]}tj�tj|��qfWxT|
D]L}tj j
�jtj|���r�tj�jtj|���q�q�Wzt
j�|jd��}d�gitd��fd�}t|��t
j|�d||�}||�||�Wdt�Xt�dg�}tj|�d|dt�g�_x�|D]�}||kr�tj j
�jtj|���r;|�dkr;tj�tj|��d|j�j�d�d|j�k�q;q�q�Wtj|��}xy|D]q}tj|�}||krX||ks�|jd �rX||kr�|j|�ntj�j|��qXqXW|j�Wd|j �XdS(
NR�trevRc
s���||||�}tj|�}��fd�}g|jD]}||�^qC|_g|jD]}|dk rh|^qh|_t|j�|_t|_|j����fd�} | |_|S(NcsCtj|��kr"tj|�Stj|��dkr?dS|S(N(RRR(R(R RY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt tostandinos
cs�tj|�r|�tj|��ru|�dks@|�krut�dg�}|jtj|��|�_tStSn�|�S(Nt_lfilestoupdate( RRRVRR+RIR�RnR(Rt
lfileslist(R RRY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyRzs (RRRRRRRR(
R R!R"R#R$RR%R�RR(R&RY(R Rs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR'ks%+ R�tfilelisttprintmessageR1R�(!RMRROtlfdirstatestatusR�RTR�RRDRERFRCtunlinkRt revsingleRNRRR(RR,R+R�tupdatelfilesR�RPR�R�R�tdropRRqRW(RzRXRYR!R"RMRcRuRvR�R�R�R�RgR^R R'tmatchesR�R((R&RYs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverriderevertXsP4
$& !
'
%
'cCsw|stj|�}n||||�}d}|sZtj|�}tj||�}ntj|j|d|�|S(NR�(RtgetstandinsstateRtgetlfilestoupdateR�R�RX(RzRYRR�toldstandinsRxR�tnewstandins((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pythgupdaterepo�scCs,|||||�}tj|j|�|S(N(R�R�RX(RzRYRR�tremindRx((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pythgmerge�scKst|�}|sd}n||_|jdt�rt|_z�|jd�rh|d=|jd�n|d=tj|�t j
}d�}|t _
zt j||||�}Wd|t _
Xt|�} | |kr�p�j||�}nWdt|_Xn|||||�}t|�} |jdg�}
|jd�rV|
j
d�n|
r�|kr�}||_zcx\tj||
�D]H}|jtd
�|�tj|||�\}
}|t|
�7}q�WWd|`X|jtd�|�n|S(NR$R
tupdatesC--update and --rebase are not compatible, ignoring the update flag
c_sdS(N((R�tkwargs((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt_dummy�stlfrevtall_largefilesspulled()is#pulling largefiles for revision %s
s%d largefiles cached
(RitlfpullsourceRNRRnt_isrebasingtdebugRt
bailifchangedRtpostincomingtpullR
RItfirstpulledRtrevrangetnoteRR�tcachelfilesRK(RzRXRYtsourceR"trevsprepulltorigpostincomingR�Rxtrevspostpulltlfrevst numcachedR�tcachedR�((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridepull�sL
cCsYy
|j}Wn&tk
r5tjtd���nXg|D]}||kr=|^q=S(sx``pulled()``
Changesets that just has been pulled.
Only available with largefiles from pull --lfrev expressions.
.. container:: verbose
Some examples:
- pull largefiles for all new changesets::
hg pull -lfrev "pulled()"
- pull largefiles for all new branch heads::
hg pull -lfrev "head(pulled()) and not closed()"
s"pulled() only available in --lfrev(RtAttributeErrorRRmR(RYtsubsetR1RR6((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytpulledrevsetsymbol�s
cKsr|}|dkr$tj|�}n|jd�r_tj|�r_tjtd|���n|||||�S(NR�s>--all-largefiles is incompatible with non-local destination %s(RRtdefaultdestRNtislocalRRmR(RzRXRR�R"td((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt
overrideclone s cOs}|||||�}|dk ry|\}}|j�}|jd�rytj||d�\} }
|
dkrvdSqyn|S(NR�i(RtlocalRNR�tdownloadlfiles(RzRXR"R�R�Rxt
sourcerepotdestrepoRYtsuccessR�((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pythgclones
cKs.t|_z||||�SWdt|_XdS(N(RnR�R(RzRXRYR"((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverriderebase&s c
sVtj�j���|tjkrAtjtd�|��n���|dkrx�r�tjtd���q�ntj||��������fd�}
tj|||p��j �d���jj
ddt�r���fd�}|
d d
t|�nx��D]�}�j
|�}
�|j}tj|�r�tj�|�j����dkr�tjtd�tj|���ntj|�}�fd�}|}n|
|d
|
kr�dp�d
d|
k|�qW| rHxTt�j�D]@}�j|�}tj|��}|j�j��|�qWn�j�dS(Nsunknown archive type '%s'RUs*cannot give prefix when archiving to filescsY�r�|�rdS|�}�r;�j||�}n�j�||||�dS(N(t
wwritedatataddfile(tnametmodetislinktgetdataR�(tarchivertdecodeRtprefixRY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyRT?s iRXtarchivemetacsdt�jjd��t���j�f}dj�fd��j�D��}|s�jj�idd6dd6dd6dd 6}t j
�j�|�j���jj�j
d
�\}}djd�|j
d�D��}|d
|7}n||S(Nsrepo: %s
node: %s
branch: %s
iR0c3s.|]$}�j|�dkrd|VqdS(tglobalstag: %s
N(ttagtype(t.0tt(RY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pys <genexpr>Nss{latesttag}
{latesttagdistance}ttemplatetstyletpatchtgits
css|]}d|VqdS(slatesttag: %s
N((R'R(((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pys <genexpr>Vst:slatesttagdistance: %s
(Rt changelogRtbranchR�ttagsRXt
pushbufferRRtshow_changesettshowt popbuffertsplit(tbaseR0R"tltagstdist(R RRY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytmetadataJs.%
"s.hg_archival.txti�s4largefile %s not found in repo store or system cachecs>d}zt�d�}|j�SWd|r9|j�nXdS(Ntrb(Rtopentreadtclose(tfd(RE(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt getdatafnhsR1i�tl(R�RRXRt archiversRRmRt
tidyprefixtdatet
configboolRnRR�R�RRtfindfileR�RRVRptsubstatetsubR<t
narrowmatchertarchivetdone(RzRYR�RtkindR"RR#tmtimetsubreposRTR9RtffR R?tsubpathRGtsubmatch((R!R R"RRRER#RYs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridearchive-sB
&
/ cs��j�jd��jd}�j|}tj|�j|j�������fd�}x�|D]��|j��} |�j}
tj ��rtj
�j|
�j����dkr�
jtd�tj����ntj�����fd�}|}
n|�d| kr.dp1dd | k|
�qlWxdt|j�D]S}|j|�}
tj|��}|
j|�tjj��j�d
|�qUWdS(NRicsI�r���rdS|�}�j��jd||||�dS(Nt/(Rt_path(RRRR R�(R!RRR#RY(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyRT�s s4largefile %s not found in repo store or system cachecsMd}z,ttjj���d�}|j�SWd|rH|j�nXdS(NR:(RR;RDRER�R<R=(R>(RER#(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR?�sR1i�i�R@RR(shg(t_gett_stateRR�RRR�R�RRRER�RRRmRRVRpRFRGR<RHRIRDRER�RS(RzRYRXR!R#RR�R RTRNR R?RORGRP((R!RRRER#RYs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pythgsubrepoarchive|s.
/%cCsl||�t|_|j�d \}}}}t|_|sP|sP|sP|rhtjtd���ndS(Nisoutstanding uncommitted changes(RnRoRKRRRmR(RzRYRuRvR�Rw((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridebailifchanged�s
c Osqt|_|j�d \}}}}t|_|sF|sF|sF|r^tjtd���n|||||�S(Nisoutstanding uncommitted changes(RnRoRKRRRmR( RzRXRYR!R"RuRvR�Rw((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt
overridefetch�s c
Os{t|dj��|||||�}t�tj|d||�}z%t|_|jd|dt�}Wdt |_Xt
|d|d|d|d�}g|D]+} tj| �|dj�kr�| ^q�}xt|D]l} tj| �|j
kr�jj|jtj| ���r�jtd�|j| ��d}q��xJ|D]B} |jsx|j| �rY|jtd�|j| ��qYqYW|j�}
z�tj||�}x;|D]3} || d kr�j| �q�|j| �q�W|j�g|D]} tj| �^q}x*|D]"} tj|j| �d
t�q1W|dj|�Wd|
j�X|S(NRRgiiiis+not removing %s: file is already untracked
sremoving %s
taRl( R)RRR,RRRnRoRKRRpRRR�RDRER�RLRBRRJRARMROR�RrRTRRqRCRsRW(
RzRXRYR!R"RxR%RtRsRRMRcRb((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverrideforget�sB
(8
%
'
"
c
Ks�|j|pd|pd�}tj||jd��\}}tj||||jd��\}}|r�gtj||�D]}|j|�^q}nytj|||�}Wnt j
k
r�dSXtj
||j�dt�} | js�jS|jj| j|�d}
|jd�r4|
j�nt�}x�|
D]�}g|jj|�D]}
|
tjkr]|
^q]}||}t|j��}t|�dkr�|j�}|j�dj�}|j�d j�}x*|D]"}||kr�j|�q��x*|D]"}||kr|j|�qqWxY|D]N}|||j|d�ks�|||j|d�krE|j|�qEqEWn|jtg|D]'}tj|�r�||kr�|^q���}qDWt|�S(
Nsdefault-pushR$R/R�R�itnewest_firstii(t
expandpathRtparseurlRNt
addbranchrevsRRtlookuptpeerRt RepoErrorRR
tfindcommonoutgoingRR�R.tnodesbetweentreverseRR�RtnullidRURiRRStunionRRRp(RXRYR�R"tbranchestrevstcheckoutR�tremotetoutgoingtottouploadtntpR�R RUtmctmp1tmp2R((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytgetoutgoinglfiles�sH!'1
4
8AcKs�|||||�}|jdd�r�t||||�}|dkr^|jtd��q�|sz|jtd��q�|jtd��x(|D] }|jtj|�d�q�W|jd�n|S(NR-slargefiles: No remote repo
slargefiles: no files to upload
slargefiles to upload:
s
(R7RRsRKRRRV(RzRXRYR�R"RxRmtfile((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverrideoutgoings
cOs�z t|_|||||�Wdt|_X|jdd�r�t||d|�}|dkrv|jtd��q�|s�|jtd��q�|jtd�t|��ndS(NR-slargefiles: (no remote repo)
s!largefiles: (no files to upload)
slargefiles: %d to upload
( RnRoRR7RRsRKRRi(RzRXRYR!R"Rm((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridesummary%s
cCs(tj|�s%||||||�Stj|j|�}|jtj|j|j��gt t t �}|\}} }
}}}
}}|r�g|D]}|j
|�^q�}t|_t
|j|||�t |_nt|j|||�t|dj��||||||�}t�|S(N(RR9RORXRKR<R�R=R�RRCRnRkRyReR)RRR,(RzRYR!R"R3t
similarityRcRtR�RuRvR�R�R�R�RgRR%Rx((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytscmutiladdremove8s $" c
sh�j���j�dddtttt���fd�}|�_|��||���_dS(NR�cs��|||||||�}tj���}|\} }
}}}}}g|D]}
||
dkrR|
^qR}g|D]}
||
dkr{|
^q{}| |
|||||fS(Nt?(RRO(tnode1tnode2RR�RgR�tlistsubreposR6RcRuRvR�RwR(t oldstatusRYRX(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR�]s ))(t
unfilteredRKRR(RzRXRYtdirsR"R�((R}RYRXs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt
overridepurgeXs c
Ks�||||�}tj|dddtdtdtj�|j�}z�tj||�}tj |�}tj ||dj
�dj��}x7|D]/} | |kr�|j| �q�|j
| �q�W|j�Wd|j�X|S(NRR�R�R�i(R R�RRRnRRRMROt
listlfilesR�R�RRRSRTRW(
RzRXRYR"RxRMRctlfilest oldlfilesRt((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverriderollbackjs
&
c Os�zqtj|�}t|_|||||�}tj|�}tj||�}tj|j|d|dt�Wdt|_X|S(NR�R�( RR�Rnt_istransplantingR�R�R�RXR( RzRXRYRhR"R�RxR�R�((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridetransplant}s
cs+tj||jd��}d}t��tj||f||�}|j���fd�} | |_|j���fd�}
|
|_x�|j|�D]�}tj ||jd�|j
�d|�}tj|�}
|
dkr-||j�}|jd�r|j||�}n|j|�n�j||
|j��}tj|j|�s�tj|�}|j|
|fg�\}}t|�dkr�tjtd�|
��q�ntj|j|�}t|d �}x'tj|d
�D]}|j|�q�j�|j�d}q�W|S(NR�ics<tj|�}|dkr%�|�S�j|��|�S(N(RRVRRS(RR�(tnotbadR(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyR��s
cs|�kr�||�SdS(N((RRj(R�t origbadfn(s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytlfbadfn�stoutputtpathnameR"s8largefile %s is not in cache and could not be downloadedR:i�iii(RR�RNRRRR?R@RtmakefileobjRRRVRR�RRTtreadstandinR�tinusercacheRXt basestoret
_openstoreRiRRmRt
usercachepathR;t
filechunkiterR=(RzRXRYtfile1R!R"R terrR%R�R�RtfpR�R�R4tstoreRR�REtfpintchunk((R�R�Rs>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytoverridecat�sF !
cCst|j_||�dS(N(RnRYt
_isconverting(Rztsink((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytmercurialsinkbefore�scCst|j_||�dS(N(RRYR�(RzR�((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pytmercurialsinkafter�s(Ft__doc__RDRt mercurialRRRRRRR<RRRR R
tmercurial.i18nRtmercurial.nodeRthgextR
RR�R�R)R(R,ReRyR{R}R~R�R�RR�R�R�R�R�R�R�R�R�R�R�RRnR�RRRRRRQRVRWRXRZRsRuRvRxR�R�R�R�R�R�(((s>/sys/lib/python2.7/site-packages/hgext/largefiles/overrides.pyt<module> sjL E C
( 0 -�S . N2 -(
.
|