\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddlZddlmZddlmZmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZddlmZej Z ej!Z!iZ"ej#e"Z#iZ$ej%e$Z%e%ddd e&e%d d d de%d d d e&e%d d d de%d dd e&dZ(iZ)e*Z+e*Z,e*Z-e*Z.dZ/de0fdYZ1de0fdYZ2dZ3dZ4e&dZ5dZ6dZ7e&e&dZ8e8ddgedde9de2fd YZ:e8d!d"ged#de9d!e2fd$YZ;e8d%d&ged'd%e2fd(YZ<e8d)d*ged+d)e2fd,YZ=e8d-ged.d/e9d-e<fd0YZ>e8d1d2ged3d4e<fd5YZ?e8d6d7ged8d6e2fd9YZ@e8d:d;ged<de9d=e2fd>YZAde&dd?ZBe#d d@dAd@edBedCfdDdEe&edFfd@dGe&edHfdIdJe&edKfd@dLe&edMfdNdOe&edPfd&dQe&edRfd2dSgedTedUfgejCedVdWe#jDdXZEdEZFdLZGdGZHdYZIdZZJd[ZKd\ZLd]ZMd^ZNd_ZOe&d`ZPdaZQdbZRdcZSddZTdeZUd@dfZVdgZWdhZXdiZYdjZZdkZ[dlZ\e&dmZ]dnZ^ej_edoe^dpZ`dqZadS(rsinteractive history editing With this extension installed, Mercurial gains one new command: histedit. Usage is as follows, assuming the following history:: @ 3[tip] 7c2fd3b9020c 2009-04-27 18:04 -0500 durin42 | Add delta | o 2 030b686bedc4 2009-04-27 18:04 -0500 durin42 | Add gamma | o 1 c561b4e977df 2009-04-27 18:04 -0500 durin42 | Add beta | o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42 Add alpha If you were to run ``hg histedit c561b4e977df``, you would see the following file open in your editor:: pick c561b4e977df Add beta pick 030b686bedc4 Add gamma pick 7c2fd3b9020c Add delta # Edit history between c561b4e977df and 7c2fd3b9020c # # Commits are listed from least to most recent # # Commands: # p, pick = use commit # e, edit = use commit, but stop for amending # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # d, drop = remove commit from history # m, mess = edit commit message without changing commit content # b, base = checkout changeset and apply further changesets from there # In this file, lines beginning with ``#`` are ignored. You must specify a rule for each revision in your history. For example, if you had meant to add gamma before beta, and then wanted to add delta in the same revision as beta, you would reorganize the file to look like this:: pick 030b686bedc4 Add gamma pick c561b4e977df Add beta fold 7c2fd3b9020c Add delta # Edit history between c561b4e977df and 7c2fd3b9020c # # Commits are listed from least to most recent # # Commands: # p, pick = use commit # e, edit = use commit, but stop for amending # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # d, drop = remove commit from history # m, mess = edit commit message without changing commit content # b, base = checkout changeset and apply further changesets from there # At which point you close the editor and ``histedit`` starts working. When you specify a ``fold`` operation, ``histedit`` will open an editor when it folds those revisions together, offering you a chance to clean up the commit message:: Add beta *** Add delta Edit the commit message to your liking, then close the editor. The date used for the commit will be the later of the two commits' dates. For this example, let's assume that the commit message was changed to ``Add beta and delta.`` After histedit has run and had a chance to remove any old or temporary revisions it needed, the history looks like this:: @ 2[tip] 989b4d060121 2009-04-27 18:04 -0500 durin42 | Add beta and delta. | o 1 081603921c3f 2009-04-27 18:04 -0500 durin42 | Add gamma | o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42 Add alpha Note that ``histedit`` does *not* remove any revisions (even its own temporary ones) until after it has completed all the editing operations, so it will probably perform several strip operations when it's done. For the above example, it had to run strip twice. Strip can be slow depending on a variety of factors, so you might need to be a little patient. You can choose to keep the original revisions by passing the ``--keep`` flag. The ``edit`` operation will drop you back to a command prompt, allowing you to edit files freely, or even use ``hg record`` to commit some changes as a separate commit. When you're done, any remaining uncommitted changes will be committed as well. When done, run ``hg histedit --continue`` to finish this step. If there are uncommitted changes, you'll be prompted for a new commit message, but the default commit message will be the original message for the ``edit`` ed revision, and the date of the original commit will be preserved. The ``message`` operation will give you a chance to revise a commit message without changing the contents. It's a shortcut for doing ``edit`` immediately followed by `hg histedit --continue``. If ``histedit`` encounters a conflict when moving a revision (while handling ``pick`` or ``fold``), it'll stop in a similar manner to ``edit`` with the difference that it won't prompt you for a commit message when done. If you decide at this point that you don't like how much work it will be to rearrange history, or that you made a mistake, you can use ``hg histedit --abort`` to abandon the new changes you have made and return to the state before you attempted to edit your history. If we clone the histedit-ed example repository above and add four more changes, such that we have the following history:: @ 6[tip] 038383181893 2009-04-27 18:04 -0500 stefan | Add theta | o 5 140988835471 2009-04-27 18:04 -0500 stefan | Add eta | o 4 122930637314 2009-04-27 18:04 -0500 stefan | Add zeta | o 3 836302820282 2009-04-27 18:04 -0500 stefan | Add epsilon | o 2 989b4d060121 2009-04-27 18:04 -0500 durin42 | Add beta and delta. | o 1 081603921c3f 2009-04-27 18:04 -0500 durin42 | Add gamma | o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42 Add alpha If you run ``hg histedit --outgoing`` on the clone then it is the same as running ``hg histedit 836302820282``. If you need plan to push to a repository that Mercurial does not detect to be related to the source repo, you can add a ``--force`` option. Config ------ Histedit rule lines are truncated to 80 characters by default. You can customize this behavior by setting a different length in your configuration file:: [histedit] linelen = 120 # truncate rule lines at 120 characters ``hg histedit`` attempts to automatically choose an appropriate base revision to use. To change which base revision is used, define a revset in your configuration file:: [histedit] defaultrev = only(.) & draft() By default each edited revision needs to be present in histedit commands. To remove revision you need to use ``drop`` operation. You can configure the drop to be implicit for missing commits by adding:: [histedit] dropmissing = True By default, histedit will close the transaction after each action. For performance purposes, you can configure histedit to use a single transaction across the entire histedit. WARNING: This setting introduces a significant risk of losing the work you've done in a histedit if the histedit aborts unexpectedly:: [histedit] singletransaction = True i(tabsolute_importN(t_(tbundle2tcmdutiltcontexttcopiestdestutilt discoveryterrortexchanget extensionsthgtlocktmerget mergeutiltnodetobsoletetpycompatt registrartrepairtscmutiltstatetutil(t stringutilt experimentalshistedit.autoverbtdefaultthisteditt defaultrevt dropmissingtlineleniPtsingletransactionsships-with-hg-corec @std}gfd}x2ttttttD]}||qBWjdg}|jddr|jdn|||fjd|}djg|D]}|rd|nd ^qS( s construct the editor comment The comment includes:: - an intro - sorted primary commands - sorted short commands - sorted long commands - additional hints Commands are only included once. sEdit history between %s and %s Commits are listed from least to most recent You can reorder changesets by reordering the lines Commands: c@st|}|jjd}t|jrOdjt|jdd}njd||dfjg|dD] }d^q{dS( Ns s, tkeycS@s t|S(N(tlen(tv((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytss %s = %siis %s( t actiontabletmessagetsplitR tverbstjointsortedtappendtextend(R!tatlinestl(tactions(s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytaddverbs  $tRRsKDeleting a changeset from the list will DISCARD it from the edited history!s s# %s s# ( RR(tprimaryactionstsecondaryactionsttertiaryactionsR)t configboolR%R'( tuitfirsttlasttintroR/R!thintsR,R-((R.s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytgeteditcomments   !t histeditstatecB@sheZddddddddZdZdZddZdZdZdZ dZ RS( c C@s||_||_||_||_||_||_||_d|_t j |d|_ |dkrug|_ n ||_ dS(Nshistedit-state( trepoR.tkeepttopmostt parentctxnodeR twlocktNonet backupfiletstatemodtcmdstatetstateobjt replacements( tselfR<R?R.R=R>RFR R@((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt__init__)s          cC@s|jjs+tj|jtdn|j}|d|_t|d|}||_ |d|_ |d|_ |d|_ |d|_ dS( s;Load histedit state from disk and set fields appropriately.RR?trulesR=R>RFRBN(REtexistsRtwrongtooltocontinueR<Rt_readR?t parserulesR.R=R>RFRB(RGtdataR.((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytread9s      c C@s|jjjd}|jdrK|j}|\}}}}}}n*tj|}|\}}}}}d}djg|D]\} } d| | f^q}i|d6|d6|d6|d6|d 6|d 6S( Nshistedit-statesv1 s s%s %sR?RIR=R>RFRB( R<tvfsROt startswitht_loadtpickletloadsRAR'( RGtfpRNR?RIR=R>RFRBtverbtrest((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRLHs 2cC@sT|r%|jdd|jddn+|jjdd}|j|WdQXdS(Nshistedit-statetlocationtplaintw(shistedit-state(taddfilegeneratort_writeR<RP(RGttrtf((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytwriteWs  cC@sB|jd|jdtj|j|jdtj|j|jd|jr_dnd|jdt|jx(|jD]}|jd|jqW|jdt|j xL|j D]A}|jdtj|ddj d |d DfqW|j }|s-d}n|jd|dS( Nsv1 s%s tTruetFalses%d s%s%s iR0cs@s|]}tj|VqdS(N(Rthex(t.0tr((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pys isi( R_RRbR?R>R=R R.ttostateRFR'RB(RGRUtactiont replacementRB((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyR\_s  %  cC@s|jjdd}g|jD]}|d ^q"}d}|||d7}tj||}|d7}tj||}|d7}||dk}|d7}g}t||} |d7}xRtj| D]A} ||} |d7}||} |d7}|j| | fqWg} t||}|d7}xtj|D]} ||}tj|d }gt dt |dD] } tj|| | d!^q}| j||f|d7}qIW||}|d7}|j ||||| |fS(Nshistedit-stateRdiiiR`i(( R<RPt readlinesRtbintintRtxrangeR)trangeR tclose(RGRUR-R,tindexR?R>R=RItrulelentit ruleactiontruleRFtreplacementlenRgtoriginaltsuccRB((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRRpsD#           <   cC@s&|jr"|jjjdndS(Nshistedit-state(t inprogressR<RPtunlink(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytclears cC@s|jjjdS(Nshistedit-state(R<RPRJ(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRvsN( t__name__t __module__RARHRORLR_R\RRRxRv(((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyR;(s      / thisteditactioncB@sqeZdZedZdZdZdZdZdZ dZ dZ d Z d Z RS( cC@s"||_|j|_||_dS(N(RR<R(RGRR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRHs  cC@s|jjddd}ytj|}Wnutk ry4tj|j|}|j}tj|}Wqt j k rt j t d|qXnX|||S(sLParses the given rule, returning an instance of the histeditaction. t iisinvalid changeset %s( tstripR%RRit TypeErrorRt revsingleR<RbRtRepoLookupErrort ParseErrorR(tclsRRrtruleidtrevt_ctxtrulehash((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytfromrules  !cC@sv|j}tj|j}tj|||_|jdkr_tjtd|d n|j |||dS(s* Verifies semantic correctness of the rulesunknown changeset %s listedi N( R<RRbRtresolvehexnodeidprefixRARRRt_verifynodeconstraints(RGtprevtexpectedtseenR<tha((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytverifys   cC@s|j|krLtjtd|jtj|jfdtdn|j|krtjtdtj|jndS(Ns%%s "%s" changeset was not a candidatethintsonly use listed changesetss#duplicated command for changeset %s(RRRRRVtshort(RGRRR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRscC@sr|j|j}t|}d|j||j|f}|jjjdd}t|d}tj ||S(s{build a histedit rule line for an action by default lines are in the form: s %s %s %d %sRRi( R<Rt _getsummaryRVRR5t configinttmaxRtellipsis(RGtctxtsummarytlinetmaxlen((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyttorules  cC@sd|jtj|jfS(sPrint an action in format used by histedit state files (the first line is a verb, the remainder is the second) s%s %s(RVRRb(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRescC@s|j|j|jS(snRuns the action. The default behavior is simply apply the action's rulectx onto the current parentctx.(t applychanget continuedirtyt continueclean(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytruns  cC@s|j}||j}|jjdtdttj||jjdtt |j||i}|j j |j |j r|jj}|jj|tjtd|jtj|jfdtdn |jjdS(slApplies the changes from this action's rulectx onto the current parentctx, but does not commit them.Rtlabeledt quietemptysFix up the change (%s %s)Rs hg histedit --continue to resumeN(R<RR5t pushbufferR`R tupdateRR?t applychangestdirstatet setbranchtbranchtunresolvedcountt popbufferR_RtInterventionRequiredRRVR(RGR<trulectxtstatstbuf((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRs    c C@sr|j}||j}|j}t||}|d|jd|jd|jd|jd|dS(sContinues the action when changes have been applied to the working copy. The default behavior is to commit the dirty changes.ttexttusertdatetextrateditorN(R<Rt commiteditort commitfuncfort descriptionRRR(RGR<RRtcommit((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRs    cC@stS(s1The editor to be used to edit the commit message.(Ra(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRscC@s|jd}|j|jjkrg|jjjtdtj|j||jtfgfS|j|jkr|gfS||j|jffgfS(sContinues the action when the working copy is clean. The default behavior is to accept the current commit as the new version of the rulectx.t.s$%s: skipping changeset (no changes) ( R<RRR?R5twarnRRttuple(RGR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRs  (RyRzRHt classmethodRRRRReRRRRR(((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyR{s      c@s%jfd}|S(s=Build a commit function for the replacement of This function ensure we apply the same treatment to all changesets. - Add a 'histedit_source' entry in extra. Note that fold has its own separated logic because its handling is a bit different and not easily factored out of the fold method. c@slid6}jj|dD|jdij}j|d<||d<j|SWdQXdS(Ntphasess new-commitRRthistedit_source(Rs new-commit(R5tconfigoverridetgettcopyRbR(tkwargst overridesR(tphaseminR<tsrc(s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt commitfunc+s   (tphase(R<RR((RR<Rs4/usr/lib64/python2.7/site-packages/hgext/histedit.pyR s cC@s|jjd}|jj|krktj||||tjfdttj dddd}njzM|j j dd|j dddtj |||jddg}Wd |j j ddddX|S( s@Merge changeset from ctx (only) in the current working directoryitallR5t forcemergettoolR0RtlocalN(Rtparentstp1RRtreverttnullidR`tmergemodt updateresultR5t setconfigRtgraft(R5R<RtoptstwcparR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyR4s%(c@st|jd|jj}|s1dSxE|D]=}|js8tjtdtj |jq8q8W|j d}t}x!|D]} |j | j qWt j|g|D]!} tj| |s| ^q}jfd} |jdr3|d} n |j} |jd} |jd}|jd}|jj|jjf}d}|stjd td d }ntj|d |d | d|d| d| d|d|d|}|j|S(scollapse the set of revisions from first to last as new one. Expected commit options are: - message - date - username Commit message is edited in all cases. This function works in memory.s%d::%ds!cannot fold into public change %sic @su|krq|}|j}tj|||j|jdd|kdd|kdj|}|SdS(NtislinkR-tisexectxtcopied(tflagsRt memfilectxtpathRNRRA(R<RRtfctxRtmctx(Rtheadmftlastctx(s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt filectxfnfs      R$RRRteditteditforms histedit.foldRRtfilesRRN(tlisttsetRRAtmutableRRRRRRRRRt pathcopiesRtsamefiletmanifestRRRtp2tgetcommiteditorR`Rtmemctxt commitctx(R<tfirstctxRt commitoptst skipprompttctxstctbaseRRR^RR$RRRRRtnew((RRRs4/usr/lib64/python2.7/site-packages/hgext/histedit.pytcollapseFsF '  )  .    $  cC@s|djdtS(Ntmissing(RAtdirtyR`(R<((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt _isdirtywcscC@s%tjtddtddS(Ns working copy has pending changesRsYamend, commit, or revert them and run histedit --continue, or abort with histedit --abort(RtAbortR(((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt abortdirtysc@sfd}|S(Nc@sd}r tj|nEr6tj|n/tdkrXtj|n tj|||_|_|_xD]}|t |ss (%d::. - %d)sI%s: cannot fold - working copy is not a descendant of previous commit %s ( R<RRR?R5RRRRRRtdiscardt finishfold(RGR<RRR?t parentctxt newcommitst middlecommits((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRs(      # cC@stS(sReturns true if the rule should skip the message editor. For example, 'fold' wants to show an editor, but 'rollup' doesn't want to. (Ra(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRscC@stS(sReturns true if the rule should merge messages of multiple changes. This exists mainly so that 'rollup' rules can be a subclass of 'fold'. (R`(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt mergedescsscC@stS(sReturns true if the rule should preserve the date of the first change. This exists mainly so that 'rollup' rules can be a subclass of 'fold'. (Ra(RG((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt firstdatesc C@s+|jdj}tj||dti}|j|d<|js]|j} nJdj|jgg|D]} || j^qv|jgd} | |d<|j r|j |dt_edithisteditplanR=t_aborthisteditt _newhisteditt_continuehisteditt_finishhistedittend( R5R<RR:RtfmRLR'RPRI((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyR8Ss,      c C@s|j}xktt||dd gD]I\}\}}|jdkr+|r+|jdkr+t|j|_q+q+W|jd }|jddr|j d}n|j t ddt ddt |j}|t j|x|jr|jd ||jd } |jd | j|jd | j| jf| j\} } | j|_|jj| |jjd qWWd QXWd QX|jd S(sThis function runs after either: - bootstrapcontinue (if the goal is 'continue') - _newhistedit (if the goal is 'new') iRRRteditingtunittchangesttotalR]ititemshistedit: processing %s %s N(R.t enumeratetzipRARVRt __class__R_R4t transactiont makeprogressRR Rtacceptinterventiont incrementRRRRR?RFR*tpop( R5R<RR.tidxRftnextactR]tprogresstactobjRt replacement_((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRXrs0 -$    c@sMtj||jdtt|\}}}}|rx|jD]\}} | ss|jdtj|qD|jdtj|tj| dft | dkrDd} x/| dD] } |j| tj| qWqDqDWn|j s|rt ||j |qni}x'|D]} | |kr&d|| s(R(RcR3R!(Rn(s4/usr/lib64/python2.7/site-packages/hgext/histedit.pys s Rc@sJi|]@\}}g|D]}|^qdd|qS(tnameR((RctoldntnewnR(tflthf(s4/usr/lib64/python2.7/site-packages/hgext/histedit.pys s Rtoldnodetvaluetnewnodest nodechangestundoshistedit-last-edit.txtN((R R R?Ratprocessreplacementt iteritemsRRRR R=tmovetopmostbookmarksR>t unfilteredt changelogRntitemsRt cleanupnodesthexfunct formatlistt formatdictRNRxtosRRJtsjoinRwRP(R5R<RR[tmappingttmpnodestcreatedtntmtprectsuccsRRtfdRw((RrRsRns4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRYsD $(       c C@szyR|jt|\}}}}|jdtj|j|j|kr|jr|jj|j}t j ||}t j |||} |j d*} tj|| | dddd|WdQXtj|n|jjd|j||Br(t j||jdtd tnt|||d |t|||d |Wn6tk r|jr|jtd nnXWd|jXdS( Nsrestore wc to old parent %s shistedit.aborttsourceRturlsbundle:sparents() and (%n or %ln::)t show_statsRRPsrwarning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up (RORyRRRR>RBRPR'R topenpathR t readbundleRdRt applybundleRtremoveR|R'R?tcleanR`t cleanupnodet ExceptionRvRRRx( R5R<RRPt__tleafsRRBR^tgenR]((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRVs0  "   cC@s|j|sUt|tj|jtj|j}t|||j|}nt||}t ||}g|jD]}|jr}||j^q}}t |||||||_|j dS(N( ROR:RRR?R>t ruleeditorR.RFRMtwarnverifyactionsR_(R5R<RRItcommentR.tactR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRUs ) cC@s|jd}|jdd}|jd}tj|tj||jj\} } |r|rx|d} nd} t||| ||} n^t|j dt j ||} t | dkrt jtdn| dj} t|| | |j}|s:t jtd tj| ng|D]}||^qA}|st|tj| tj| }g|D]}t||^q}t||||}nt||}t||}t||||||| jdj}||_||_| |_g|_|jd d t |d t |d}tj |tj!st"j#||g| g| d }n||_$dS( NR-R0R0Ris roots(%ld)is9The specified revisions must have exactly one common roots*%s is not an ancestor of working directoryRs%d actions to histeditthistedit_num_actions(%RRtcheckunfinishedt bailifchangedRRRAR/RRRtrevrangeR RRRRtbetweenR=RR:RRRFRMRR?R.R>RFtlogRt isenabledtcreatemarkersoptRt backupbundleRB(R5R<RR'R:RRMRIRR>temptyR(troottrrRdRRR.R?RB((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRWsN   $$"     cC@s/|jpd}|r+|jd}n|S(NR0i(Rt splitlines(RR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyR2scC@s|j}tjj|}tj||jr|jjd}t|rr|j t|rrt qrn|j \}}|j |_ |jj|n|S(Ni(R<Rt mergestateRORtcheckunresolvedR.RhRRRRRR?RFR*(R5RRR<tmsRlRRF((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRT:s       cC@s|jd||}|r| rtj|tj re|jd||retjtdn|jd|rtjtdn||j}|jstjtd|dtdqnt j |j j |S( soselect and validate the set of revision to edit When keep is false, the specified set can't have children.s%n::%ns(%ld::) - (%ld)s?can only histedit a changeset together with all its descendantss(%ld) and merge()s(cannot edit history that contains mergess cannot edit public changeset: %sRs see 'hg help phases' for details( R'RRtallowunstableoptRRRR6RRtmaplistR}R(R<toldRR=R'R((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyROs  cC@s|jjddrxtj}x|D]}||j}t|}|jdddj}t} |j dr$|d }|t t Bt Bkr$||_ |t|dj} xett|jD]H\} } || j} t| }|| krt} | j|PqqWq$n| s(g||st#R|smalformed line "%s"isunknown action "%s"( RRQRRRR%R#RR)(RIRR-R.RdRVRWRf((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRMs"   cC@sZyt|||Wn?tjk rU|jjdrO|jtdnnXdS(Nshistedit-last-edit.txts=warning: histedit rules saved to: .hg/histedit-last-edit.txt (t verifyactionsRRRPRJRR(R5R<R.RR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRs c C@std|D}t}d }|ra|djdkratjtd|djnxI|D]A}|j||||}|jd k rh|j|jqhqhWt ||}|j j j ddr:t |dkr tjtdd td ng|D]}t||^q} | |d*nL|rtjtd tj|dd td tj|dnd S(sVerify that there exists exactly one action per given changeset and other constraints. Will abort if there are to many or too few rules, a malformed rule, or a rule on a changeset outside of the user-given range. cs@s|]}|jVqdS(N(R(RcR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pys siRRs$first changeset cannot use verb "%s"RRsno rules providedRs%use strip extension to remove commitssmissing rules for changeset %ss@use "drop %s" to discard, see also: 'hg help -e histedit.config'N(RR(RRARVRRRRRRR(R<R5R4R RR( R.RRRRRRfRRtdrops((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRs.  "  cC@sStj|tjs|S|j}|jj}|j}t|}g|D]}|d^qM}tj |}t|} x| rN| j } |j | dk} |j j | d} | r| r|j| dfnxe| D]]} | d}|j| |fx7|D]/}||kr|j|| j|qqWqWqW|S(s Adjust replacements from obsolescence markers Replacements structure is originally generated based on histedit's state and does not account for changes that are not recorded there. This function fixes that by adding data read from obsolescence markersiN(((RRRR|R}RntobsstoreRRtunionRhRRAt successorsR)R(R<toldreplacementstunfitnmRtnewreplacementsRdtoldsuccst seensuccst succstocheckRRtmarkerstmarkertnsuccstnsucc((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytadjustreplacementsfrommarkerss.             cC@st|j|j}t}t}i}xT|D]L}|j|d|j|d|j|dtj|dq4W||}||@}t|}i} x|rBxt|D]{} || } xht| D]C} | |krPq| | kr| j| | j| | qqW| | | <|j| qWqWx|D] } | | =qJW|jj j }x3| j D]%\}} t | d|j | |Sss roots(%ln)tbackupN( R R|R}RnR(RRRR}(R5R<tnodesRPRR.R((Rs4/usr/lib64/python2.7/site-packages/hgext/histedit.pyRGs   +c O@st|tr|g}nt|}|jr|jd|jD}|t|@}|rtjt ddj d|Dqn||||||S(NcS@s"h|]}|jr|jqS((R(RcRf((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pys _s s$histedit in progress, can't strip %ss, cs@s|]}tj|VqdS(N(RR(RcR((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pys ds( t isinstancetstrR;RvROR.RRRRR'( torigR5R<tnodelisttargsRRthistedit_nodest common_nodes((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt stripwrapperYs     #R}cC@slt|}|jsdS|j|jrh|jtd|jtddt|jndS(Ns!hist: %s (histedit --continue) s %d remainingshistedit.remaining(R;RvROR.R_RtlabelR (R5R<R((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyt summaryhookis    cC@s^tjjdttjjdtttdtdgtj jdtdgdS(NRshistedit-stateshistedit in progresss5use 'hg histedit --continue' or 'hg histedit --abort'shg histedit --continue( Rt summaryhooksRRtunfinishedstatesR)RaR`Rtafterresolvedstates(R5((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pytextsetupts   (bt__doc__t __future__RRtmercurial.i18nRt mercurialRRRRRRRR R R R R RRRRRRRRRRCRtmercurial.utilsRRSR9tcmdtabletcommandt configtablet configitemRaRAt testedwithR#RR1R2R3RR:tobjectR;R{RRRRRRfR`RRRRRRRR$R/t formatteroptstCATEGORY_CHANGE_MANAGEMENTRR<R=R>R?R@RFROR8RXRYRVRURWRRTRRRMRRRRyR{RRt wrapfunctionRR(((s4/usr/lib64/python2.7/site-packages/hgext/histedit.pyts             -y   C         v              ! l  -  * / !  6    5  & # =