\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddlZddlZddlmZddlmZm Z ddl m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z#m$Z$dZ%dZ&d d d d hZ'iZ(ej)e(Z)d Z*dZ+dZ,dZ-e.dZ/ej0Z0e0ddZ1e0ddZ2dZ3de4fdYZ5e)ddddededfdd ded!edfd"d#ged$edfd%d&ded'edfdd(e6ed)fd*d+ded,ed-fd.d/e6ed0fd1d2ded3ed4fd5d6e6ed7fdd8e6ed9fd:d;e6ed<fd=d>e6ed<fd?d@dedAfddBe6edCfdDdEe6edFfdGdHe6edIfddJdedKfge j7e j8e j9edLdMe)j:dNZ;dOZ<e6dPZ=e6e6dQZ>e.e.e.e.e.dRZ?dSZ@dTZAdUZBdVZCdWZDdXZEdYZFdZZGd[ZHd\ZId]ZJd^ZKd_ZLd`ZMdaZNe.eOe6dbZPdcZQddZRe.e6e.eOdeZSdfZTdgZUdhZVdiZWdjZXdS(kscommand 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 revsetlangtscmutiltsmartsettstatetutilis-1s-2s-3s-4s-5sships-with-hg-corecC@sdS(Ni((((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_nothingtorebaseIscC@sf|jjdd}|dk r1||d5sRz(tTrueRWR-R RRvt enumeratetreadt splitlinesRCtboolR}R:REt legacystatest revtodostrtrevtodoR R;RR^tvaluestsortedtitemstaddRSR~RJ(RnR-Rt legacydestRR]RxtitltargsRRtdestrevR_tseentoldtnew((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRsh  %      +            'cC@si|_|jjdds"dSt|}t|j||\|_|_}t|j}|j|j|j|t|j|j||dS(sCompute 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]t obsoletesettobsoleteextinctsuccessorst skippedset((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_handleskippingobsolete9s  ! c C@sy#|jt|j||_Wn~tjk r|rst|jt|j|jjj t ddSt 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(RtrestorecollapsemsgR-RbR tRepoLookupErrort clearstatustclearcollapsemsgRStwarnRR;RetabortRZR]RR\(RntisabortRRtmsgR((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_prepareabortorcontinueLs"     c C@s5|s tS|j}tj|jtj}|jp=| r}|jjd||r}tj t ddt dnt |j||j }|s|j jt dtSx\|jjd|D]E}|j r|j rtj t d|dt dqqW|\|_|_|_|j rt|jj}t|d krwtj t d ntt|}|jjj|gd t}t|j|j||_nx`tt|jD]F}|j|} | jr|j r|j jt d | qqWt|_ dS( Nsfirst(children(%ld) - %ld)s;can't remove original changesets with unrebased descendantsRs&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]RRR:tnexttitert changelogt ancestorsRtexternalparentR[Rt closesbranchRgRW( RnR]t rebasesett allowunstabletresulttrootR?Rt destancestorstdest((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_preparenewrebasebsD       !cC@s|jrAddlm}||j|_|jjjdn#|jd|_|jjjd|jjjddd|jdS(Ni(toverlayworkingctxsrebasing in-memory srebasing on disk R'Rztrebase_imm_used( Rjtmercurial.contextRR-twctxRSR~R tlog(RnR((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_assignworkingcopys c@sF|j|j|j}}|jr|jjdt|jrt}xU|j D]G}|j ||j t |dkrUt jtdqUqUWqnt|j|j }|j||j|jp|j|_|jrtj|n|j|r|j|ng|j jD]\}}|tkr,|^q,} |jjtddtddt | fd} |jjd d } x~t|jD]m} |jjd | } | s| |jjd |j|j8} nx$| D]}|j||| | qWqWj |j!td dS(Niis'cannot collapse multiple named branchestrebasingtunitt changesetsttotalc@s$jdd|j|fdS(Ntitems%d:%s(t incrementRC(R!(tp(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytprogresssRsevolution.allowdivergencessort(%ld, -topo)sdescendants(%ld) and not %ldsrebase merging completed ("RR-RSRgRctinsertR%R`R^RRR$R:R R;Rt_filterobsoleterevsRR]R\t_activebookmarkRt deactivateRyRGRt makeprogressRdt sortsourceR7Rit _rebasenodetcompletetnote(RnRwR-RSRARCtobsrevstkRtcandsRtallowdivergenceR2t sortedrevs((Rs2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_performrebasesF    "  4!     cC@s|j}||}|d kr.|j}n|j}|d krR|j}ni|jd6} x|jD]} | || qoW|jo||j|jk} t|j t j } i| d6} | rt | d|SnSt|||||| | d| }|j|}|dk r.|St||j d}|jdd}|rn|jd}ntj|cd}|r| rtj|d}ntj|%|j||s|jnWdQXWdQXWdQXWdQXdS(NRRRRCt _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 revisionsRRstool option will be ignored R=RR*R'RC(RJRKRR R tfindtKeyErrorRR R;RbR`R,RRRRRtcheckunresolvedRt_definedestmapRtstorecollapsemsgRdt transactionRtacceptinterventionR RR,(RSR-R&RYRRRjRStdestftsrcftbaseftrevfR*tenablehisteditthelpRtmstretcodeR]Rwtsingletrtdsguard((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRTsj            c@s|d*krg}n|r9|r9tjtdn|r]|r]tjtdn|r|rtjtdn|stjtjn|jddr| rtjtddtdnd*}|rtj |} | s|j td d*Sn|rltj |g} | sW|j td d*Sj d | } n?tj |p~d g} | s|j td d*S|rtj |}n%t | d|}t|}g} i} xL| D]D}j d||jj}| j|g|g| |/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(Rk(RR(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys 7sR'Rztrebase_rebasing_wcps%ldtALLSRCt localaliass%dtSRCRiis skipping %s - empty destination s'rebase destination for %s is not uniquec@si|]}|qS(((RR(R(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys `s s&nothing to rebase - empty destination N(R R R;RRtcheckunfinishedt bailifchangedRdRtrevrangeRR7t revsingleR.RkRCR8RtclearRGRGRJRRRHRtanyrevsRR:R(RSR-RjR`RaRbRcR*RRR>RtrootstbpbaseR2tbptbst rebasingwcptallsrctaliasR]Rtdestsettsize((RR-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR\s        !!  #  '          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 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((RR((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys }sN(R^RRRCRRR:tpopR R;RRRJR(R-RRRRRCR((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRhs       c C@s|jr&|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.RSRR$RRQRRRN(tisemptyRSRdR R$ttomemctxt commitctxR( R-RRRRRRRQRR$tmemctxt commitres((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRs"   c C@stj}|jjdds6tj|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'RCttextRRQRRN( RtnullcontextmanagerRSRdR R RItcommittdirstatet setbranchR$( R-RRRRRRQRRiR((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRs $c C@s|jr |j||n|dj|krs|jjd|||ftj||dtdtn|jjd|d}|j j |j |jjd|||f|dk r|jjd|||fntj||dtdtd|d |d d d gd |}|rIt j||||n2||jj}t j||||d||S(sFRebase a single revision rev on top of p1 using base as merge ancestorRs update to %d:%s t branchmergetforces already in destination s merge against %d:%s s detach base %d:%s tancestort mergeancestortlabelsRRtwctskiprevN(t isinmemoryR RCRSR~RRR,RR RR{RFRtduplicatecopiesR( R-RCRRRPRRRtp1rev((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRs&   ! c C@s||}g|jD]:\}}|dkr|||kr||kr|^q}g} x|jj|D]} |} | tkr|jd|| j} | dk r|| } qn| |kr||kr||} | tkrtj d|qn| j | qpW| S(sadjust 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( RRt parentrevsRR7R8R RR tProgrammingErrortappend( R-RCR]RR_RR"RRRtprevtadjustedt candidate((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRs"5 4    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 `rebaseobsskipped`: set of revisions from source skipped because they have successors in destination or no non-obsolete successor. Rsevolution.allowdivergencec3@s|]}t|VqdS(N(Rk(RR(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys ss+this rebase will cause divergences from: %ssJto force the rebase please set experimental.evolution.allowdivergence=Truet,RN(RdRR R;RJ( R-RSt rebaseobsrevstrebaseobsskippedt divergenceoktdivergencebasecandidatest divhashesRth((R-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRs        cc@sU|jj}xBtj|j||jgD]}||kr/||Vq/q/WdS(s,yield revision numbers for successors of revN(RtnodemapRt allsuccessorstobsstoreRI(R<RCRR"((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt successorrevs%s ) c@sj}|j|}jj}ttg} t|||t|} td|dDrd| dGsiic3@s"|]}|VqdS(N((RR3(R?Rt isancestor(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys css>cannot rebase %d:%s without moving at least one of its parentsc3@s*|] }|tko!|VqdS(N(R(RR(RRC(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys ss!source is ancestor of destinationcs@s!|]}|tkrdVqdS(iN(R(RR2((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys ss((%ld-%d) %% (%d+%d))s%ld - (::%ld) - %ldcs@s3|])\}}|dk rt||fVqdS(N(R R:(RRR7((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys ss or c3@s:|]0}|dk rdjfd|DVqdS(s, c3@s#|]}d||fVqdS(s%d:%sN((RR(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys sN(R RJ(RR7(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys ss4rebasing %d:%s will include unwanted changes from %ss future parents are %d and %d N(Rt isancestorrevRRRRGtallRtanyRtreverseR^R R;RR tsumR7RRRJRSR~RE(R-RCR]RR_t obsskippedtclRtoldpstnewpstbasesRtnptjR3RtunwantedtsiderevsRRRtmergesRt unwanteddesc((R?RRR-RCs2/usr/lib64/python2.7/site-packages/hgext/rebase.pyR-s     +      $$  $    $ %         cC@sUtjj|jj|}x3tjt|dD]}|jdr4tSq4Wt S(s/Return true if the given patch is in git formattrbs diff --git( tostpathRJtmqRt linereadertopent startswithRR,(R-t patchnametmqpatchtline((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt isagitpatchs c K@si}|j}|j}t}x|jD]t}||jj} | |kr|jjd| |jf|jt ||jf|| ZsRs see 'hg help phases' for detailssDwarning: new changesets detected on destination branch, can't strip s roots(%ld)RRRRNsrebase aborted (RRRRSRRRJR,R^Rt descendantsRIRRRRCRLRRRR#RR$RR(R-RZR]RR\RRRR"R'Rt immutabletcleanupRt shouldupdateRt strippointstupdateifonnodes((R-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRIsF4)     .  "  cc@st|}x|rt|}g}x.|D]&}|||kr.|j|q.q.W|svtjtdn|t|8}|VqWdS(syield 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^RRR R;R(R]tsrcsettsrclistRR((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRs    c@s|j}dj}djkrtfdjjD}t|j|@rtjt dqnt t |}|stjt dnt jd|d}|stjt dnd}t |d |}t j|tt|d k} x|D]} || j} | j| } | | kr~tjt d n| | kr'd} | | jkr| j| jk}n| j| jk}| r'|r'| | jkr'| j| j<jjd q1q'nt} jjd | | fq1W| rUdSxtt D]f}gjj|D]}|tkr{|^q{}|rbtfd|Drb||ss&cannot rebase onto an applied mq patchsno matching revisionss roots(%ld)icS@s |jS(N(RC(R((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytrevofsRPis!source is ancestor of destinations!source is a child of destination s rebase onto %s starting from %s c3@s$|]}j||kVqdS(N(R(RR(R(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys sN(RRCRR^RRRR R;RRGRRtdicttfromkeysRR:RR RR$RRSR~R,RRRR(R-R]RPRRZt mqappliedt sortedsrcRvRt emptyrebaseRRt commonbaseRt samebranchRCRR((R-Rs2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRsN "      1"c C@s|jj} i} i} tj|tj } g} xt|jD]\}}|dkrG||krG| |}|p| |}|| |<|sd }||kr| s||j rd }qn|r| j|n |f}|d k r || |ftjtdn|||||}|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 DESTRRsC--update and --rebase are not compatible, ignoring the update flag sCcannot pull with rebase: please commit or shelve your changes firstc_@sdS(N((Rtkwargs((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt_dummy"sNRCRtstartRWRsnothing to rebase s%nothing to rebase - updating instead Rs%--tool can only be used with --rebase(R RRdRR R;RJRKR~RRpRqR:Rt postincomingRGRR7R'tNoMergeDestAbortRt destupdateRCRR(torigRSR-RRYtretRRt revsprepulltorigpostincomingRt revspostpullR*RCt_at_b((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt pullrebase sP                &c@stfd|DS(s/returns a set of the obsolete revisions in revsc3@s%|]}|jr|VqdS(N(R(RR(R-(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys Ks(R^(R-R7((R-s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRIsc@sXi}tg}tg}|j}|jt|jd}x|D]}|j|} ttj|j| g} | j| fd| D} | j |r|j |n| sd|| 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(((RR"(R(s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys gs c3@s|]}|kVqdS(N((RR"(R](s2/usr/lib64/python2.7/site-packages/hgext/rebase.pys xsN(R^RRR7RIRRRtremovetissubsetRR RR(R-RR]RhRiRRt extinctrevstsrcrevtsrcnodet successorstsuccrevstdstrevtsuccrev((R]Rs2/usr/lib64/python2.7/site-packages/hgext/rebase.pyRMs2           (cC@s|jjdsdSy)t||i}|j|j}Wn.tjk rotd}|j|dSXt g|j D]}|dkr|^q}|jtd|j tdd||j tddt ||fdS( NRVs8rebase: (use "hg rebase --abort" to clear broken state) is#rebase: %s, %s (rebase --continue) s %d rebasedsrebase.rebaseds %d remainingsrebase.remaining( RvRRORRR RRR{R:t itervaluestlabel(RSR-RRRRRt numrebased((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pyt summaryhooks    1cC@stjtjdt}|djdddtdf|djdddtdftj j dt tj jd t t td td gtjjd td gdS( NtpulliRzR's'rebase working directory to branch headR;Rsspecify merge tool for rebaseRVsrebase in progresss1use 'hg rebase --continue' or 'hg rebase --abort'shg rebase --continue(R t wrapcommandRttableR RR RRt summaryhooksRRtunfinishedstatesR,tafterresolvedstates(RStentry((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytuisetups  (YR/t __future__RRRtmercurial.i18nRtmercurial.nodeRRt mercurialRRRRRR R R R R RRRRRRRRRRRRRRRkRRRRtcmdtabletcommandt testedwithRR#R%R R.trevsetpredicateR4R@RNtobjectROR,t dryrunoptst formatteroptst confirmoptstCATEGORY_CHANGE_MANAGEMENTR'RIRMRTR\RRRRRRRRRRR]RRRRLRRRRRR RRRR!(((s2/usr/lib64/python2.7/site-packages/hgext/rebase.pytsx           '  F     $ I    )      9  @0 <  4