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/proc/thread-self/root/usr/lib64/python2.7/site-packages/hgext/rebase.pyc
�
1�3\c@@s�dZddlmZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z#m$Z$dZ%dZ&d	d
ddhZ'iZ(ej)e(�Z)d
Z*d�Z+d�Z,d�Z-e.d�Z/ej0�Z0e0d�d��Z1e0d�d��Z2d�Z3de4fd��YZ5e)dddded�ed�fdd ded!�ed�fd"d#ged$�ed�fd%d&ded'�ed�fdd(e6ed)�fd*d+ded,�ed-�fd.d/e6ed0�fd1d2ded3�ed4�fd5d6e6ed7�fdd8e6ed9�fd:d;e6ed<�fd=d>e6ed<�fd?d@dedA�fddBe6edC�fdDdEe6edF�fdGdHe6edI�fddJdedK�fgej7ej8ej9edL�dMe)j:�dN��Z;dO�Z<e6dP�Z=e6e6dQ�Z>e.e.e.e.e.dR�Z?dS�Z@dT�ZAdU�ZBdV�ZCdW�ZDdX�ZEdY�ZFdZ�ZGd[�ZHd\�ZId]�ZJd^�ZKd_�ZLd`�ZMda�ZNe.eOe6db�ZPdc�ZQdd�ZRe.e6e.eOde�ZSdf�ZTdg�ZUdh�ZVdi�ZWdj�ZXdS(ks�command 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_(tnullrevtshort(t	bookmarkstcmdutiltcommandstcopiestdestutilt
dirstateguardterrort
extensionsthgtmerget	mergeutiltobsoletetobsutiltpatchtphasestpycompatt	registrartrepairtrevsett
revsetlangtscmutiltsmartsettstatetutili����s-1s-2s-3s-4s-5sships-with-hg-corecC@sdS(Ni((((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_nothingtorebaseIscC@sf|j�jdd�}|dk	r1||d<n|j�jdd�}|dk	rb||d<ndS(Ntsourcesintermediate-source(textratgettNone(tctxRts((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt
_savegraftLs
cC@s|j�|d<dS(Ntbranch(R$(R!R((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_savebranchTsc
C@s%tj|ddd|dtd|�S(shsmall wrapper around destmerge to pass the right extra args

    Please wrap destutil.destmerge instead.tactiontrebaset	sourcesettonheadcheckt	destspace(Rt	destmergetFalse(trepoR(R*((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_destrebaseWsR.cC@sPd}|dk	r3tj|tj|�|�}n|tjt||�g�@S(N(R RtgetsetRtfullreposettbasesetR.(R-tsubsettxR(((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_revsetdestrebase`s!t_destautoorphanrebasecC@s�|j�}|jd�}tj|||�j�}|sI||krStj�Stj||�}t	|�dkr�t
jtd�||f��ntj|�S(s9automatic rebase destination for a single orphan revisions
obsolete()is8ambiguous automatic rebase: %r could end up on any of %r(
t
unfilteredtrevsRR/tfirstRR1RtorphanpossibledestinationtlenR
tAbortR(R-R2R3tunfit	obsoletedtsrctdests((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_revsetdestautoorphanrebasems
	cC@s�d|j�||j�jdd�df}|j�}g}xN|jj�D]=\}}|dkroqQn|j|j||j���qQW|r�|ddj|�7}n|S(sshort description for a contexts
%d:%s "%s"s
iitbranchess (%s)t (	trevtdescriptiontsplitR-tnamest	iteritemstextendtnodetjoin(R!tdescR-RFtnsnametns((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_ctxdesc�s #t
rebaseruntimecB@s�eZdZedd�Zed��Zdd�Zd�Z	d�Z
d�Zd�Ze
ed�Zd	�Zd
�Zd�Zdd�Zd
�Zd�ZRS(s2This class is a container for rebase runtime statecC@sW|dkri}nt|_||_||_||_d|_t|_i|_	d|_
i|_t�|_
|jdt�|_tj||�|_|jdd�|_|jd�}tg|_|r�|g|_n|jdd�|_|jdt�|_|jdt�|_i|_t�|_||_tj|d�|_dS(	Ntcollapsetdatetextrafntuishistory-editing-backuptkeeptkeepbranchestrebasestate( R R,tpreparedt_repoRStoptst
originalwdRtexternalRtactivebookmarktdestmaptsettskippedRt	collapsefRt
logmessagetcollapsemsgRQR#textrafnst
configbooltbackupftkeepft
keepbranchesftobsoletenotrebasedt%obsoletewithoutsuccessorindestinationtinmemorytstatemodtcmdstatetstateobj(tselfR-RSRjRYte((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt__init__�s4	
											cC@s!|jr|jj�S|jSdS(N(RWRXR6(Rn((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR-�s	
cC@sT|r%|jdd|jdd�n+|jjdd��}|j|�WdQXdS(s*Store the current status to allow recoveryRVtlocationtplaintwN(RV(taddfilegeneratort_writestatusR-tvfs(Rnttrtf((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytstorestatus�s
c	C@ss|j}|jdkst�|j||jj�d�|jd�|j||jj�d�|jdt|j	��|jdt|j
��|jdt|j��|jd|jp�d�|j
}x�|jj�D]s\}}||j�}|dkr#||j�}n
d|}|||j�}|jd|||f�q�W|jjd�dS(	Ns
s%d
s%s
tis%ds	%s:%s:%s
srebase status stored
(R-t
filternameR tAssertionErrortwriteRZthexR[tintR`RfRgR\R]RRGRStdebug(	RnRxR-R]tdtvtoldrevtnewrevtdestnode((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRu�s$	
	
cC@s�|jj�s+tj|jtd��n|j�}|jjjd�|d|_	|d|_
|d|_|d|_|d|_
|d|_|d	|_|d
|_|d|_dS(
s"Restore a previously stored statusR'srebase status resumed
RZR]RR_RPRTRUR[R\N(RmtexistsRtwrongtooltocontinueR-Rt_readRSR�RZR]RR_R`RfRgR[R\(Rntdata((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt
restorestatus�s







cC@sat|_|j}|jdks't�idd6dd6dd6td6dd6dd6}d}i}i}trd|jd�}x�t|j	�j
��D]�\}}|dkr�||j�|d<q�|d	kr�|r]||j�}q]q�|d
kr||j�|d<q�|dkr6tt
|��|d<q�|dkr[tt
|��|d<q�|d
kr�tt
|��|d<q�|dkr�t|�dko�d|kr�||d<q�|jd�}	||	dj�}
|	d	}|tkr�q�nt|	�d
kr ||	d
j�}n|}|||
<|tkrIt||
<q�||j�||
<q�Wn|ddkr�tjtd���n||d<||d<t�}
|ds t|j��}xXt|j��D]A\}}|tkr||kr|
j|�n|j|�q�Wn|
|d<|jjddjd�t|
�D��pXd�|S(NRURPR\R[RTRZRViiiiiiiiQt:s.hg/rebasestate is incompleteR]RR_scomputed skipped revs: %s
RBcs@s|]}d|VqdS(s%dN((t.0tr((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>5sRz(tTrueRWR-R{R R|RRvt	enumeratetreadt
splitlinesRCtboolRR:REtlegacystatest
revtodostrtrevtodoR
R;RR^tvaluestsortedtitemstaddRSR�RJ(RnR-R�t
legacydestRR]RxtitltargsR�R�tdestrevR_tseentoldtnew((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR��sj		%+





	

'cC@s�i|_|jjdd�s"dSt|�}t|j||�\|_|_}t|j�}|j|j�|j|�t|j|j||�dS(s�Compute structures necessary for skipping obsolete revisions

        obsoleterevs:   iterable of all obsolete revisions in rebaseset
        destmap:        {srcrev: destrev} destination revisions
        texperimentaltrebaseskipobsoleteN(	RhRSRdR^t_computeobsoletenotrebasedR-Ritupdatet_checkobsrebase(RntobsoleterevsR]tobsoletesettobsoleteextinctsuccessorst
skippedset((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_handleskippingobsolete9s	!
cC@s�y#|j�t|j|�|_Wn~tjk
r�|rst|j�t|j�|jjj	t
d��dSt
d�}t
d�}tj|d|��nX|r�|o�|j}t
|j|j|j|jd|jd|d|�SdS(	NsFrebase aborted (no revision is removed, only broken state is cleared)
is#cannot continue inconsistent rebases-use "hg rebase --abort" to clear broken statethintR\tbackupt	suppwarns(R�trestorecollapsemsgR-RbR
tRepoLookupErrortclearstatustclearcollapsemsgRStwarnRR;RetabortRZR]RR\(RntisabortR�R�tmsgR�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_prepareabortorcontinueLs"


c
C@s5|s
t�S|j�}tj|jtj�}|jp=|r}|jjd||�r}tj	t
d�dt
d���nt|j||j�}|s�|j
jt
d��t�Sx\|jjd|�D]E}|jr�|j�r�tj	t
d�|dt
d���q�q�W|\|_|_|_|jr�t|jj��}t|�d	krwtj	t
d
���ntt|��}|jjj|gdt�}t|j|j|�|_nx`tt|j���D]F}|j|}	|	j�r�|jr�|j
jt
d�|	�q�q�Wt|_ dS(
Nsfirst(children(%ld) - %ld)s;can't remove original changesets with unrebased descendantsR�s&use --keep to keep original changesetssnothing to rebase
s
roots(%ld)s can't rebase public changeset %ss see 'hg help phases' for detailsis3--collapse does not work with multiple destinationst	inclusives reopening closed branch head %s
(!RtkeysRt	isenabledR-tallowunstableoptRfR7R
R;Rt
buildstateR`RStstatusR^tmutableRZR]RR�R:tnexttitert	changelogt	ancestorsR�texternalparentR[R�tclosesbranchRgRW(
RnR]t	rebasesett
allowunstabletresulttrootR?R�t
destancestorstdest((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_preparenewrebasebsD		
!cC@s�|jrAddlm}||j�|_|jjjd�n#|jd|_|jjjd�|jjjddd|j�dS(Ni(toverlayworkingctxsrebasing in-memory
srebasing on disk
R'Rztrebase_imm_used(	Rjtmercurial.contextR�R-twctxRSR�R tlog(RnR�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_assignworkingcopy�s	c@sF|j�|j|j}}|jr�|jjdt�|jr�t�}xU|j	D]G}|j
||j��t|�dkrUt
jtd���qUqUWq�nt|j|j	�}|j||j�|jp�|j|_|jr�tj|�n|j�|r|j|�ng|j	j�D]\}}|tkr,|^q,}	|jjtd�dtd�dt|	����fd�}
|jjd	d
�}x~t|j�D]m}|jjd|�}
|s�|
|jjd|j|j�8}
nx$|
D]}|j||||
�qWq�W�j �|j!td
��dS(Niis'cannot collapse multiple named branchestrebasingtunitt
changesetsttotalc@s$�jdd|j�|f�dS(Ntitems%d:%s(t	incrementRC(R!(tp(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytprogress�sR�sevolution.allowdivergencessort(%ld, -topo)sdescendants(%ld) and not %ldsrebase merging completed
("R�R-RSRgRctinsertR%R`R^RR�R$R:R
R;Rt_filterobsoleterevsR�R]R\t_activebookmarkRt
deactivateRyRGR�tmakeprogressRdt
sortsourceR7Rit_rebasenodetcompletetnote(RnRwR-RSRARCtobsrevstkR�tcandsR�tallowdivergenceR2t
sortedrevs((R�s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_performrebase�sF
			"	
4!	

cC@s�|j}||}|d
kr.|j�}n|j}|d
krR|j�}ni|j�d6}	x|jD]}
|
||	�qoW|jo�||j�|j�k}t|j	�t
j�}i|d6}
|r�t|
d<n|j
j|
d���|jrTt|||d|jd|	d	|d
|d|j�d|�}tjj|�n6t|||d|	d	|d
|d|j�d|�}|d
kr�tjj|�n|SWd
QXd
S(s�Commit 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.t
rebase_sourceRs
new-commitRStallowemptycommitR'R�Rt	commitmsgteditortuserRQN(Rs
new-commit(RSR�(R-R RDRQR~RcRgR$tmaxtphaseRtdraftR�RStconfigoverrideRjtcommitmemorynodeR�R�tmergemodt
mergestatetcleant
commitnode(RnRCtp1tp2R�R�R-R!RQRtct
keepbrancht	destphaset	overridestnewnode((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt
_concludenode�sD	
	%

				c
C@s|j|j|j}}}|j|}||}	t|	�}
|j||krm|jtd�|
�n�|r�||jkr�td�|
}|jj|�|j	j
|�nI||jkrn|j|}|dkr�td�|
}n&t||�}
td�|
|
f}|jj|�|j	j
|�t
t|||j|j|j	��}||j|<n�|j|tkr�|jtd�|
�||	�t|||j|j|j	|j�\}}}|jrt|dj��dkr|jjd�n�i|jdd	�d6}|j|d��kt|||||j|d
|j�}|jdkr�|jr�tj��q�tjtd���nWdQX|js|tk}tj |d�}tj!d|t"j#|��}|j$||||�}n=|jr#|jj%||�n|j&||j'��d}|dk	r}||j(�|j|<|jdt)|��q�|js�|j*td�||	f�|j	j
|�n||j|<|jd|�n(|jtd�|
||j|f�|s|j+�ndS(Nsalready rebased %s
sInote: not rebasing %s and its descendants as this would cause divergence
s+note: not rebasing %s, it has no successor
s4note: not rebasing %s, already in destination as %s
srebasing %s
isresuming interrupted rebase
ttoolRzRSt
forcemergeR'R�is@unresolved conflicts (see hg resolve, then hg rebase --continue)teditformsrebased as %s
s3note: rebase of %d:%s created no changes to commit
snext revision set to %d
salready rebased %s as %s
(RSR(,R-RSRYR]RNRR�RRiR_R�RhR R�t
adjustdestR�t
defineparentsRjR:tparentsR�RR�t
rebasenodeR`R�tunresolvedcountR
tInMemoryMergeConflictsErrortInterventionRequiredRRt
mergeeditformtgetcommiteditorRt	strkwargsR�tsetbaset
setparentsRIRCRR�Ry(RnRwRCR�t
progressfnR-RSRYR�R!RKR�tsucctsuccdescR�R�tbaseR�tstatstmergingRR�R�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR��s�

	
	
	

&				
cC@sr|j|j|j}}}|jd|�}|j�|jr�t|t|j�|j	|j|j
|j�\}}}|jd�}d}	|j
r�|j
}
nPd}
xAt|j�D]0}||j
kr�|
d||j�7}
q�q�Wt}tjd|d|	�}t|j�}
|j|
||j|d|
�}|dk	r�||j�}x!|jD]}||j|<qcWq�nd|j�kr�t||j|j
tj|��n|jj|j|j�}|d	kr�|j}n|g|dj�D]}|j�^q�krE|jtd
��t j!||dt"�nd}|jrg|j#rg|}nt$|||j	|j|j
||j#d|d
|j%�t&|�t'|�|jtd��t(j)|j*d�dt�|j
rt+|j
�}|jtd�|�n|j,�|j-rn|j-|j.krn|dj/�|j.|j-krnt0j1||j-�ndS(NR'teditsrebase.collapsesCollapsed revisions
* %sRR�tqtipis0update back to initial working directory parent
t	overwritetfmR�srebase completed
tundot
ignoremissings%d revisions have been skipped
t.(2R-RSRYt	formattert	startitemR`RtminRR]R_RhRRbR�RDR�RR
R�R�R[R RCttagstupdatemqRRRZRR�RRt
updaterepoR,RftclearrebasedReR�R�Rt
unlinkpathtsjoinR:tendR\t
_bookmarksRIRtactivate(RnR-RSRYRR�R�t_baseteditoptRR�trebasedR�t
revtoreuseR�R�R�tnewwdR�tcollapsedast
skippedlen((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt
_finishrebaseOsb
		/	

	
 N(t__name__t
__module__t__doc__R,R RptpropertyR-RyRuR�R�R�R�R�R�R�R�R�R�R.(((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRO�s,				E		-	
	5-	TR'R"RRzs.rebase the specified changeset and descendantstREVtbRs=rebase everything from branching point of specified changesetR�RCsrebase these revisionsR�R�s#rebase onto the specified changesetRPscollapse the rebased changesetstmtmessages#use text as collapse commit messagetTEXTRoRs invoke editor on commit messagesR�tlogfiles&read collapse commit message from filetFILER�RTskeep original changesetsRUskeep original branch namestDtdetachs(DEPRECATED)R�tinteractivettR�sspecify merge tooltstopsstop interrupted rebaseR�tcontinuescontinue an interrupted rebasetaR�sabort an interrupted rebasesauto-orphanssLautomatically rebase orphan revisions in the specified revset (EXPERIMENTAL)s#[-s REV | -b REV] [-d REV] [OPTION]thelpcategoryc
K@s�tj|�}|jdd�}|jd�}|jd�}gdddgD]}|j|�rO|^qO}t|�dkr�tjtd	�t|d
 ���n|r�|dnd}|r�|r�tjtd�|��n|r|rtjtd
�|��n|r2|r2tjtd���n|sJ|j
�dk	rSt}n|jd�r�xI|D]A}	|	dkri|j|	�ritjtd�d|	��qiqiWt|j
|jd���}
tjd|
�g|d<d|d<n|s�|rt||||�S|dkrt||�}|j���|j���|j�|jrqtjtd���ntj|tj�}|jp�|s�tjtd�dtd���nt||j�r�tj||jdt�n|j �dSWdQXWdQXn�|r�yCitd6}
|j!|
d��t"||||d|�SWdQXWq�tj#k
r�|j$td��t%j&j'|�t(|�t)|�t"||||dt�SXnt"||||�SdS( s�move 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.

    If ``--source`` or ``--rev`` is used, special names ``SRC`` and ``ALLSRC``
    can be used in ``--dest``. Destination would be calculated per source
    revision with ``SRC`` substituted by that single source revision and
    ``ALLSRC`` substituted by all source revisions.

    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, aborted with --abort/-a, or stopped with
    --stop.

    .. 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

      - stabilize orphaned changesets so history looks linear::

          hg rebase -r 'orphan()-obsolete()' -d 'first(max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::) + max(::((roots(ALLSRC) & ::SRC)^)-obsolete()))'

    Configuration Options:

    You can make rebase require a destination if you set the following config
    option::

      [commands]
      rebase.requiredest = True

    By default, rebase will close the transaction after each commit. For
    performance purposes, you can configure rebase to use a single transaction
    across the entire rebase. WARNING: This setting introduces a significant
    risk of losing the work you've done in a rebase if the rebase aborts
    unexpectedly::

      [rebase]
      singletransaction = True

    By default, rebase writes to the working copy, but you can configure it to
    run in-memory for for better performance, and to allow it to run if the
    working copy is dirty::

      [rebase]
      experimental.inmemory = True

    Return Values:

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

    R'sexperimental.inmemorytdry_runtconfirmR�R>R?iscannot use --%s with --%siis&cannot specify both --dry-run and --%ss&cannot specify both --confirm and --%ss+cannot specify both --confirm and --dry-runtauto_orphanss&--auto-orphans is incompatible with %ss--s%ld and orphan()RCs_destautoorphanrebase(SRC)R�s!cannot stop in --collapse sessions<cannot remove original changesets with unrebased descendantsR�s^either enable obsmarkers to allow unstable revisions or use --keep to keep original changesetsRNtsingletransactionRjs?hit merge conflicts; re-running rebase without in-memory merge
