\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s dZddlmZddlZddlmZddlmZmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZddlmZmZde jfdYZiZ ej!e Z!d Z"iZ#ej$e#Z$e$d d d e%e$d d d e%de&fdYZ'de&fdYZ(de&fdYZ)dZ*dZ+e!d dddededfddgededfdd e%ed!fd"d#ged$edfd%d&ged'edfdd(ded)edfd*d+e,ed,fdd e%ed-fd.d/e%ed0fdd ded1ed2fg ed3d4e!j-d5Z.d6Z/ej0Z0e0d7d8Z1ej2Z2e2d9d:d;hd<Z3d=Z4e1e3gZ5dS(>sVcommand to transplant changesets from another branch This extension allows you to transplant changes to another parent revision, possibly in another repository. The transplant is done using 'diff' patches. Transplanted patches are recorded in .hg/transplant/transplants, as a map from a changeset hash to its hash in the source repository. i(tabsolute_importN(t_(t bundlerepotcmdutilterrortexchangethgt logcmdutiltmatchtmergetnodetpatchtpycompatt registrartrevlogtrevsettscmutiltsmartsettutiltvfs(tprocutilt stringutiltTransplantErrorcB@seZRS((t__name__t __module__(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR.ssships-with-hg-coret transplanttfiltertdefaulttlogttransplantentrycB@seZdZRS(cC@s||_||_dS(N(tlnodetrnode(tselfRR((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt__init__Ds (RRR!(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRCst transplantscB@sGeZddddZdZdZdZdZdZRS(cC@sY||_||_||_|s9tj|j|_ni|_t|_|jdS(N( tpathttransplantfiletopenertvfsmodRR"tFalsetdirtytread(R R#R$R%((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR!Is     cC@stjj|j|j}|jrtjj|rxr|jj|jjD]R}tt j |j d\}}|j j |g}|jt||qRWndS(Nt:(tosR#tjoinR$texistsR%R)t splitlinestmapRtbintsplitR"t setdefaulttappendR(R tabspathtlineRRtlist((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR)Ts "!cC@s|jr|jrtjj|js:tj|jn|j|jd}xe|jjD]T}xK|D]C}t t j |j |j f\}}|j|d|dqlWq_W|jnt|_dS(NtwR*s (R(R$R+R#tisdirtmkdirR%R"t itervaluesR/tnodemodthexRRtwritetcloseR'(R tfpR6tttltr((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR=\s $! cC@s|jj|pgS(N(R"tget(R R((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRChscC@s8|jj|g}|jt||t|_dS(N(R"R2R3RtTrueR((R RRR6((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytsetkscC@s;|jj|j}|r7||j|=t|_ndS(N(R"RCRtindexRDR((R RR6((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytremovepsN( RRtNoneR!R)R=RCRERG(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR"Hs    t transplantercB@seZdZdZddZdZeeddZdZ dZ dZ dZ d Z d Zed Zd Zd ZdZRS(c@sp||_jjd|_tj|j|_t|jdd|j|_fd}||_dS(NRR"R%c@s2tjdd}tjd|tjS(NRteditform(Rt mergeeditformRHtgetcommiteditorR t strkwargs(RJ(toptstrepo(s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRL}s (tuiRR,R#R&R%R"RL(R RPRORNRL((RNROs6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR!ws c C@st||r$|jj|}nt||rv|jj|}|jj|g|dt}||krvtSnx}|jj|D]i}t||js|jj|t S|jj|j}||jj|g|dtkrtSqWt S(smreturns True if a node is already an ancestor of parent or is parent or has already been transplantedt inclusive( thasnodet changelogtrevt ancestorsRDR"RCRRGR'( R ROR tparentt parentrevRTt reachableR@tlnoderev((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytapplieds"   c C@s|dkri}nt|}|jj\}}g} tj|j|} t| _d} } z8|j } |j d} x|D]} || }d| t j |f}|j |||r|jjtd|qn|jj|}|jdp|jds|d|kr@| j||}qn| r||krqtj||jd| ntj|| dd td t|jj\}}g} qnt}||krt}t||stj||jd|gqnt}|d tjkr|jd sX|jjtd | t j |ft}q|j|d }||krtjtdt j |t j |fqn |d}|rd}nmt j!dd\}}t"j#|d}tj$|||d| }x|D]}|j%|qW|j&|| =|sG|rzyL|j'|||jj(||d|d|jdd|jd}Wnt)k r| j&nX|r|r|jj*td|t j |fn;|r*|jj*tdt j |t j |fnWd|rDt"j+|nXqqW| j&| rtj||jd| tj|| dd td tnWd|j,|||j-j%| r| j.n| r| j.nXdS(s:apply the revisions in revmap one by one in revision orderRs%d:%ss%skipping already applied revision %s RRitheadsit branchmergetforceiRVsskipping merge changeset %d:%s s%s is not a parent of %stprefixshg-transplant-twbRNR s%s merged at %s s%s transplanted to %s N(/RHtsortedtdirstatetparentsR tdifffeatureoptsRPRDtgittlockt transactionR;tshortRZtwarnRRSRCR3RtpulltpeerR tupdateR'RRRtnullidtnotetlookupRtAbortR tmkstempR+tfdopentdiffR=R>tapplyoneR)Rtstatustunlinkt saveseriesR"trelease(R ROtsourcetrevmaptmergesRNtrevstp1tp2tpullstdiffoptsRettrRTR trevstrRbtdomerget skipmergeRVt patchfiletfdR?tgentchunktn((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytapplys            %               '  c C@sc|jjtd||d|d|d}}}tjdd\}} tj|d} | jd| jd || jd || j|d | jz|jj d |t j | t j |fd i|dd6t j |d6dtjdtddd|jt| ddd!\}}}Wdtj| X|||fS(s0arbitrarily rewrite changeset before applying its filtering %s iiiR^shg-transplant-R_s# HG changeset patch s # User %s s # Date %d %d s s%s %s %stenvirontHGUSERt HGREVISIONtonerrt errprefixs filter failedt blockedtagttransplant_filtertrbN(RPRtRR RpR+RqR=R>tsystemRt shellquoteR;R<RRotparselogtopenRu( R RR RSRtusertdatetmsgRt headerfileR?((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRs(    ,c C@s|d \}} \} } } } d| | f}i|d6}|rf|j||||\} }} n|r| dtj|7} n|jjtdtj||jjd| || f| r| rtj tdn|ry;t } t j |j||d| d dt | } Wqtk r}tjj|jd }tjj|rytj|n|jj}|}|j| || ||d ||jjtj|d ttd qXnd} |r,|jj\}}|j||tj|jd}ntj |jd| }|j!| | |d|d|d|j"}|s|jj#tdtj|dS|s|j$j ||n|S(s>apply the patch in patchfile to the repository as a transplantis%d %dttransplant_sources (transplanted from %s)s applying %s s %s %s %s s"can only omit patchfile if mergingtfilesteolmodetseriesR s s=fix up the working directory and run hg transplant --continuettextraRteditorsskipping emptied changeset %s N(%RR;R<RPRtRRgRmRRoRER RHR6t ExceptionR+R#R,R-RuRaR|RR=Rt forcebytestrRRbt setparentsRtalwaystroottexacttcommitRLRhR"(R ROR tclRR RRtmanifestRttimettimezoneRtmessageRRtinstt seriespathR|R}tmR((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRs"sP $# "cC@s"tjjtjj|jdS(Ntjournal(R+R#R-R,(R ((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt canresumeWsc C@sGtjjtjj|jdr|j|||\}}|rz|jjtdtj |tj |fq|jjtdtj |fntjj|jd}tjj|s|j j dS|j \}}i} x$|D]}|| |j j|(R RyRzRRTR((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRvs"  !c C@sNg}g}tj}t}d}d}x|jjD]}|rV|j|q:|jdrr|d}q:|jdr|d}q:|jdrtj|d}q:|jdr|jtj|dq:|jds:t }|j|q:q:Wd||fkr2t j t d n|||d j ||fS( Ns# User is# Date s # Node ID i s # Parent i s# s,filter corrupted changeset (no user or date)s (RRlR'RHR)R.R3RR0RDRRoRR,( R R?RbRR tinmsgRRR5((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRs.   cC@stjj|js(tj|jn|jdd}|jd||jd||jdtj||jdtj|d|r|jdtj|dn|j|jd|j dS( s,journal changelog metadata for later recoverRR7s # User %s s # Date %s s # Node ID %s s # Parent s N( R+R#R8R9R%R=R;R<trstripR>(R RRRR|R}R R?((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRs!cC@s|j|jdS(NR(RR%(R ((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRscC@s>tjj|jd}tjj|r:tj|ndS(sremove changelog journalRN(R+R#R,R-Ru(R tabsdst((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRsc@sfd}|S(Nc@sj|rtSjj|dtjkr<tSjj|d}|jd}|rj|rtStS(NiiR( RZR'RSRbRRlR)RCRD(R Rtcnode(RORR Rx(s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytmatchfns((R RORxRR((RORR Rxs6/usr/lib64/python2.7/site-packages/hgext/transplant.pyttransplantfilters N(RRR!RZRHRRR'RsRRRRRvRRRRR(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRIvs   m  4   -     cC@s6y|jj|dk SWntjk r1tSXdS(N(RSRTRHRt StorageErrorR'(ROR ((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRRscC@stj|||}g}g}td}x^|D]V}|j||d } x| s%|j|} d| | d!} | dkrx8|j|dD]#\} } |jd| | fqWd } qT| dkrT|jj |d} x*t j || |D]}|j|qWd } qTqTW| dkrB|j |q4| d kr^|j |q4| d krnPq4| d kr4d }d}Pq4q4W|j ||fS(s#interactively transplant changesetssapply changeset? [ynmpcq?]:$$ &yes, transplant this changeset$$ &no, skip this changeset$$ &merge at this changeset$$ show &patch$$ &commit selected changesets$$ &quit and cancel transplant$$ &? (show this help)synmpcq?it?s%s: %s tpityRtctqN(((RtchangesetdisplayerRtshowRHt promptchoicetextractchoicesR=RSRbR RrR3R>(RPRORRNt displayerR"RztpromptR tactiontchoiceRR@RVR((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt browserevss>             tsRxRstransplant changesets from REPOtREPOtbtbranchs!use this source changeset as headtREVtatalls0pull all changesets up to the --branch revisionsRtprunes skip over REVRR s merge at REVRVs)parent to choose when transplanting mergetetedits invoke editor on commit messagess%append transplant info to log messageRtcontinues7continue last transplant session after fixing conflictss!filter changesets through commandtCMDsChg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...t helpcategoryc O@s*|jt||||SWdQXdS(stransplant changesets from another branch Selected changesets will be applied on top of the current working directory with the log of the original changeset. The changesets are copied and will thus appear twice in the history with different identities. Consider using the graft command if everything is inside the same repository - it will use merges and will usually give a better result. Use the rebase extension if the changesets are unpublished and you want to move them instead of copying them. If --log is specified, log messages will have a comment appended of the form:: (transplanted from CHANGESETHASH) You can rewrite the changelog message with the --filter option. Its argument will be invoked with the current changelog message as $1 and the patch as $2. --source/-s specifies another repository to use for selecting changesets, just as if it temporarily had been pulled. If --branch/-b is specified, these revisions will be used as heads when deciding which changesets to transplant, just as if only these revisions had been pulled. If --all/-a is specified, all the revisions up to the heads specified with --branch will be transplanted. Example: - transplant all changes up to REV on top of your current revision:: hg transplant --branch REV --all You can optionally mark selected transplanted changesets as merge changesets. You will not be prompted to transplant any ancestors of a merged transplant, and you can merge descendants of them normally instead of transplanting them. Merge changesets may be transplanted directly by specifying the proper parent changeset by calling :hg:`transplant --parent`. If no merges or revisions are provided, :hg:`transplant` will start an interactive changeset browser. If a changeset application fails, you can fix the merge by hand and then resume where you left off by calling :hg:`transplant --continue/-c`. N(twlockt _dotransplant(RPROR{RN((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR'sD c@stjd}tjd}d}tj|}||||jdsk|jdd|dtfdt"j#|jdDfd}n}tjj|jdd}i}|rxt"j#|D] } | j$|t%| sc@s|o|kS(N((tx(Rttf(s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytsR RR((((+RRR t byteskwargsRCtconfigRIRaRbRRRlRRoRRRtcheckunfinishedRtRRjt expandpathtmaplistRnREtaddt RepoErrorRtgetremotechangesR`RDRHRRRtrevrangeR tintRtextendRSRTR(RPROR{RNRRRttpR|R}RRRBtdt sourcerepoRjR[ttargetRt cleanupfnRRzRytalltransplantst newmerges((RRxRs6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRns  !  !  !!"!!      stransplanted([set])cC@s]|rtj|||}n|}tjg|D]%}||jjdr1|^q1S(sDTransplanted changesets in set, or all transplanted changesets. R(RtgetsetRtbasesetRRC(ROtsubsetRRRB((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytrevsettransplanteds t transplantedtrequiresRcC@s@|j|d}|jjd}|r<tj|p?dS(sEString. The node identifier of the transplanted changeset if any.RRR(tresourceRRCR;R<(tcontexttmappingRR((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytkwtransplantedscC@s/tjjdtttdtdgdS(Nstransplant/journalstransplant in progresss6use 'hg transplant --continue' or 'hg update' to abort(RtunfinishedstatesR3RDR'R(RP((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytextsetups (6t__doc__t __future__RR+tmercurial.i18nRt mercurialRRRRRRRR R R;R R R RRRRRRR&tmercurial.utilsRRRoRtcmdtabletcommandt testedwitht configtablet configitemRHtobjectRR"RIRRRR'tCATEGORY_CHANGE_MANAGEMENTRRtrevsetpredicateRttemplatekeywordR Rt i18nfunctions(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytsV v  .  )   7 v