HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python2.7/dist-packages/hgext/rebase.pyc

Xc@@sNdZddlmZddlZddlZddlmZddlmZm	Z	m
Z
mZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZej Z ej!Z!dZ"dZ#d	Z$d
Z%dZ&e$e%e&fZ'iZ(ej)e(Z)dZ*d
Z+dZ,dZ-dZ.e/dZ0ej1Z1e1ddZ2de3fdYZ4e)ddddededfdddededfdd ged!edfd"d#ded$edfdd%e5ed&fd'd(ded)ed*fd+d,e5ed-fd.d/ded0ed1fd2d3e5ed4fdd5e5ed6fd7d8e5ed9fd:d;e5ed9fd<d=ded>fd?d@e5edAfdBdCe5edDfge!edEdFZ6e/e/e/ge/dGZ7dHZ8e/e/e/e5e/dIZ9dJZ:dKZ;dLZ<dMZ=dNZ>dOZ?dPZ@dQZAdRZBdSZCdTZDdUZEdVZFe/dWZGdXZHe/dYZIdZZJd[ZKd\ZLd]ZMd^ZNd_ZOd`ZPdaZQdS(bscommand to move sets of revisions to a different ancestor

This extension lets you rebase changesets in an existing Mercurial
repository.

For more information:
https://mercurial-scm.org/wiki/RebaseExtension
i(tabsolute_importN(t_(thextnullidtnullrevtshort(t	bookmarkstcmdutiltcommandstcopiestdestutilterrort
extensionsthgtlocktmergetobsoletetpatchtphasest	registrartrepairtrepoviewtrevsettscmutiltutiliiiiisships-with-hg-corecC@sdS(Ni((((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_nothingtorebaseKscC@sf|jjdd}|dk	r1||d<n|jjdd}|dk	rb||d<ndS(Ntsourcesintermediate-source(textratgettNone(tctxRts((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt
_savegraftNs
cC@s|j|d<dS(Ntbranch(R!(RR((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_savebranchVsc@sfd}|S(smake an extrafn out of the given copy-functions.

    A copy function takes a context and an extra dict, and mutates the
    extra dict as needed based on the given context.
    c@s"xD]}|||qWdS(N((RRtc(tcopiers(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pytextrafn_s
((R$R%((R$s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_makeextrafnYsc
C@s%tj|ddd|dtd|S(shsmall wrapper around destmerge to pass the right extra args

    Please wrap destutil.destmerge instead.tactiontrebaset	sourcesettonheadcheckt	destspace(R
t	destmergetFalse(trepoR)R+((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_destrebasedsR/cC@sPd}|dk	r3tj|tj||}n|tjt||g@S(N(RRtgetsettfullreposettbasesetR/(R.tsubsettxR)((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_revsetdestrebasems!t
rebaseruntimecB@sPeZdZddZdZdZdZdZdZ	dZ
RS(	s2This class is a container for rebase runtime statecC@s9|dkri}n||_||_||_d|_t|_i|_d|_d|_	d|_
t|_t|_
|jdt|_tj|||_|jdd|_|jd}tg|_|r|g|_n|jdt|_|jdt|_|jdt|_i|_dS(NtcollapsetdateR%tkeeptkeepbranchestkeepopen(RR.tuitoptst
originalwdRtexternaltstatetactivebookmarktcurrentbookmarksttargettsettskippedttargetancestorsRR-t	collapsefRt
logmessagetcollapsemsgR8R textrafnstkeepft
keepbranchesfR;tobsoletenotrebased(tselfR.R<R=te((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt__init__|s0										cC@s|j}d}d}t}t}d}i}y|jd}xt|jjD]\}	}
|	dkr||
j}qX|	dkr||
j}qX|	dkr||
j}qX|	dkrt	t
|
}qX|	dkrt	t
|
}qX|	dkr$t	t
|
}qX|	dkrXt|
d	koKd
|
krX|
}qX|
jd
\}
}|t
tt
tt
tt
tfkrt
||||
j<qX|tkrt|||
j<qX||j|||
j<qXWWnAtk
rC}|jtjkr*ntj|tdnX|dkrhtjtdnt}|st|g}xXt|jD]A\}}|tkr||kr|j|n|j|qWn|j j!d
dj"dt|Dpd|j j!dt#||j$||_%||_&||_'||_(||_)||_*||_+||_,||_-dS(s"Restore a previously stored statustrebasestateiiiiiiiiQt:R(s.hg/rebasestate is incompletescomputed skipped revs: %s
t cs@s|]}t|VqdS(N(tstr(t.0tr((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>ssrebase status resumed
N(.R.RR-Rtvfst	enumeratetreadt
splitlinestrevtbooltinttlentsplitRTt	nullmerget
revignoredtrevprecursort	revprunedRtrevtodotIOErrorterrnotENOENTRtwrongtooltocontinueRRtAbortRDtsortedtitemstaddR<tdebugtjoint_setrebasesetvisibilitytkeysR>RCR@RERGRKRLR?RA(RNR.R:RCR7R?RAR@tftitlR>R9toldrevtnewrevterrREtseentoldtnew((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt
restorestatussr	%+	&	'								cC@si|_|jjdddts(dSt|}t|}t|j|||_t|j}t|j|j|||dS(sCompute structures necessary for skipping obsolete revisions

        rebaserevs:     iterable of all revisions that are to be rebased
        obsoleterevs:   iterable of all obsolete revisions in rebaseset
        target:         a destination revision for the rebase operation
        texperimentaltrebaseskipobsoletetdefaultN(RMR<t
configbooltTrueRDt_computeobsoletenotrebasedR.t_checkobsrebase(RNt
rebaserevstobsoleterevsRCt	rebasesettobsoletesett
skippedset((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_handleskippingobsoletes			cC@sy |jt|j|_Wn~tjk
r|rpt|jt|j|jjj	t
ddSt
d}t
d}tj|d|nX|rt|j|j
|j|jd|jSd|jjD}|j|jj||jdS(NsFrebase aborted (no revision is removed, only broken state is cleared)
is#cannot continue inconsistent rebases-use "hg rebase --abort" to clear broken statethintRAcs@s'|]\}}|tkr|VqdS(N(Rb(RURVtst((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>s(RztrestorecollapsemsgR.RIRtRepoLookupErrortclearstatustclearcollapsemsgR<twarnRRitabortR>RCR@RARkRRp(RNtisaborttmsgRtobsrevs((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_prepareabortorcontinues"


cC@s|dkrtStj|jtj}|jp7|rw|jjd||rwtj	t
ddt
dnt|jt|}|j
|||t|j|||j|j}|s|jjt
dtSt|}|jr?|j|jr?tj	t
d|j|dt
dn|\|_|_|_|jr|jjj|jgdt|_t|j|j|j|_n|jr|jr|jjt
d	|ndS(
Nsfirst(children(%ld) - %ld)s;can't remove original changesets with unrebased descendantsRs&use --keep to keep original changesetssnothing to rebase
s can't rebase public changeset %ss see 'hg help phases' for detailst	inclusives reopening closed branch head %s
( RRRt	isenabledR.tallowunstableoptRKtrevsRRiRt_filterobsoleterevsRDRt
buildstateRGRMR<tstatustmintmutableR>RCR@t	changelogt	ancestorsRRFtexternalparentR?tclosesbranchRL(RNtdestRt
allowunstableRtresulttroot((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_preparenewrebases<	cC@s?|j|j|j}}}|jr|jjdt|jrt}xU|j	D]G}|j
||jt|dkrUt
jtdqUqUWqn|js|jj|jgdt|_n|jj|_|jp|j|_|jrtj|n|jd|j	}g|j	jD]\}}|tkr8|^q8}	t|	}
d}x|D]}||}d|j||j j!dddf}
|j"|j#|j$|j#}|r|
dd	j%|7}
n|j	|tkr|d7}|j&td
|
|j'td|d||ftd
|
t(|||j|j	|j|j)\}}}t*||j+|j|j	|j|j,|j|j-|j	t.||j/t|dj1dkr|jj2dnz{|j3dd|j4dddt5|||||j	|j|j}|r|ddkrt
j6tdnWd|j3ddddX|js|t7k}t8j9|d}t8j:d||}t;||||dt<|jd|d|jd|j=}n7|j>j?|j@||j#|j>jAd}|dk	r||j|j	|<|j2dtB|q|js|jCtd||f|jDj
|n||j	|<|j2d|qu|j	|tEkr
|j2d|qu|j	|tFkr:|j&td |
qu|j	|tGkr||j)|}d|j||j j!dddf}td!}|j&||
|fqu|j	|tHkrtd"}|j&||
qu|j&td#|
||j	|fquW|j'tdd|jItd$dS(%Niis'cannot collapse multiple named branchesRssort(%ld, -topo)s
%d:%s "%s"s
s (%s)RSsrebasing %s
trebasings%d:%st
changesetsisresuming interrupted rebase
R<t
forcemergettooltR(is@unresolved conflicts (see hg resolve, then hg rebase --continue)teditformR%teditorR:R8srebased as %s
s3note: rebase of %d:%s created no changes to commit
snext revision set to %s
s!ignoring null merge rebase of %s
snot rebasing ignored %s
s4note: not rebasing %s, already in destination as %s
s+note: not rebasing %s, it has no successor
salready rebased %s as %s
srebase merging completed
(JR.R<R=RLRJtinsertR"RGRDR@RlR!R^RRiRRFRRRCRt
_bookmarkstcopyRBRAt_activebookmarkRt
deactivateRt	iteritemsRdR[tdescriptionR_tnodetagstnodet
nodebookmarksRnRtprogresst
defineparentsRMtstorestatusR>RKR?tstorecollapsemsgRIRtparentsRmt	setconfigRt
rebasenodetInterventionRequiredRRt
mergeeditformtgetcommiteditortconcludenodeR&R8tdirstatetbeginparentchanget
setparentstendparentchangeRRRER`RaRbRctnote(RNR.R<R=tbranchesR[t
sortedrevstktvtcandsttotaltposRtdesctnamestp1tp2tbasetstatstmergingRRtnewnodet	targetctxt
desctargetR((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_performrebase8s			"		4

 (

		

	
 cC@s|j|j|j}}}|jr|jrt|t|j|j|j|j	|j
\}}}|jd}d}|jr|j}	n]d}	xN|jD]C}
|
|j
kr|j|
tkr|	d||
j7}	qqWt}tjd|d|}t|j}t||||jd|	dt|jd|d	|jd
|j}
|
dkrt|j}n||
j}x=|jjD])}|j|tkr||j|<qqWnd|jkrt||j|j
|n|jri}x|jj D]s\}}|tkrJ||j!|||j!<q|t"kr|j
|}||j!|||j!<qqW||jj!}n|jj|j#|j#}|t"kr|j
|j#}n|dkr|j#}n|g|dj$D]}|j^qkrH|j%t&d
t'j(||t)n|j*sd}|jri|
}nt+|||j|j
|n|j,dJ}|jrt-||||j||j.|j/krd|_.qnWdQXt0|t1||j%t&dt2j3|j4ddt|j
rXt5|j
}|j%t&d|n|j.r|dj!|j/|j.krt6j7||j.ndS(Nteditsrebase.collapsesCollapsed revisions
* %sRt	commitmsgR%RR:R8tqtipis0update back to initial working directory parent
tbookmarksrebase completed
tundot
ignoremissings%d revisions have been skipped
t.(8R.R<R=RGR;RRR@RCRFRMRRIRER`RRRRtmaxRR?R&RJRLR8RR[titerkeysttagstupdatemqRBRRRbR>RRRR
t
updaterepoR-RKtclearrebasedttransactiontupdatebookmarksRARRRRt
unlinkpathtsjoinR^Rtactivate(RNR.R<R=RRt_baseteditoptRRtrebasedRt
revtoreuseRRuRttnstateRRtsucct
targetnodetnewwdR#tcollapsedasttrt
skippedlen((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt
_finishrebases			!
%/				


		 N(t__name__t
__module__t__doc__RRPRzRRRRR(((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyR6zs#	H			)	oR(RRRs.rebase the specified changeset and descendantstREVtbRs=rebase everything from branching point of specified changesetRVR[srebase these revisionstdRs#rebase onto the specified changesetR7scollapse the rebased changesetstmtmessages#use text as collapse commit messagetTEXTRORs invoke editor on commit messagesRstlogfiles&read collapse commit message from filetFILERR9skeep original changesetsR:skeep original branch namestDtdetachs(DEPRECATED)RrtinteractivettRsspecify merge toolR#tcontinuescontinue an interrupted rebasetaRsabort an interrupted rebases#[-s REV | -b REV] [-d REV] [OPTION]c	K@st|||}d}}zU|j}|j}|jdd}|jdd}|jdd}|jdg}	|jd}
|jd}|jd}|jdrytjd	rd
}
nWntk
rd}
nXd|
}td
|}t	j
|n|jrH|jrHt	j
tdn|sT|r|rx|rxt	j
tdn|jrt	j
tdn|s|s|rt	j
tdn|r|jdt
r|jtdn|j|}|dk	r\|SnIt||||||	d|
\}}|j||}|dk	r\|S|j|jWdt||XdS(smove changeset (and descendants) to a different branch

    Rebase uses repeated merging to graft changesets from one part of
    history (the source) onto another (the destination). This can be
    useful for linearizing *local* changes relative to a master
    development tree.

    Published commits cannot be rebased (see :hg:`help phases`).
    To copy commits, see :hg:`help graft`.

    If you don't specify a destination changeset (``-d/--dest``), rebase
    will use the same logic as :hg:`merge` to pick a destination.  if
    the current branch contains exactly one other head, the other head
    is merged with by default.  Otherwise, an explicit revision with
    which to merge with must be provided.  (destination changeset is not
    modified by rebasing, but new changesets are added as its
    descendants.)

    Here are the ways to select changesets:

      1. Explicitly select them using ``--rev``.

      2. Use ``--source`` to select a root changeset and include all of its
         descendants.

      3. Use ``--base`` to select a changeset; rebase will find ancestors
         and their descendants which are not also ancestors of the destination.

      4. If you do not specify any of ``--rev``, ``source``, or ``--base``,
         rebase will use ``--base .`` as above.

    Rebase will destroy original changesets unless you use ``--keep``.
    It will also move your bookmarks (even if you do).

    Some changesets may be dropped if they do not contribute changes
    (e.g. merges from the destination branch).

    Unlike ``merge``, rebase will do nothing if you are at the branch tip of
    a named branch with two heads. You will need to explicitly specify source
    and/or destination.

    If you need to use a tool to automate merge/conflict decisions, you
    can specify one with ``--tool``, see :hg:`help merge-tools`.
    As a caveat: the tool will not be used to mediate when a file was
    deleted, there is no hook presently available for this.

    If a rebase is interrupted to manually resolve a conflict, it can be
    continued with --continue/-c or aborted with --abort/-a.

    .. container:: verbose

      Examples:

      - move "local changes" (current commit back to branching point)
        to the current branch tip after a pull::

          hg rebase

      - move a single changeset to the stable branch::

          hg rebase -r 5f493448 -d stable

      - splice a commit and all its descendants onto another part of history::

          hg rebase --source c0c3 --dest 4cf9

      - rebase everything on a branch marked by a bookmark onto the
        default branch::

          hg rebase --base myfeature --dest default

      - collapse a sequence of changes into a single commit::

          hg rebase --collapse -r 1520:1525 -d .

      - move a named branch while preserving its name::

          hg rebase -r "branch(featureX)" -d 1.3 --keepbranches

    Returns 0 on success, 1 if nothing to rebase or there are
    unresolved conflicts.

    RRRR[t
_destspaceRRRthisteditRs --config extensions.histedit=shg%s help -e histeditsOinteractive history editing is supported by the 'histedit' extension (see "%s")s+message can only be specified with collapses"cannot use both abort and continues*cannot use collapse with continue or aborts4abort and continue do not allow specifying revisionsRstool option will be ignored
R+N(R6RtwlockRRRtfindtKeyErrorRRRiRIRGR-RRt_definesetsRRRtrelease(R<R.R=trbsrtRR
tdestftsrcftbaseftrevfR+tcontftabortftenablehisteditthelpRtretcodeRR((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyR(s^n




		
c@s|r$|r$tjtdn|rH|rHtjtdn|rl|rltjtdntjtj|rtj|}n|rtj|}|s|j	tddSn|r2tj|g}	|	s|j	tddSjd|	}|stntj|pDdg}
|
sj|j	tddS|st
|
d	|}t|}njd
|
|j}|dk	rjd||
|}ng}|st|
|jgkr7|r!|j	td|q|j	td
njd|
|s|r|j	tddjfd|
D|fq|j	td|n6|j	tddjfd|
D|fdS|s
t
|d	|}t|}n||fS(s@use revisions argument to define destination and rebase set
    s'cannot specify both a source and a bases)cannot specify both a revision and a bases+cannot specify both a revision and a sources-empty "rev" revision set - nothing to rebase
s0empty "source" revision set - nothing to rebase
s(%ld)::Rs5empty "base" revision set - can't compute rebase set
R+sancestor(%ld, %d)s(%d::(%ld) - %d)::s6nothing to rebase - %s is both "base" and destination
sAnothing to rebase - working directory parent is also destination
s
%ld - ::%dsGnothing to rebase - "base" %s is already an ancestor of destination %s
t+c3@s|]}t|VqdS(N(RT(RURV(R.(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>ssVnothing to rebase - working directory parent is already an ancestor of destination %s
s nothing to rebase from %s to %s
c3@s|]}t|VqdS(N(RT(RURV(R.(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>sN(NN(NN(NN(NN(RRiRRtcheckunfinishedt
bailifchangedRt	revsingletrevrangeRRRtAssertionErrorR/RTtfirsttlistR[Rn(R<R.RRRRR+RRtsrcRt	commonanc((R.s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyR
sl

	'cC@st}t|}xu|D]m}||kr4qnxR||jD]@}|j|krE|j|krE|j|jqEqEWqW|stSt|dkr|jStj	t
dt|djdt
|DfdS(sReturn the revision that should be used as the second parent
    when the revisions in state is collapsed on top of targetancestors.
    Abort if there is more than one parent.
    isKunable to collapse on top of %s, there is more than one external parent: %ss, cs@s|]}t|VqdS(N(RT(RUtp((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>sN(RDRRR[RlRR^tpopRRiRRRnRj(R.R@RFRRR[R#((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRs 	

	c	C@stj|d}	z|j||j||j||}
|dkr^|
j}n|o}||j|
jk}i|
jd6}|r||
|n|jj	dd}
zt
|
jtj
}|jjdd|d|r|jjddtn|dkr,|
j}n|jd|d|
jd	|d
|d|}Wd|jj|
X|jj||j|	j|SWdt|	XdS(
sCommit the wd changes with parents p1 and p2. Reuse commit info from rev
    but also store useful information in extra.
    Return node of committed revision.R(t
rebase_sourceRs
new-commitR<tallowemptycommitttexttuserR8RRN(Rt
dirstateguardRRRRR!RR<tbackupconfigRtphaseRtdraftRRR8tcommitR(t
restoreconfigRt	setbranchtcloseR(R.R[RRRRR%R:R8tdsguardRt
keepbranchRtbackupttargetphaseR((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRs2$
"
c	
C@s7|dj|krM|jjd|||ftj||ttn|jjd|jj|j	|jjd|||f|d
k	r|jjd|||fntj||tt||dddg}|rtj|||n/||j
j}tj|||d	||S(sFRebase a single revision rev on top of p1 using base as merge ancestorRs update to %d:%s
s already in target
s merge against %d:%s
s   detach base %d:%s
tlabelsRRtskiprevN(R[R<RmRtupdateR-RRtwritetcurrenttransactionRR	tduplicatecopiesR(	R.R[RRR@R7RCRtp1rev((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyR4s!cC@sZg|D]}||tkr|^q}|jd||}|rR||jSdSdS(s8return the nearest ancestors of rev in the rebase resultsmax(%ld  and (::%d))N(R`RRR(R.R[R@RVRt
candidates((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pytnearestrebasedQs
)c
@s|jdd}||}|r|rfd|D}td}td}	tj|dj|fd|	ndS(	s;
    Abort if rebase will create divergence or rebase is noop because of markers

    `rebaseobsrevs`: set of obsolete revision in source
    `rebasesetrevs`: set of revisions to be rebased from source
    `rebaseobsskipped`: set of revisions from source skipped because they have
    successors in destination
    R{tallowdivergencec3@s|]}t|VqdS(N(RT(RURV(R.(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>lss+this rebase will cause divergences from: %ss@to force the rebase please set experimental.allowdivergence=Truet,RN(R~RRRiRn(
R.R<t
rebaseobsrevst
rebasesetrevstrebaseobsskippedtdivergenceoktdivergencebasecandidatest	divhashesRth((R.s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRZs
		


c@s||j}t}}d}	|dj}
|
|krE|}nx|
kr|
tkrj|}q|
tkrt||
}|dkr|}qq|
}n|}|
}t|dkr|dj|kr|dj}|krz||kr3|}|tkrw||}	qwq|tkrmt||}|dkrw|}qwq|}q|tkrt	j
td|n|}n|jj
d||	p|j||jftfd|Dsd}n||js-||jj}nXxU||jD]1}
j|
j|kr>|
j}Pq>q>Wd}td|	p|||fS(	sGReturn the new parent relationship of the revision that will be rebasediiis;cannot use revision %d as base, result would have 3 parentss future parents are %d and %d
c3@s!|]}|jkVqdS(N(R[(RUR#(R@(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>ss7no base found to rebase on (defineparents called wrong)N(RRRR[R`t
revskippedR=R^RbRRiRR<RmtanyRRRR(R.R[RCR@RFRMRRRtrp1tp1ntp2nRR#((R@s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRtsZ
		
(


	(	&cC@sUtjj|jj|}x3tjt|dD]}|jdr4tSq4Wt	S(s/Return true if the given patch is in git formattrbs
diff --git(
tostpathRntmqRt
linereadertfilet
startswithRR-(R.t	patchnametmqpatchtline((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pytisagitpatchs
cK@si}|j}|j}t}x|jD]t}||jj}	|	|kr|jjd|	|jf|jt	||jf||	<q,|j
|jq,W|r|j||jxt
|dtD]}	|	|krV||	\}
}|jjtd|
||	|||	f|j|d
d|
d|dt||	gq|j
||	dqWg|D]+}|jj|dd|krv|^qv}
|
|j(t|_|jnd	S(s9Update rebased mq patches - finalize and then import thems.revision %d is an mq patch (%s), finalize it.
treversesupdating mq patch %s to %s:%s
RStgitR[iiN((ROt
fullseriesRDtappliedRR[R<RmtnameRVRltfinishRpRjRRRtqimportRTtguard_reR_tseriesdirtyt	savedirty(R.R@RER=tmqrebaseROtoriginal_seriestskippedpatchesR#R[R[tisgitRt	newseries((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRs4	
	"
+
	cC@sj|j}xM|jD]?\}}||kr||||<tj||g|qqW|j|dS(sEMove bookmarks to their correct changesets, and delete divergent onesN(RRRtdeletedivergenttrecordchange(R.RRtoriginalbookmarksRtmarksRR((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRs	cC@s=|p	d}|jdd}|jd||jdS(s,Store the collapse message to allow recoveryRslast-message.txttws%s
N(RWR8R0(R.RIRq((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRscC@s tj|jddtdS(sRemove collapse message fileslast-message.txtRN(RRRnR(R.((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRscC@svy/|jd}|jj}|jWn@tk
rq}|jtjkrYntjt	dnX|S(s*Restore previously stored collapse messageslast-message.txtsno rebase in progress(
RWtreadlinetstripR0ReRfRgRRiR(R.RqRIRv((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyR sc	C@sa|jdd}	|	j||jd|	j||jd|	j||jd|	jdt||	jdt||	jdt||	jd|pdx|jD]s\}
}||
j}|dkr||j}
n!|tkr"tt}
n|}
|	jd||
fqW|	j|jj	d	d
S(s*Store the current status to allow recoveryRQRjs
s%d
s%s
Ris%s:%s
srebase status stored
N(
RWR8RR]RRdRR0R<Rm(R.R>RCR@R7R9R:R?RARqRRRtRu((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyR,s$
cC@s*t|tj|jddtdS(sRemove the status filesRQRN(t_clearrebasesetvisibiliyRRRnR(R.((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyREs
cC@sg|djD]}|j^q}t|dkr?tStg|jD]\}}|tkrO|^qO}||krtStS(scheck whether we should `update --clean` away from a merge, or if
    somehow the working dir got forcibly updated, e.g. by older hgiN(	RRR[R^R-RRRR(R.R@R#RRxRytfirstunrebased((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt
needupdateJs)c@sPzg|jD]$}|dkr|kr|^q}g|D]}|jsA|^qA}t}	|rjjtddjfd|Ddtdt}	nt}
|rtj	j
|}
n|
t|rjjtdt}	n|	rt}tfd|j}|rgjd	|D]}
|
j^qS}t
gjd
|D]}
|
j^qdk}n|st|rtj|ttn|rtjj|qn|r|jkrtj|nWdttjjtdXdS(
sRestore the repository to its original state.  Additional args:

    activebookmark: the name of the bookmark that should be active after the
        restoreis-warning: can't clean up public changesets %s
s, c3@s|]}t|VqdS(N(RT(RURV(R.(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>jsRs see 'hg help phases' for detailss?warning: new changesets detected on target branch, can't strip
c@s|dko|kS(Ni((R4(RC(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt<lambda>xss
roots(%ld)s	. & (%ld)Nsrebase aborted
(tvaluesRRR<RRRnR-RDRtdescendantstfilterRR^RoRR7RRlRRRRR(R.R>RCR@RARtdstatesRt	immutabletcleanupRrtshouldupdateRR#tstrippoints((R.RCs0/usr/lib/python2.7/dist-packages/hgext/rebase.pyR[s@7) 
			+7

cC@st||d|jkre|jg|jjD]}|j^q5kretjtdnt|j	d|}|stjtdn|j
i}t	}x|D]}	|	j|}
|
|	krtjtdn|
|krN|	j|jk}|rN|rN|	|j
krN|jjddSn|jjd||	f|jtj|tt|	jdkr|j|jj|
jg|	jgqqWx'|D]}||krt||<qqWt|dkrSt	|jd	||}
x+t	|
t	|D]}t||<q<Wnx5|D]-}||dkr}t||<qZt||<qZW|d
j|j|fS(syDefine which revisions are going to be rebased and where

    repo: repo
    dest: context
    rebaseset: set of rev
    Rs&cannot rebase onto an applied mq patchs
roots(%ld)sno matching revisionss!source is ancestor of destinations!source is a child of destination
s rebase onto %s starting from %s
is%ld::%ldRN(RoRRRORZRRiRR RDtsorttancestorR!tchildrenR<RmRR7tdicttfromkeysRdR^RRtfindmissingrevsR[R`RRaRcRb(R.RRR7RMRtrootsR@t	detachsetRt
commonbaset
samebranchRVtrebasedomaintignored((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRsH
%
	
&


cC@stj|tjrg}xt|jD]p\}}|dkr.||kr[d}n)|dk	rw||f}n
||f}|j|||fq.q.W|rtj||qng|D]}||tkr|^q}	|	rg}
xn|j	d|	D]Z}t	|j
j|jgt	|rM|j
tdq|
j|jqW|
rtj|||
dqndS(sdispose of rebased revision at the end of the rebase

    If `collapsedas` is not None, the rebase was a collapse whose result if the
    `collapsedas` node.is
roots(%ld)sAwarning: new changesets detected on source branch, not stripping
tallN((RRtcreatemarkersoptRjRkRtappendt
createmarkersR`RDRRrR[RRRRRl(R<R.R@RERtmarkersR[RutsuccsRtstrippedR((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRs*	
)+cO@sd}|jdrd}}z|j}|j}|jdr`|d=|jdnt|}tj}	d}
|
t_z|||||}Wd|	t_Xt|}||krd|kr|d=nd|kr|d=nt|j	j
d|}||d	<yt|||Wqtj
k
rtj|\}
}}|
|d
jkr|jtdq|jtdtj||qXnWdt||Xn<|jd
rtjtdn|||||}|S(sCCall rebase after pull if the latter has been invoked with --rebaseR(R7sC--update and --rebase are not compatible, ignoring the update flag
c_@sdS(N((targstkwargs((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_dummysNR[RtstartRRsnothing to rebase
s%nothing to rebase - updating instead
Rs%--tool can only be used with --rebase(RRR
RRmR^RtpostincomingR RRR(RtNoMergeDestAbortR
t
destupdateR[RRR7RRi(torigR<R.RR=tretR
RtrevsprepulltorigpostincomingRtrevspostpullR+R[t_at_b((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt
pullrebasesJ
			



cC@sT|j}t|}||_|jjdt}||@rP|jndS(sstore the currently rebased set on the repo object

    This is used by another function to prevent rebased revision to because
    hidden (see issue4505)tvisibleN(t
unfilteredRDt
_rebasesettfilteredrevcacheRtinvalidatevolatilesets(R.Rthiddens((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRoHs	
cC@s+|j}dt|kr'|`ndS(s#remove rebaseset data from the repoRN(RtvarsR(R.((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRmUscC@s)||}|jt|dd|S(s0ensure rebased revs stay visible (see issue4505)R((R7tgetattr(RR.tblockers((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt_rebasedvisible[sc@stfd|DS(s/returns a set of the obsolete revisions in revsc3@s%|]}|jr|VqdS(N(R(RURV(R.(s0/usr/lib/python2.7/dist-packages/hgext/rebase.pys	<genexpr>cs(RD(R.R((R.s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRasc
C@s-i}i}|j}xt|D]l}|j|}xTtj|j|gD]:}y |j|||j|<WqJtk
rqJXqJWqW|r)|j||jgdt|dt	}	xf|D][}||	kr||||<q|||kr|j
j|dkrd||<qqWn|S(sreturn a mapping obsolete => successor for all obsolete nodes to be
    rebased that have a successors in the destination

    obsolete => None entries in the mapping indicate nodes with no succesortstoprevRiN(
RRRt
allsuccessorstobsstoreR[tLookupErrorRRRRqtcountR(
R.R@RRMRtclRVRRtancs((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyRes*	
 
	
cC@stjj|jdsdSy)t||i}|j|j}Wn.tjk
rxt	d}|j
|dSXtg|jD]}|dkr|^q}|j
t	d|j
t	dd||j
t	ddt||fdS(	NRQs8rebase: (use "hg rebase --abort" to clear broken state)
is#rebase: %s, %s (rebase --continue)
s
%d rebasedsrebase.rebaseds%d remainingsrebase.remaining(RMRNtexistsRnR6RzR@RRRR8R^t
itervaluestlabel(R<R.RR@RRrt
numrebased((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pytsummaryhooks


1cC@stjtjdt}|djdddtdf|djdddtdftj	j
dttjjd	t
t
td
tdgtjjd	tdgtjtd
tdS(NtpulliRR(s'rebase working directory to branch headRRsspecify merge tool for rebaseRQsrebase in progresss1use 'hg rebase --continue' or 'hg rebase --abort'shg rebase --continuet_getdynamicblockers(RtwrapcommandRttableRRRRRtsummaryhooksRlRtunfinishedstatesR-tafterresolvedstatestwrapfunctionRR(R<tentry((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pytuisetups		(RRt
__future__RRfRMtmercurial.i18nRtmercurial.nodeRRRRt	mercurialRRRR	R
RRR
RRRRRRRRRRRRttemplateoptsRdR`RaRbRcRGtcmdtabletcommandt
testedwithRR R"R&RR/trevsetpredicateR5tobjectR6R-R(R
RRRR=RRRVRRRRRRRRoRRRRRoRmRRRRR(((s0/usr/lib/python2.7/dist-packages/hgext/rebase.pyt<module>s"|						
								P		#					f		)	
						6	^!	8	
				#