(R'RE(*RtbyteskwargsRdRR:R
R;RttupleR tcurrenttransactionR,tlistR7Rt
formatspect
_dryrunrebaseROtwlocktlockR�R`RR�R�Rft
needupdateRRR RZR�R.R�t	_dorebaseRR�R�R�R�R�R�(RSR-RYRjtdryrunRCR�t
selactionsR&tkeytuserrevstrbsrtR�R�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR'�sl�1	




	

#

cC@s�t||dtd|�}|jd�}|rF|jtd��n|jtd��|j��9|j��&t}z�yLitd6}|j|d��'t|||||dtdt�WdQXWn(t	j
k
r�|jtd	��d
SX|rS|jtd��|jtd��s.|j�n|j
d
tdtdt�t}n|jtd��dSWd|r�|j
d
tdtdt�nXWdQXWdQXdS(NRjRYRCsstarting in-memory rebase
s8starting dry-run rebase; repository will not be changed
R'REtleaveunfinishedshit a merge conflict
isrebase completed successfully
s!apply changes (yn)?$$ &Yes $$ &NoR�R�R�sWdry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
i(R'RE(ROR�RR�RRLRMR�t_origrebaseR
RtpromptchoiceR.R�R,(RSR-R&RYRTRCt
needsabortR�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRKms:



	cC@s1t||||�}t|||||d|�S(NRj(RORV(RSR-R&RYRjRT((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRO�scC@s|dkst�|j���|j���|jdd�}|jdd�}|jdd�}	|jdg�}
|jd�}|jd�r�ytjd�r�d	}nWntk
r�d
}nXd|}
td�|
}t	j
|��n|jr|jrt	j
td
���n|r�|jrFt	j
td���n|sX|	sX|rpt	j
td���n|dkr�|jdt
�r�|jtd��n|dkr�tjj|�}tj|�n|jd|dk�}|dk	rP|SnSt||||||	|
d|�}|j|�}|dk	r@|St||j�d}|jdd�}|r�|jd�}ntj|��cd}|r�|r�tj|d�}ntj|��%|j|�|s�|j�nWdQXWdQXWdQXWdQXdS(NR>R�RRRCt
_destspaceR<thisteditRzs --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 collapse with continue or aborts4abort and continue do not allow specifying revisionsR�R�stool option will be ignored
R?R�R*R'RE(R|RLRMRR RtfindtKeyErrorRR
R;RbR`R,R�R�R�R�RtcheckunresolvedR�t_definedestmapR�tstorecollapsemsgRdttransactionRtacceptinterventionR	R�R.(RSR-R&RYRTRjRUtdestftsrcftbaseftrevfR*tenablehisteditthelpR�tmstretcodeR]Rwtsingletrtdsguard((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRV�sl





		

c@s�|d*krg}n|r9|r9tjtd���n|r]|r]tjtd���n|r�|r�tjtd���n|s�tj��tj��n|jdd�r�|r�tjtd�dtd���nd*}|rtj	�|�}	|	s�|j
td	��d*Sn�|rxtj	�|g�}
|
sW|j
td
��d*S�jd|
�}	|	s�t�n?tj	�|p�dg�}|s�|j
td
��d*S|r�tj
�|�}n%�t�|d|�}t|�}g}i}
xL|D]D}�jd||j��j�}|
j|g�|g|
|<qWd*|
krd|
j�nx9|
j�D]+\}}|t�jd||��7}qqW�jd|�}	|	s�t|�|j�gkr	|r�|j
td�|�q�|j
td��n��jd||j��s}|rc|j
td�dj�fd�|D��|f�q�|j
td�|�n6|j
td�dj�fd�|D��|f�d*S�dj�|	k}|jddd|�|r|rtj��tj��n|s:�t�|	d|�}t|�}ntjd|	�}i|d6}|d*krXytj
�|d |�}WqXtjk
rTi}x�|	D]�}tjd!|�|d"<�j|gd#td |�}t|�}|d$kr|j�||<q�|d%kr0|jtd&��|�q�tjtd'��|��q�WqXXn|d*k	r�|j���fd(�|	D�}n|s�|j
td)��d*S|S(+s:use revisions argument to define destmap {srcrev: destrev}s'cannot specify both a source and a bases)cannot specify both a revision and a bases+cannot specify both a revision and a sourceRsrebase.requiredestsyou must specify a destinationR�suse: hg rebase -d REVs-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(%d, %d)schildren(%d) & ancestors(%ld)s%ld::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(tbytes(R�R�(R-(s2/usr/lib64/python2.7/site-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(Rm(R�R�(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>7sR'Rztrebase_rebasing_wcps%ldtALLSRCt
localaliass%dtSRCR�iis skipping %s - empty destination
s'rebase destination for %s is not uniquec@si|]}�|�qS(((R�R�(R�(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys
<dictcomp>`s	s&nothing to rebase - empty destination
N(R R
R;RRtcheckunfinishedt
bailifchangedRdRtrevrangeR�R7R|t	revsingleR.RmRCR8RtclearRGRIRJR�RRJR�tanyrevsR�R:R�(RSR-RjRbRcRdReR*R�R�R>RtrootstbpbaseR4tbptbstrebasingwcptallsrctaliasR]R�tdestsettsize((R�R-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR^�s�	

!!
#'


cC@s�t�}t|�}xu|D]m}||kr4qnxR||j�D]@}|j�|krE|j�|krE|j|j��qEqEWqW|s�tSt|�dkr�|j�Stj	t
d�t|�djd�t
|�D��f��dS(s�Return the revision that should be used as the second parent
    when the revisions in state is collapsed on top of destancestors.
    Abort if there is more than one parent.
    isKunable to collapse on top of %d, there is more than one external parent: %ss, cs@s|]}d|VqdS(s%dN((R�R�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>}sN(R^RRRCR�RR:tpopR
R;RR�RJR�(R-RR�RRRCR�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�hs 	

	c	C@s�|j�r&|jjdd�r&d	S||j�}	d|krO|d}	n|j|d||fd|d|d|d|	d|�}
|j|
�}|j�|S(
sXCommit the memory changes with parents p1 and p2.
    Return node of committed revision.RSR�R$RRQRR�R�N(tisemptyRSRdR R$ttomemctxt	commitctxR�(R-R�R�R�R�RR�RQR�R$tmemctxt	commitres((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�s"

c
C@s�tj�}|jjdd�s6tj|d�}n|�q|j||j�||j��|jd|d|d|d|d|�}	|jj	||	j
��|	SWdQXdS(	sTCommit the wd changes with parents p1 and p2.
    Return node of committed revision.R'REttextR�RQRR�N(RtnullcontextmanagerRSRdR	R
RItcommittdirstatet	setbranchR$(
R-R�R�R�RR�RQR�RkR�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR��s$c	C@s|j�r |j||�n�|dj�|krs|jjd|||f�tj||dtdt�n|jjd�|d}|j
j|j��|jjd|||f�|dk	r�|jjd|||f�ntj||dtdtd|d	|d
ddgd
|�}|rIt
j||||�n2||j�j�}t
j||||d|�|S(sFRebase a single revision rev on top of p1 using base as merge ancestorRs update to %d:%s
tbranchmergetforces already in destination
s merge against %d:%s
s   detach base %d:%s
tancestort
mergeancestortlabelsR�RtwctskiprevN(t
isinmemoryRRCRSR�R�R�R,R�R R�R}RHRtduplicatecopiesR�(	R-RCR�RRPR�R�Rtp1rev((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�s&
!c
C@s||}g|j�D]:\}}|dkr|||kr||kr|^q}g}	x�|jj|�D]�}
|}|
tkr�|jd||
�j�}|dk	r�||}q�n||kr||kr||}|tkrtj	d|��qn|	j
|�qpW|	S(s�adjust rebase destination given the current rebase state

    rev is what is being rebased. Return a list of two revs, which are the
    adjusted destinations for rev's p1 and p2, respectively. If a parent is
    nullrev, return dest without adjustment for it.

    For example, when doing rebasing B+E to F, C to G, rebase will first move B
    to B1, and E's destination will be adjusted from F to B1.

        B1 <- written during rebasing B
        |
        F <- original destination of B, E
        |
        | E <- rev, which is being rebased
        | |
        | D <- prev, one parent of rev being checked
        | |
        | x <- skipped, ex. no successor or successor in (::dest)
        | |
        | C <- rebased as C', different destination
        | |
        | B <- rebased as B1     C'
        |/                       |
        A                        G <- destination of C, different

    Another example about merge changeset, rebase -r C+G+H -d K, rebase will
    first move C to C1, G to G1, and when it's checking H, the adjusted
    destinations will be [C1, G1].

            H       C1 G1
           /|       | /
          F G       |/
        K | |  ->   K
        | C D       |
        | |/        |
        | B         | ...
        |/          |/
        A           A

    Besides, adjust dest according to existing rebase information. For example,

      B C D    B needs to be rebased on top of C, C needs to be rebased on top
       \|/     of D. We will rebase C first.
        A

          C'   After rebasing C, when considering B's destination, use C'
          |    instead of the original C.
      B   D
       \ /
        A
    ismax(%ld and (::%d))s-rev %d should be rebased already at this timeN(R�R�t
parentrevsRR7R8R R�R
tProgrammingErrortappend(
R-RCR]RR_R�R"R�RR�tprevtadjustedt	candidate((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�s"5
4
c	@s�|jdd�}||}|r|r�fd�|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
    `rebaseobsskipped`: set of revisions from source skipped because they have
    successors in destination or no non-obsolete successor.
    R�sevolution.allowdivergencec3@s|]}t�|�VqdS(N(Rm(R�R�(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>ss+this rebase will cause divergences from: %ssJto force the rebase please set experimental.evolution.allowdivergence=Truet,R�N(RdRR
R;RJ(	R-RSt
rebaseobsrevstrebaseobsskippedtdivergenceoktdivergencebasecandidatest	divhashesR�th((R-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�s			


cc@sj|jdkst�|jj}xBtj|j||j�g�D]}||krD||VqDqDWdS(s,yield revision numbers for successors of revN(	R{R R|R�tnodemapRt
allsuccessorstobsstoreRI(R<RCR�R"((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt
successorrevs%s
)c@s��jdkst��j}|j�|�}�jj��}ttg}	t��|||��t|�}
t	d�|dD��r��d|	d<n�x1t
|�D]#\�}|}t���fd�t�|�D��r���}n)||kr||dkr||}n�||�r:t|
�<nx�t
|	� �D]u\}
}|tkriqKn�||�r�t}qK�||�rK||	|
<t}|
�|
|
|
|
<|
�<qKqKW||	�<q�W|	dtkr7|d|	dkr7t
|	�dkrt
|�dks t�|	j�|
j�nt|	�t|�kr�||	kr�tjtd����f��nt��fd�|	D��r�tjtd���n|
dtkr�|
d}nd}td	�|
D��dkr�ddg}x�t
|
�D]�\�}|tkr.qnt�jd
|
|||��}|rg|j�D]*\}}|dkrb||krb|^qb}g|D]%}|j|�dtkr�|^q�}t�jd|||��|�<qqWtd�t
|�D��\}�|
�}�dkrU|	�tkrU|	�|	d|	d<|	�<n|dkr�td
�j�fd�|D��}tjtd����|f��q�n�jjdt|	��|	d|	d|fS(sReturn new parents and optionally a merge base for rev being rebased

    The destination specified by "dest" cannot always be used directly because
    previously rebase result could affect destination. For example,

          D E    rebase -r C+D+E -d B
          |/     C will be rebased to C'
        B C      D's new destination will be C' instead of B
        |/       E's new destination will be C' instead of B
        A

    The new parents of a merge is slightly more complicated. See the comment
    block below.
    cs@s|]}|tkVqdS(N(R(R�R�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>Gsiic3@s"|]}�|���VqdS(N((R�R3(R?R�t
isancestor(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>csis>cannot rebase %d:%s without moving at least one of its parentsc3@s*|] }|tko!��|�VqdS(N(R(R�R�(R�RC(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>�ss!source is ancestor of destinationcs@s!|]}|tkrdVqdS(iN(R(R�R4((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>�ss((%ld-%d) %% (%d+%d))s%ld - (::%ld) - %ldcs@s3|])\}}|dk	rt|�|fVqdS(N(R R:(R�R�R7((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>�ss or c3@s:|]0}|dk	rdj�fd�|D��VqdS(s, c3@s#|]}d|�|fVqdS(s%d:%sN((R�R�(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>�sN(R RJ(R�R7(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>�ss4rebasing %d:%s will include unwanted changes from %ss future parents are %d and %d
N(R{R R|R�t
isancestorrevR�RRRItallR�tanyR�R:treverseR^R
R;RtsumR7R�RRJRSR�RG(R-RCR]RR_t
obsskippedtclR�toldpstnewpstbasesR�tnptjR3RtunwantedtsiderevsR�R�R�tmergesR�tunwanteddesc((R?R�R�R-RCs2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR-s�		
+


	
$$*

$
$
%	
 
	cC@sUtjj|jj|�}x3tjt|d��D]}|jd�r4tSq4Wt	S(s/Return true if the given patch is in git formattrbs
diff --git(
tostpathRJtmqRt
linereadertopent
startswithR�R,(R-t	patchnametmqpatchtline((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytisagitpatch�s
cK@s�i}|j}|j}t�}x|jD]t}||jj�}	|	|kr�|jjd|	|jf�|jt	||j�f||	<q,|j
|j�q,W|r�|j||j��x�t
|dt�D]�}	|	|krT||	\}
}|jjtd�|
||	|||	f�|j|dd|
d|dd||	g�q�|j
||	d�q�Wg|D]+}|jj|d	�d|krt|^qt}
|
|j(t|_|j�nd
S(s9Update rebased mq patches - finalize and then import thems.revision %d is an mq patch (%s), finalize it.
R�supdating mq patch %s to %d:%s
R�tgitRCs%diiN((R�t
fullseriesR^tappliedRIRCRSR�tnameR�R�tfinishR�R�R�R�Rtqimporttguard_reREtseriesdirtyt	savedirty(R-RR_RYtmqrebaseR�toriginal_seriestskippedpatchesR�RCR�tisgitR"t	newseries((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�s4	
	"
+
	cC@s=|p	d}|jdd�}|jd|�|j�dS(s,Store the collapse message to allow recoveryRzslast-message.txtRss%s
N(RvR}tclose(R-RbRx((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR_scC@s|jjddt�dS(sRemove collapse message fileslast-message.txtRN(RvR"R�(R-((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�scC@s�y/|jd�}|j�j�}|j�WnOtk
r�}|jtjkrY�n|rhd}q�tjt	d���nX|S(s*Restore previously stored collapse messageslast-message.txtRzs'missing .hg/last-message.txt for rebase(
RvtreadlinetstripR�tIOErrorterrnotENOENTR
R;R(R-R�RxRbterr((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR� s	cC@s<|j�}|r"|jd�n|jjddt�dS(sRemove the status filesRVRN(RHtremovefilegeneratorRvR"R�(R-Rw((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�0scC@s�g|dj�D]}|j�^q}t|�dkr?tStg|j�D]\}}|tkrO|^qO�}||kr�tStS(s�check whether we should `update --clean` away from a merge, or if
    somehow the working dir got forcibly updated, e.g. by older hgiN(	R RRCR:R,RRGRR�(R-RR�RR�R�tfirstunrebased((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRN8s)c@shz-g|j�D]:\}}|dkr||kr|||kr|^q}	g|	D]}
�|
j�sW|
^qW}t}|r��jjtd�dj�fd�|D��dtd��t}nt�}
|	r�t�j	j
|	��}
n|
t|	�r&�jjtd��t}n|rt}|	rfg�jd|	�D]}|j�^qK}nt|	�}|j|j
��|j|��d	j�|k}|s�t�|�r�tj�|d
tdt�n|	rtj�j�|d|�qn|r,|�jkr,tj�|�nWd
t��t��|sc�jjtd��nXdS(s�Restore 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(Rm(R�R�(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>ZsR�s see 'hg help phases' for detailssDwarning: new changesets detected on destination branch, can't strip
s
roots(%ld)RR�R�R�Nsrebase aborted
(R�R�R�RSR�RRJR,R^R�tdescendantsRIR�R�R�RCRNR�RR�R%RR&R�R�(R-RZR]RR\R�R�R�R"R)R�t	immutabletcleanupR�tshouldupdateR�tstrippointstupdateifonnodes((R-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�IsF4) 
			.
"

cc@s�t|�}x�|r�t|�}g}x.|D]&}|||kr.|j|�q.q.W|svtjtd���n|t|�8}|VqWdS(s�yield source revisions in an order that we only rebase things once

    If source and destination overlaps, we should filter out revisions
    depending on other revisions which hasn't been rebased yet.

    Yield a sorted list of revisions each time.

    For example, when rebasing A to B, B to C. This function yields [B], then
    [A], indicating B needs to be rebased first.

    Raise if there is a cycle so the rebase is impossible.
    s#source and destination form a cycleN(R^R�R�R
R;R(R]tsrcsettsrclistR�R�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR��s
	
c@s�|j�}�dj�}d�j�kr�t�fd��jjD��}t|j��|@r�tjt	d���q�nt
t|��}|s�tjt	d���nt
�jd|d��}|s�tjt	d���nd�}t|d	|�}t
j|t��t|�d
k}	x|D]}
�||
j�}|
j|�}||
kr~tjt	d���n||kr'�d}
||
j�kr�|
j�|
j�k}n|
j�|j�k}|r'|r'||
j�kr'|
j��|
j�<�jjd�q1q'nt}	�jjd
||
f�q1W|	rUdSxtt��D]f}g�jj|�D]}|tkr{|^q{}|rbt�fd�|D��rb|�|<qbqbW||�fS(slDefine which revisions are going to be rebased and where

    repo: repo
    destmap: {srcrev: destrev}
    RRc3@s"|]}�|jj�VqdS(N(RIRC(R�R"(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>�ss&cannot rebase onto an applied mq patchsno matching revisionss
roots(%ld)icS@s
|j�S(N(RC(R�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytrevof�sRRis!source is ancestor of destinations!source is a child of destination
s rebase onto %s starting from %s
c3@s$|]}�j|�|kVqdS(N(R(R�R�(R(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>�sN(R�RCRR^R�R�R�R
R;RRIR�R�tdicttfromkeysR�R:R�R R�R$RRSR�R,R�R�RR�(R-R]RPR�RZt	mqappliedt	sortedsrcRxR�temptyrebaseR�R�t
commonbaseR�t
samebranchRCR�R((R-Rs2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR��sN"	

	1"c	C@s|jj}	i}
i}tj|tj�}g}
x�t|j��D]�\}}|dkrG||krG|	|�}|p�|	|�}|||<|sd}||kr�|s�||j�r�d}q�n|r�|
j|�n	|f}|dk	r||
|f<qqqGqGW|
r/|f|
t	|
�<nt
j||
d|d|�|r|j}|j
}|j}i}x`|
j�D]R\}}xC|D];}|g|D]}||�^q�dd�|||�<q�WqW||dddd	�}|jd
|�ndS(
s~dispose 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.

    If `keepf` is not True, the rebase has --keep set and no nodes should be
    removed (but bookmarks still need to be moved).

    If `backup` is False, no backup will be stored when stripping rebased
    revisions.
    iR'R�R�RIRRtoldnodetvaluetnewnodestnodechangesN((R�RIRR�tcreatemarkersoptR�R�R R�RGRtcleanupnodesthexfunct
formatlistt
formatdictRGR�(RSR-R]RR_R,RfRR�ttonodetreplacementstmoveststripcleanuptcollapsednodesRCR�R�R�tsuccsthftfltfdtchangestoldnstnewntoldntnR�((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR!�sB

				
=c
O@sWd}|jd�r|jdd�rWtd�}td�}tj|d|��n|j���|j���|jd�r�|d=|jd�nt	j
|�t	j|dtd	��t|�}t
j}	d
�}
|
t
_z|||||�}Wd|	t
_Xt|�}||krd|kr8|d=nd
|krN|d
=nt|jjd|��}||d<yt|||�Wqtjk
rtj|�\}
}}|
|dj�kr�|jtd��q|jtd��t
j||�qXnWdQXWdQXn<|jd�r>tjtd���n|||||�}|S(sCCall rebase after pull if the latter has been invoked with --rebaseR'Rsrebase.requiredests,rebase destination required by configurations)use hg pull followed by hg rebase -d DESTR�R�sC--update and --rebase are not compatible, ignoring the update flag
sCcannot pull with rebase: please commit or shelve your changes firstc_@sdS(N((R�tkwargs((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_dummy"sNRCRtstartRYRsnothing to rebase
s%nothing to rebase - updating instead
R�s%--tool can only be used with --rebase(R RRdRR
R;RLRMR�RRrRsR:RtpostincomingRIR�R7R'tNoMergeDestAbortRt
destupdateRCR�R�(torigRSR-R�RYtretR�R�trevsprepulltorigpostincomingRtrevspostpullR*RCt_at_b((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt
pullrebase
sP


			



&c@st�fd�|D��S(s/returns a set of the obsolete revisions in revsc3@s%|]}�|j�r|VqdS(N(R(R�R�(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>Ks(R^(R-R7((R-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�Isc@smi}tg�}tg�}|jdks3t�|j}|j�t|jd��}x|D]�}|j|�}	ttj	|j
|	g��}
|
j|	��fd�|
D�}|j|�r�|j
|�n|
s�d||<qa�|}xf|D]&}
|j|
|�r�|
||<Pq�q�W||ksLt�fd�|D��ra|j
|�qaqaW|||fS(s�Return (obsoletenotrebased, obsoletewithoutsuccessorindestination).

    `obsoletenotrebased` is a mapping mapping obsolete => successor for all
    obsolete nodes to be rebased given in `rebaseobsrevs`.

    `obsoletewithoutsuccessorindestination` is a set with obsolete revisions
    without a successor in destination.

    `obsoleteextinctsuccessors` is a set of obsolete revisions with only
    obsolete successors.
    s	extinct()c@s&h|]}|�kr�|�qS(((R�R"(R�(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<setcomp>gs	c3@s|]}|�kVqdS(N((R�R"(R](s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys	<genexpr>xsN(R^R{R R|R�R�R7RIRR�R�tremovetissubsetR�R�R�(R-R�R]RhRiR�R�textinctrevstsrcrevtsrcnodet
successorstsuccrevstdstrevtsuccrev((R]R�s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR�Ms4		





(cC@s�|jjd�sdSy)t||i�}|j�|j}Wn.tjk
rotd�}|j|�dSXt	g|j
�D]}|dkr�|^q��}|jtd�|jtd�d�||jtd�d�t	|�|f�dS(	NRVs8rebase: (use "hg rebase --abort" to clear broken state)
is#rebase: %s, %s (rebase --continue)
s
%d rebasedsrebase.rebaseds%d remainingsrebase.remaining(RvR�ROR�RR
R�RR}R:t
itervaluestlabel(RSR-RTRR�R�t
numrebased((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytsummaryhook�s


1cC@s�tjtjdt�}|djdddtd�f�|djdddtd�f�tj	j
dt�tjjd	t
t
td
�td�g�tjjd	td�g�dS(
NtpulliRzR's'rebase working directory to branch headR=R�sspecify merge tool for rebaseRVsrebase in progresss1use 'hg rebase --continue' or 'hg rebase --abort'shg rebase --continue(RtwrapcommandRttableRR�R RRtsummaryhooksR�RtunfinishedstatesR,tafterresolvedstates(RStentry((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytuisetup�s		(YR1t
__future__RR�R�tmercurial.i18nRtmercurial.nodeRRt	mercurialRRRRRR	R
RRR
R�RRRRRRRRRRRRRRkRR�R�R�tcmdtabletcommandt
testedwithRR#R%R R.trevsetpredicateR4R@RNtobjectROR,t
dryrunoptst
formatteroptstconfirmoptstCATEGORY_CHANGE_MANAGEMENTR'RKRORVR^R�R�R�RRR�R�RR�RR_R�R�R�RNR�R�R�R�R!RR�R�RR#(((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt<module>sx�			
	�����	'F	�				$	I			�		)					9		@0	<		4