-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/hgext/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/hgext/transplant.pyc

ó
Ì\,Tc@s€dZddlmZddlZddlZddlmZddlmZm	Z	m
Z
mZddlmZm
Z
mZmZmZmZddlmZmZdejfd	„ƒYZiZejeƒZd
Zdefd„ƒYZd
efd„ƒYZdefd„ƒYZd„Zd„Zeddddedƒedƒfddgedƒedƒfddeedƒfd d!ged"ƒedƒfd#d$ged%ƒedƒfdd&ded'ƒedƒfd(d)e ed*ƒfdd+eed,ƒfd-d.eed/ƒfdd0ded1ƒed2ƒfg
ed3ƒƒd4„ƒZ!d5„Z"d6„Z#d7„Z$e"e#gZ%dS(8sVcommand 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ÿÿÿÿ(t_N(tshort(t
bundlerepothgtmergetmatch(tpatchtrevlogtscmutiltutilterrortcmdutil(trevsett
templatekwtTransplantErrorcBseZRS((t__name__t
__module__(((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRstinternalttransplantentrycBseZd„ZRS(cCs||_||_dS(N(tlnodetrnode(tselfRR((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyt__init__ s	(RRR(((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRsttransplantscBsGeZdddd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsY||_||_||_|s9tj|jƒ|_ni|_t|_|jƒdS(N(tpathttransplantfiletopenerRRtFalsetdirtytread(RRRR((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR%s					cCs¯tjj|j|jƒ}|jr«tjj|ƒr«xr|jj|jƒjƒD]R}tt	j
|jdƒƒ\}}|jj
|gƒ}|jt||ƒƒqRWndS(Nt:(tosRtjoinRtexistsRRt
splitlinestmapRtbintsplitRt
setdefaulttappendR(RtabspathtlineRRtlist((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR0s"!cCsÑ|jrÄ|jrÄtjj|jƒs:tj|jƒn|j|jdƒ}xe|jjƒD]T}xK|D]C}t	t
j|j|j
fƒ\}}|j|d|dƒqlWq_W|jƒnt|_dS(NtwRs
(RRRRtisdirtmkdirRRt
itervaluesR#RthexRRtwritetcloseR(RtfpR*tttltr((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR08s
$!
cCs|jj|ƒpgS(N(Rtget(RR((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR6DscCs8|jj|gƒ}|jt||ƒƒt|_dS(N(RR&R'RtTrueR(RRRR*((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytsetGscCs;|jj|jƒ}|r7||j|ƒ=t|_ndS(N(RR6RtindexR7R(Rt
transplantR*((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytremoveLsN(	RRtNoneRRR0R6R8R;(((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR$s				ttransplantercBs•eZd„Zd„Zid„Zd„Zeedd„Zd„Z	d„Z
d„Zd„Zd	„Z
ed
„Zd„Zd„Zd
„ZRS(cCsd||_|jdƒ|_tj|jƒ|_t|jdd|jƒ|_tj||_dS(NR:RR(	tuiR RRRRRtgetcommiteditorteditor(RR>trepotopts((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRSs	c	Csút||ƒr$|jj|ƒ}nt||ƒrv|jj|ƒ}|jj|g|dtƒ}||krvtSnx}|jj|ƒD]i}t||jƒsµ|jj|ƒt	S|jj|jƒ}||jj|g|dtƒkr‰tSq‰Wt	S(smreturns True if a node is already an ancestor of parent
        or is parent or has already been transplantedt	inclusive(
thasnodet	changelogtrevt	ancestorsR7RR6RR;R(	RRAtnodetparentt	parentrevRFt	reachableR3tlnoderev((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytapplied[s"	c
Cs¿t|ƒ}|jjƒ\}}g}	tj|j|ƒ}
t|
_d}}}
z |j	ƒ}|j
ƒ}|jdƒ}
x©|D]¡}||}d|t|ƒf}|j
|||ƒrß|jjtdƒ|ƒq„n|jj|ƒ}|jdƒp|jdƒs¤|d|kr8|	j|ƒ|}q„n|	r¤||krf|j|jƒd|	ƒntj||	dttdƒ|jjƒ\}}g}	q¤nt}||krít}t||ƒsí|j|jƒd|gƒqínt}|d	tjkr”|jd
ƒsD|jjtdƒ|t|ƒfƒt}qž|j|d
ƒ}||kržtjtdƒt|ƒt|ƒfƒ‚qžn
|d}|r­d}nmtj d
dƒ\}}t!j"|dƒ}tj#|||d|
ƒ}x|D]}|j$|ƒqùW|j%ƒ||=|s-|r„zÛyL|j&|||jj'|ƒ|d|d|jdƒd|jdƒƒ}Wnt(k
rœ|
j%ƒ‚nX|rÒ|rÒ|jj)tdƒ|t|ƒfƒn5|r|jj)tdƒt|ƒt|ƒfƒnWd|r!t!j*|ƒnXq„q„W|
j%ƒ|	rr|j|jƒd|	ƒtj||	dttdƒnWd|j+||ƒ|j,j$ƒ|
r¦|
j-ƒn|j-ƒ|j-ƒXdS(s:apply the revisions in revmap one by one in revision orderR:s%s:%ss%skipping already applied revision %s
tfiltertlogitheadsiÿÿÿÿiRIsskipping merge changeset %s:%s
s%s is not a parent of %stprefixshg-transplant-R+RBRs%s merged at %s
s%s transplanted to %s
N(.tsortedtdirstatetparentsRtdiffoptsR>R7tgitR<twlocktlockttransactionRRMtwarnRRER6R'tpulltpeerRtupdateRRDRtnullidtnotetlookupR	tAbortttempfiletmkstempRtfdopentdiffR0R1tapplyoneRRtstatustunlinkt
saveseriesRtrelease(RRAtsourcetrevmaptmergesRBtrevstp1tp2tpullsRURXRWttrRFRHtrevstrRTtdomerget	skipmergeRIt	patchfiletfdR2tgentchunktn((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytapplyqs¨	


"	"
	



	
$


c
Csc|jjtdƒ|ƒ|d|d|d}}}tjddƒ\}}	tj|dƒ}
|
jdƒ|
jd	|ƒ|
jd
|ƒ|
j|dƒ|
jƒz—t	j
d|t	j|	ƒt	j|ƒfd
i|dd6tj
|ƒd6dt	jdtdƒd|jjƒ|jt|	ƒƒdd!\}}}Wdtj|	ƒX|||fS(s0arbitrarily rewrite changeset before applying its
filtering %s
iiiRQshg-transplant-R+s# HG changeset patch
s
# User %s
s
# Date %d %d
s
s%s %s %stenvirontHGUSERt
HGREVISIONtonerrt	errprefixs
filter failedtoutN(R>RgRRbRcRRdR0R1R	tsystemt
shellquoteRR/RatfouttparselogtfileRh(RRNRHRERvtusertdatetmsgRwt
headerfileR2((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRNÛs& 


)c
Cs²|d \}}	\}
}}}
d|
|f}i|d6}|rf|j||||ƒ\}	}}
n|r†|
dtj|ƒ7}
n|jjtdƒt|ƒƒ|jjd|	||
fƒ|ré|rétj	tdƒƒ‚n|rÝy;t
ƒ}tj|j||d|d	dƒt
|ƒ}Wqãtk
rÙ}tjj|jd
ƒ}tjj|ƒrvtj|ƒn|jjƒ}|}|j|	||
||d|ƒ|jjt|ƒdƒttd
ƒƒ‚qãXnd}|r&|jjƒ\}}|j||ƒtj|jdƒ}ntj|jd|ƒ}|j |
|	|d|d|d|j!ƒ}|s’|jj"tdƒt|ƒƒ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 mergingtfilesteolmodetseriesRs
s1fix up the merge and run hg transplant --continuettextraRR@sskipping emptied changeset %s
N($RNRR/R>RgRRR_R	RaR8RR<R*t	ExceptionRRR R!RhRSRoROR0tstrRRTt
setparentsRtalwaystroottexacttcommitR@RZR(RRARHtclRvRRORNtmanifestR‡ttimettimezoneRŒtmessageRˆRtinstt
seriespathRoRptmRz((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRfösN
$ 	" c
Cstjjtjj|jdƒƒrn|j|||ƒ\}}|jjtdƒt|ƒt|ƒfƒntjj|jdƒ}tjj|ƒs©|j	j
ƒdS|jƒ\}}i}	x$|D]}||	|jj
|ƒ<qÈWtj|ƒ|j|||	||ƒdS(s7recover last transaction and apply remaining changesetstjournals%s transplanted as %s
RŽN(RRR!R trecoverR>RgRRRR0t
readseriesRERFRhR{(
RRARkRBRzRHRžtnodesRmRl((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytresume*s$


cCsá|jƒ\}}}}}t}	|sA|sA|sA|drYtjtdƒƒ‚n|d}
t|ƒdkrÝ|jdƒrÔ|j|dƒ}
|
|krÚtjtdƒt|
ƒt|ƒfƒ‚qÚqÝt	}	ni|d6}|j
ƒ}zÙ|jjƒ\}
}|
|
kr?tjtdƒt
j|
ƒƒ‚n|	r\|j|
|dƒn|j|||d|d	|jƒ}|sžtjtd
ƒƒ‚n|	sº|jj||ƒn|jƒ||fSWd|jƒXdS(s/commit working directory using journal metadataistransplant log file is corruptiRIs%s is not a parent of %sR‹s'working dir not at transplant parent %sRR@s
commit failedN(treadlogRR	RaRtlenR6R`RR7RWRSRTRR/R“R—R@RR8tunlogRj(RRARkRBRHR‡RˆRœRTRRIRRWRoRpRz((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR¡<s> 
"	
	
cCspg}g}|}xQ|jjdƒjƒD]7}|jdƒrL|}q+n|jtj|ƒƒq+W||fS(NRŽs# Merges(RRR"t
startswithR'RR$(RR£RmtcurR)((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR¢dscCsÈ|s
dStjj|jƒs2tj|jƒn|jddƒ}x2t|ƒD]$}|jtj||ƒdƒqQW|rº|jdƒx+|D] }|jtj|ƒdƒq“Wn|j	ƒdS(NRŽR+s
s	# Merges
(
RRR,R-RRRR0RR/R1(RRlRmRŽRFRŸ((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRips"

!c	CsNg}g}tj}t}d}d}xÞ|jƒjƒD]Ê}|rV|j|ƒq:|jdƒrr|d}q:|jdƒrŽ|d}q:|jdƒr³tj|dƒ}q:|jdƒrß|jtj|dƒƒq:|jdƒs:t	}|j|ƒq:q:Wd||fkr2t
jt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
(RR^RR<RR"R'R¨R$R7R	RaRR (	RR2RTRœRHtinmsgR‡RˆR)((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR…s.	

cCsàtjj|jƒs(tj|jƒn|jddƒ}|jd|ƒ|jd|ƒ|jdtj|ƒƒ|jdtj|ƒdƒ|r»|jdtj|ƒdƒn|j|jƒdƒ|j	ƒdS(	s,journal changelog metadata for later recoverR R+s
# User %s
s
# Date %s
s
# Node ID %s
s	# Parent s
N(
RRR,R-RR0RR/trstripR1(RR‡RˆRœRoRpRR2((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRO˜s!cCs|j|jdƒƒS(NR (R…R(R((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR¥§scCs>tjj|jdƒ}tjj|ƒr:tj|ƒndS(sremove changelog journalR N(RRR R!Rh(Rtabsdst((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR§ªscs‡‡‡‡fd†}|S(Ncs„ˆjˆ|ˆƒrtSˆjj|ƒdtjkr<tSˆjj|ƒd}|jdƒ}|r€ˆjˆ|ˆƒr€tStS(NiiR‹(	RMRRERTRR^RR6R7(RHRtcnode(RAR•RRk(s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytmatchfn±s((RRARkR•R®((RAR•RRks4/usr/lib/python2.7/dist-packages/hgext/transplant.pyttransplantfilter°sN(RRRRMR{RNRR<RfR¤R¡R¢RiR…ROR¥R§R¯(((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR=Rs		j	3		(					cCs6y|jj|ƒdk	SWntjk
r1tSXdS(N(RERFR<R
tRevlogErrorR(RARH((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyRD¾scCs•tj|||ƒ}g}g}tdƒ}xQ|D]I}|j||ƒd}	xÅ|	sd|j|ƒ}	|	dkr½x8|j|ƒdD]#\}
}|jd|
|fƒqWd}	qT|	dkrT|jj	|ƒd}x*t
j|||ƒD]}
|j|
ƒqõWd}	qTqTW|	dkr5|j|ƒq4|	d	krQ|j|ƒq4|	d
kraPq4|	dkr4d
}d}Pq4q4W|j
ƒ||fS(s#interactively transplant changesetssÓapply 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?t?is%s: %s
tpityRŸtctqN(((Rtshow_changesetRtshowR<tpromptchoicetextractchoicesR0RERTRReR'R1(R>RAR£RBt	displayerRRmtpromptRHtactionR´R3RIRy((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyt
browserevsÄs<
	 	

R:tsRkRstransplant changesets from REPOtREPOtbtbranchs!use this source changeset as headtREVtatalls0pull all changesets up to the --branch revisionsR²tprunes
skip over REVRŸRsmerge at REVRIs)parent to choose when transplanting mergetetedits invoke editor on commit messagesROs%append transplant info to log messageR´tcontinues7continue last transplant session after fixing conflictsRNs!filter changesets through commandtCMDsChg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...cs/tjd„}tjd„}d„}|||ƒ|jdƒs\|jddƒ|d<n|jdƒs„|jddƒ|d<nt|||ƒ}tj|ƒ|jjƒ\}}	t	|ƒdkrñ|t
jkrñtjt
dƒƒ‚n|jd	ƒsv|	t
jkr'tjt
d
ƒƒ‚n|jƒd \}
}}}
|
s[|s[|s[|
rvtjt
dƒƒ‚qvn|jd
ƒ}|rôtj|||j|ƒƒ}t|j|jddƒƒ}tj|||d|dtƒ\‰}}n*|‰tˆj|jddƒƒ}d}zù|jd	ƒrG|j|ˆ|ƒdS|j|ˆ|ƒ‰|jdƒr±t‡fd†tjˆ|jdƒƒDƒƒ‰‡‡fd†}nˆ}tˆj|jddƒƒ}i}|rxòtjˆ|ƒD]}ˆj|ƒ|t|ƒ<qôWn¼|jdƒs0|rÖˆ|krT|ˆ|d|ƒ}n|ˆ||d|ƒ}|jdƒr„|}n(t|ˆ||ƒ\}}|j|ƒx'|D]}||ˆj j!|ƒ<q³Wnx$|D]}||ˆj j!|ƒ<qÝW|j"|ˆ|||ƒWd|r*|ƒnXdS(sîtransplant 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`.
    css)x"|D]}||ƒr|VqqWdS(N((RAtcsetsRRH((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytincwalk/s
css’|s|jƒ}ng}||}x.|D]&}|j|j||ƒjƒƒq,Wx5|jj||ƒdD]}||ƒrp|VqpqpWdS(s’Yield all nodes that are ancestors of a head but not ancestors
        of dest.
        If no heads are specified, the heads of repo will be used.iN(RPR'tancestorRHREtnodesbetween(RAtdestRPRRGtctxtheadRH((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyttransplantwalk4s

$ cSsþ|jdƒrX|jdƒs<|jdƒs<|jdƒrTtjtdƒƒ‚ndS|jdƒpˆ|pˆ|jdƒpˆ|jdƒs£tjtdƒƒ‚n|jdƒrú|jdƒsÙtjtdƒƒ‚n|rútjtd	ƒƒ‚qúndS(
NRÈRÁRÄRs;--continue is incompatible with --branch, --all and --mergeRks8no source URL, branch revision or revision list provideds --all requires a branch revisions*--all is incompatible with a revision list(R6R	RaR(RBRn((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyt	checkoptsBs-ROR:RNisno revision checked outRÈsoutstanding uncommitted mergesisoutstanding local changesRkRÁt	onlyheadstforceNRÅc3s|]}ˆj|ƒVqdS(N(R`(t.0R5(Rk(s4/usr/lib/python2.7/dist-packages/hgext/transplant.pys	<genexpr>yscsˆ|ƒo|ˆkS(N((tx(RÅttf(s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyt<lambda>{sRRÄR((((#R	R”R6tconfigR=RtcheckunfinishedRSRTR¦RR^RaRRgRR\t
expandpathR#R`RtgetremotechangesR7R<R¤R¯R8RtrevrangetintR½textendRERFR{(R>RARnRBRËRÑRÒttpRoRpRŸRÃR5tdt
sourcerepoR\RPRÊt	cleanupfnR®RmRltalltransplantst	newmerges((RÅRkR×s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyR:ìsvC	

!" 		


cCs]|rtj|||ƒ}n|}tjg|D]%}||jƒjdƒr1|^q1ƒS(s```transplanted([set])``
    Transplanted changesets in set, or all transplanted changesets.
    R‹(RtgetsettbasesetRR6(RAtsubsetRÖR¾R5((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytrevsettransplanted˜s
cKs.|jƒjdƒ}|r*tj|ƒp-dS(sT:transplanted: String. The node identifier of the transplanted
    changeset if any.R‹R(RR6RR/(RARÏtargsRz((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytkwtransplanted£scCsIttjd<ttjd<tjjdt	t
tdƒtdƒgƒdS(NttransplantedRŽstransplant in progresss6use 'hg transplant --continue' or 'hg update' to abort(RéRtsymbolsRëR
tkeywordsRtunfinishedstatesR'R7RR(R>((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pytextsetup©s


	(&t__doc__tmercurial.i18nRRRbtmercurial.nodeRt	mercurialRRRRRRRR	R
RRR
RaRtcmdtabletcommandt
testedwithtobjectRRR=RDR½R<RR:RéRëRðt
i18nfunctions(((s4/usr/lib/python2.7/dist-packages/hgext/transplant.pyt<module>sD"..ÿm		(		ž			

Copyright © 2017 || Recoded By Mr.Bumblebee