ó çƒQc@sdZddlmZmZmZmZmZmZmZddlm Z m Z m Z m Z m Z mZddlmZddlmZddlmZddlmZddlZddlZd Zd ZiZejeƒZd Zed d ddedƒedƒfdddedƒedƒfddgedƒedƒfdddedƒedƒfddeedƒfdddedƒed ƒfd!d"eed#ƒfd$d%ded&ƒed'ƒfdd(eed)ƒfdd*eed+ƒfd,d-eed.ƒfd/d0ded1ƒfd2d3eed4ƒfd5d6eed7ƒfgeed8ƒƒd9„ƒZd:„Z e!e!e!d;„Z"d<„Z#d=„Z$d>„Z%d?„Z&d@„Z'dA„Z(dB„Z)dC„Z*dD„Z+dE„Z,dF„Z-e!dG„Z.dH„Z/dI„Z0dS(JsÓcommand to move sets of revisions to a different ancestor This extension lets you rebase changesets in an existing Mercurial repository. For more information: http://mercurial.selenic.com/wiki/RebaseExtension iÿÿÿÿ(thgtutiltrepairtmergetcmdutiltcommandst bookmarks(t extensionstpatchtscmutiltphasestobsoleteterror(t templateopts(tnullrev(trelease(t_Niþÿÿÿiýÿÿÿtinternaltrebasetstsourcets#rebase from the specified changesettREVtbtbasesarebase from the base of the specified changeset (up to greatest common ancestor of base and dest)trtrevsrebase these revisionstdtdests#rebase onto the specified changesettcollapsescollapse the rebased changesetstmtmessages#use text as collapse commit messagetTEXTtetedits invoke editor on commit messagestltlogfiles&read collapse commit message from filetFILEtkeepskeep original changesetst keepbranchesskeep original branch namestDtdetachs (DEPRECATED)ttttoolsspecify merge tooltctcontinuescontinue an interrupted rebasetatabortsabort an interrupted rebases#[-s REV | -b REV] [-d REV] [OPTION]c1KsM d3}}d3}t}i}tƒ}tƒ} d3} |jdƒrOtj} nd3} } zß |jƒ} |jƒ} |jdd3ƒ} |jdd3ƒ}|jdd3ƒ}|jdgƒ}|jdƒ}|jdƒ}|jdtƒ}tj ||ƒ}|jd ƒ}|jd tƒ}|jd tƒ}|jd tƒ}|rh| rht j t d ƒƒ‚n|st|rK|r˜|r˜t j t dƒƒ‚n|r¶t j t dƒƒ‚n|sÈ|sÈ| ràt j t dƒƒ‚n|jdtƒr|j t dƒƒnt|ƒ\ }}}}}}}}}|rµt||||ƒSnj|ro|rot j t dƒƒ‚n|r“|r“t j t dƒƒ‚n|r·|r·t j t dƒƒ‚ntj|ƒ| sç|d3jƒ}||}ntj|| ƒ}|r|jd|ƒ}nc|rDtj||gƒ}|jd|ƒ}n3tj||pVdgƒ}|jd|||ƒ}|rŒt|ƒ}nd3}|s±|jjdƒd3}n^|p½tj rú|jd||ƒrút j t dƒdt dƒƒ‚nt||||ƒ}|s,|jt dƒƒd S| rp||jƒ rpt j t d!ƒ||dt d"ƒƒ‚nE|\}}}|rµ|jj|gd#t ƒ} t!||| ƒ}n|r>| sÎt"d$ƒ‚d%„}|r>tƒ} xR|D]G}!| j#||!jƒƒt$| ƒd krít j t d&ƒƒ‚qíqíWq>n| sb|jj|gd#t ƒ} n|j%j&ƒ}"|p}|j'}|r–t(j)|ƒnt*|ƒ}#t$|#ƒ}$d'}%x|#D]}!|%d 7}%||!d(kr»|j+t d)ƒ|%d*|!||!ft d+ƒ|$ƒt,|||||||||ƒ t-||!||| ƒ\}&}'t$|j.ƒƒd,kry|jjd-ƒn€zi|j/d.d/|jdd0ƒƒt0||!|&||ƒ}(|(rá|(d1d'krát1j2t d2ƒƒ‚nWd3|j/d.d/d0ƒXtj3||!|ƒ|s6t4||!|&|'d |d4| ƒ})n|j5||&j6ƒƒd3})|)d3k rv||)j7ƒ||!||||n|"rR i},xG|j?ƒD]9\}-}.|.t9kr ||.j6ƒ|,||-j6ƒt ƒ|r |j8t d?ƒt$|ƒƒn|r7 |d@j6ƒ|j%|kr7 t(jE||ƒnWd3tF| | ƒXd3S(Asú 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. You should not rebase changesets that have already been shared with others. Doing so will force everybody else to perform the same rebase or they will end up with duplicated changesets after pulling in your rebased changesets. In its default configuration, Mercurial will prevent you from rebasing published changes. See :hg:`help phases` for details. If you don't specify a destination changeset (``-d/--dest``), rebase uses the tipmost head of the current named branch as the destination. (The destination changeset is not modified by rebasing, but new changesets are added as its descendants.) You can specify which changesets to rebase in two ways: as a "source" changeset or as a "base" changeset. Both are shorthand for a topologically related set of changesets (the "source branch"). If you specify source (``-s/--source``), rebase will rebase that changeset and all of its descendants onto dest. If you specify base (``-b/--base``), rebase will select ancestors of base back to but not including the common ancestor with dest. Thus, ``-b`` is less precise but more convenient than ``-s``: you can specify any changeset in the source branch, and rebase will select the whole branch. If you specify neither ``-s`` nor ``-b``, rebase uses the parent of the working directory as the base. For advanced usage, a third way is available through the ``--rev`` option. It allows you to specify an arbitrary set of changesets to rebase. Descendants of revs you specify with this option are not automatically included in the rebase. By default, rebase recreates the changesets in the source branch as descendants of dest and then destroys the originals. Use ``--keep`` to preserve the original source changesets. Some changesets in the source branch (e.g. merges from the destination branch) may be dropped if they no longer contribute any change. One result of the rules for selecting the destination changeset and source branch is that, unlike ``merge``, rebase will do nothing if you are at the latest (tipmost) head of a named branch with two heads. You need to explicitly specify source and/or destination (or ``update`` to the other head, if it's the head of the intended source branch). If a rebase is interrupted to manually resolve a merge, it can be continued with --continue/-c or aborted with --abort/-a. Returns 0 on success, 1 if nothing to rebase. R"RRRRR-R/RtextrafnR&R'tkeepopens+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 revisionsR+stool option will be ignored 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%lrs(%ld)::t.s+(children(ancestor(%ld, %d)) and ::(%ld))::s base is ancestor of destination sfirst(children(%ld) - %ld)s;can't remove original changesets with unrebased descendantsthints&use --keep to keep original changesetssnothing to rebase is#can't rebase immutable changeset %sssee hg help phases for detailst inclusives(cannot use both keepbranches and extrafncSs|jƒ|dXsR3ssee hg help phases for detailss?warning: new changesets detected on target branch, can't abort iÿÿÿÿcs|dko|ˆkS(Niÿÿÿÿ((tx(R~(s0/sys/lib/python2.7/site-packages/hgext/rebase.pytess roots(%ld)srebase aborted iN(tvaluesRRVRRJRR»RCRWt descendantsR:RKRR±RRHRYtfilterRmRtstripRw( R{R}R~RRtdstatesRt immutableRòR›R,t strippoints((R{R~s0/sys/lib/python2.7/site-packages/hgext/rebase.pyR/Rs(+)  #+ cCscd|jƒkrX|jƒg|jjD]}|j^q(krXtjtdƒƒ‚nt|jd|ƒƒ}|sŽtjtdƒƒ‚n|j ƒi}tƒ}x|D]}|j |ƒ} | |krçtjtdƒƒ‚n| |krA|j ƒ|j ƒk} | rA| rA||j ƒkrA|j jdƒd Sn|j jd||fƒ|jtj|tƒƒt|jƒƒdkr®|j|jj| jƒg|jƒgƒƒq®q®Wx'|D]} | |krÈt|| s&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 %d starting from %s is%ld::%ldR2N(RrRmR¼RÇRRJRtlistRCtsorttancestorR5tchildrenR:RRRBR±tdicttfromkeysRR]RfRWtfindmissingrevsRRoRORµ(R{RRŽRRtrootsRt detachsetRt commonbaset samebranchRt rebasedomaintignored((s0/sys/lib/python2.7/site-packages/hgext/rebase.pyRTns> %     &  c Cs~tjr²g}x„t|jƒƒD]p\}}|dkr"||krOd}n)|dk rk||f}n ||f}|j|||fƒq"q"W|rztj||ƒqznÈg|D]}||tkr¹|^q¹} | rzg} xn|jd| ƒD]Z} t|j j | j ƒgƒƒt|ƒrA|j t dƒƒqú| j| jƒƒqúW| rztj||| dƒqzndS(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((R RSRbRåRBtappendt createmarkersRoRCRWRòRRKRRmRRô( R:R{RR‚R tmarkersRRštsuccsR›tstrippedR((s0/sys/lib/python2.7/site-packages/hgext/rebase.pyRuÆs*      )+c Os§|jdƒri|jdƒr5|d=|jdƒn|djƒ}tj|ƒt|ƒ}tj}d„}|t_z|||||ŽWd|t_Xt|ƒ} | |kr£d|krË|d=nt||||dj ƒ} || j ƒ} | |dj ƒkrft j || ƒtj ||g|djƒƒrc|jtdƒ|jƒqcqfq£n:|jd ƒrtjtd ƒƒ‚n|||||ŽdS( sCCall rebase after pull if the latter has been invoked with --rebaseRR±sC--update and --rebase are not compatible, ignoring the update flag R2c_sdS(N((targstkwargs((s0/sys/lib/python2.7/site-packages/hgext/rebase.pyt_dummyósNRsupdating bookmark %s R+s%--tool can only be used with --rebase(RDRRRmRRMR]Rt postincomingRRBR5RRR±RRURR`RRJ( torigR:R{R R|t movemarkfromt revsprepulltorigpostincomingR t revspostpullR5R((s0/sys/lib/python2.7/site-packages/hgext/rebase.pyt pullrebaseçs8          "cCsbtjtjdtƒ}|djddd tdƒfƒ|djdddtdƒfƒd S( s8Replace pull with a decorator to provide --rebase optiontpulliRRs'rebase working directory to branch headR*R+sspecify merge tool for rebaseN(Rt wrapcommandRttableRRRBR(R:tentry((s0/sys/lib/python2.7/site-packages/hgext/rebase.pytuisetups (1t__doc__t mercurialRRRRRRRRRR R R R tmercurial.commandsR tmercurial.nodeRtmercurial.lockRtmercurial.i18nRR¹RçRoRµtcmdtabletcommandt testedwithRHRRZRBRkRhR´ReRÃRsRvRdRwRLR/RTRuRR(((s0/sys/lib/python2.7/site-packages/hgext/rebase.pytsl4.          ÿ#   +  (   1  X ! '