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/histedit.pyc

Xc@@sdZddlmZddlZddlZddlZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZejZejZiZe
jeZdZiZ e!Z"e!Z#e!Z$e!Z%dZ&de'fd	YZ(d
e'fdYZ)dZ*d
Z+e,dZ-dZ.dZ/e,e,dZ0e0ddgedde1de)fdYZ2e0ddgedde1de)fdYZ3e0ddgedde)fdYZ4de)fd YZ5e0d!ged"d#e1d!e4fd$YZ6e0d%d&ged'd(e4fd)YZ7e0d*d+ged,d*e)fd-YZ8e0d.d/ged0de1d1e)fd2YZ9de,dd3Z;ed4d5d6d5ed7ed8fd9d:e,ed;fd5d<e,ed=fd>d?e,ed@fd5dAe,edBfdCdDe,edEfddFe,edGfd&dHgedIedJfgedKdLZ<d:Z=dAZ>d<Z?dMZ@dNZAdOZBdPZCdQZDdRZEdSZFdTZGdUZHdVZIdWZJdXZKdYZLd5dZZMd[ZNd\ZOd]ZPd^ZQd_ZRd`ZSdaZTdbZUejVedceUddZWdeZXdS(fsinteractive 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
 #  d, drop = remove commit from history
 #  m, mess = edit commit message without changing commit content
 #

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
 #  d, drop = remove commit from history
 #  m, mess = edit commit message without changing commit content
 #

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. 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. You'll be prompted for a
new commit message, but the default commit message will be the
original message for the ``edit`` ed revision.

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

i(tabsolute_importN(t_(tbundle2tcmdutiltcontexttcopiestdestutilt	discoveryterrortexchanget
extensionsthgtlocktmergetnodetobsoletetrepairtscmutiltutilsships-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((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt<lambda>ss %s = %siis  %s(	tactiontabletmessagetsplitRtverbstjointsortedtappendtextend(Rtatlinestl(tactions(s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytaddverbs
$tthistedittdropmissingsKDeleting a changeset from the list will DISCARD it from the edited history!s
s# %s
s#
(	RRtprimaryactionstsecondaryactionsttertiaryactionsRt
configboolRR(	tuitfirsttlasttintroR#RthintsR R!((R"s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytgeteditcomments	
!t
histeditstatecB@sSeZddddddddZdZdZdZdZdZRS(c		C@sm||_||_||_||_||_||_||_d|_|dkr`g|_	n	||_	dS(N(
trepoR"tkeepttopmostt
parentctxnodeRtwlocktNonet
backupfiletreplacements(	tselfR2R5R"R3R4R9RR6((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt__init__s								c
C@s;y|jjjd}WnDtk
r_}|jtjkrCntj|jtdnX|j	dr|j
}|\}}}}}}	n*tj|}|\}}}}}d}	||_djg|D]\}
}d|
|f^q}t||}||_||_||_||_|	|_dS(s;Load histedit state from disk and set fields appropriately.shistedit-stateR%sv1
s
s%s %sN(R2tvfstreadtIOErrorterrnotENOENTRtwrongtooltocontinueRt
startswitht_loadtpickletloadsR7R5Rt
parserulesR"R3R4R9R8(
R:tstateterrtdataR5trulesR3R4R9R8tverbtrestR"((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR=s(	2				cC@sU|jjdd}|jd|jdtj|j|jdtj|j|jd|j|jdt|j	x(|j	D]}|jd|j
qW|jdt|jxL|jD]A}|jdtj|ddjd	|d
DfqW|j
}|s6d}n|jd||jdS(Nshistedit-statetwsv1
s%s
s%d
s%s%s
iR$cs@s|]}tj|VqdS(N(Rthex(t.0tr((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>:si(R2R<twriteRRNR5R4R3RR"ttostateR9RR8tclose(R:tfptactiontreplacementR8((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRQ/s"
%		cC@s|jjdd}g|jD]}|d ^q"}d}|||d7}tj||}|d7}tj||}|d7}||dk}|d7}g}t||}	|d7}xOt|	D]A}
||}|d7}||}|d7}|j||fqWg}
t||}|d7}xt|D]}
||}tj|d }gtdt	|dD] }
tj||
|
d!^q}|
j||f|d7}qCW||}|d7}|j
|||||
|fS(Nshistedit-stateRPiiitTruei((R2R<t	readlinesRtbintinttxrangeRtrangeRRS(R:RTR!R tindexR5R4R3RJtrulelentit
ruleactiontruleR9treplacementlenRVtoriginaltsuccR8((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRCBsD#










<


cC@s&|jr"|jjjdndS(Nshistedit-state(t
inprogressR2R<tunlink(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytclearqscC@s|jjjdS(Nshistedit-state(R2R<texists(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyReusN(	t__name__t
__module__R7R;R=RQRCRgRe(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR1s				/	thisteditactioncB@sqeZdZedZdZdZdZdZdZ	dZ
dZd	Zd
Z
RS(cC@s"||_|j|_||_dS(N(RGR2R(R:RGR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR;zs	cC@sc|jjddd}ytj|}Wn$tk
rUtjd|nX|||S(sLParses the given rule, returning an instance of the histeditaction.
        t iisinvalid changeset %s(tstripRRRYt	TypeErrorRt
ParseError(tclsRGRatrulehashtrev((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytfromrules
cC@s|j}tj|j}y||j|_Wn1tjk
retjtd|d nX|jdk	r|j|||ndS(s* Verifies semantic correctness of the rulesunknown changeset %s listediN(	R2RRNRt	RepoErrorRoRR7t_verifynodeconstraints(R:tprevtexpectedtseenR2tha((s2/usr/lib/python2.7/dist-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(RRRoRRKtshort(R:RvRwRx((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRuscC@sx|j|j}t|}d|j||j|f}|jjjdddd}t|d}tj	||S(s{build a histedit rule line for an action

        by default lines are in the form:
        <hash> <rev> <summary>
        s%s %s %d %sR%tlinelentdefaultiPi(
R2Rt_getsummaryRKRrR+t	configinttmaxRtellipsis(R:tctxtsummarytlinetmaxlen((s2/usr/lib/python2.7/dist-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(RKRRN(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRRscC@s|j|j|jS(snRuns the action. The default behavior is simply apply the action's
        rulectx onto the current parentctx.(tapplychanget
continuedirtyt
continueclean(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytruns

cC@s|j}||j}|jjdtdttj||jjdtt	|j||i}|r|ddkr|jj
}|jj|tj
td|jtj|jfdtdn
|jj
d	S(
slApplies the changes from this action's rulectx onto the current
        parentctx, but does not commit them.Rtlabeledt
quietemptyiisFix up the change (%s %s)R{s hg histedit --continue to resumeN(R2RR+t
pushbufferRWRtupdateRGR5tapplychangest	popbufferRQRtInterventionRequiredRRKR|(R:R2trulectxtstatstbuf((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs	
	cC@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(R2Rtcommiteditort
commitfuncfortdescriptionRRR(R:R2RRtcommit((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs	
cC@stS(s1The editor to be used to edit the commit message.(tFalse(R:((s2/usr/lib/python2.7/dist-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)
(	R2RRGR5R+twarnRR|ttuple(R:R((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs

(RiRjR;tclassmethodRsRzRuRRRRRRRR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRkys									c@s%jfd}|S(s=Build a commit function for the replacement of <src>

    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@sjjdd}z\jjddd|jdij}j|d<||d<j|SWdjj|XdS(Ntphasess
new-commitR%Rthistedit_source(R+tbackupconfigt	setconfigtgettcopyRNRt
restoreconfig(tkwargstphasebackupR(tphaseminR2tsrc(s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt
commitfuncs
(tphase(R2RR((RR2Rs2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs
cC@s|jjd}|jj|krYtj||||tjfdtd	}njzM|j	j
dd|jdddtj
|||jddg}Wd	|j	j
ddddX|S(
s@Merge changeset from ctx (only) in the current working directoryitallR+t
forcemergettoolR$R%tlocalN(tdirstatetparentstp1RRtreverttnullidRWR7R+RRtmergemodtgraft(R+R2RtoptstwcparR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs%	(c@st|jd|}|s%dSxE|D]=}|js,tjtdtj|jq,q,W|j	d}t}x!|D]}	|j
|	jqWtj
|g|D]!}
tj|
|s|
^q}jfd}|jdr'|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@sr|krn|}|j}tj||j|jdd|kdd|kdj|}|SdS(NtislinkR!tisexectxtcopied(tflagsRt
memfilectxtpathRIRR7(R2RRtfctxRtmctx(RtheadmfR-(s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt	filectxfn7s
	RRRRteditteditforms
histedit.foldRRtfilesRRN(tlisttsetR7tmutableRRoRRR|RRRRt
pathcopiesRtsamefiletmanifestRRRtp2tgetcommiteditorRWRtmemctxt	commitctx(R2R,R-t
commitoptst
skipprompttctxstctbaseRRtfRRRRRRRtnew((RRR-s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytcollapsesF

)	
.
$	cC@s|djdtS(Ntmissing(R7tdirtyRW(R2((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt
_isdirtywcZscC@s%tjtddtddS(Ns working copy has pending changesR{sYamend, commit, or revert them and run histedit --continue, or abort with histedit --abort(RtAbortR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt
abortdirty]sc@sfd}|S(Nc@ssstd}r4tj|nErJtj|n/tdkrltj|n
tj|||_|_|_	xD]}|t
|<qW|S(Nii(tAssertionErrorR'taddtinternalactionsRR(R)RKRRR(RpRK(tinternalRtpriorityR(s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytwrapcs

			
((RRRRR((RRRRs2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRUbstpicktps
use commitRcB@seZdZRS(cC@sr|j|j}|jdj|jjkr_|jjjdtj|j|gfStt	|j
S(Nisnode %s unchanged
(R2RRRGR5R+tdebugR|tsuperRR(R:R((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR{s
"#
(RiRjR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRwsRtes!use commit, but stop for amendingcB@seZdZdZRS(cC@s}|j}||j}tj||jjdtt|j||it	j
tdtj|jdtddS(NRs5Editing (%s), you may commit or record as needed now.R{s hg histedit --continue to resume(
R2RRRRGR5RWRR+RRRR|(R:R2R((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs	
	cC@stjdtddS(NRRs
histedit.edit(RRRW(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs(RiRjRR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs	
tfoldRs-use commit, but combine it with the one abovecB@s>eZdZdZdZdZdZdZRS(cC@stt|j||||j}|sE||jjd}n |jdkrXdS||j}|jstj	t
dtj|jndS(s/ Verifies semantic correctness of the fold ruleiRRNs!cannot fold into public change %s(RR(RRRzR2RRRKRRRoRR|(R:RvRwRxR2R((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRzs	
c	C@sj|j}||j}t||}|ddtj|jd|jd|jd|jdS(NRsfold-temp-revision %sRRR(R2RRR|RRR(R:R2RR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs	
cC@sJ|j}|d}||j}|jj}|j|kr}|jjtdtj|j||j|ffgfS||}td|jd||D}|s|jjtdtj|jtj|f||j|jffgfS|j	}|j
|j|j|j||||j|S(NRs%s: empty changeset
cs@s|]}|jVqdS(N(R(ROR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>ss(%d::. - %d)sI%s: cannot fold - working copy is not a descendant of previous commit %s
(R2RRGR5R+RRR|RRtdiscardt
finishfold(R:R2RRR5t	parentctxt
newcommitst
middlecommits((s2/usr/lib/python2.7/dist-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.
        (R(R:((s2/usr/lib/python2.7/dist-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'.
        (RW(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt
mergedescsscC@sQ|jdj}|jjtj|||jji}|j|d<|jsq|j	}	nJdj
|j	gg|D]}
||
j	^q|j	gd}	|	|d<t|j|j|d<|j
j}d|j|jf|d<||d	<|jjd
d}z]t|j|j}
|jjd
d|
dt|||||d
|j}Wd|jj|X|dkr|gfS|jjtj|||jj|j|ff|j|ff||ffg}x$|D]}|j||ffq#W|||fS(NiRs
***
s
RRs%s,%sRRRs
new-commitR%R(RRR+RRRRRRRRRRRRRNRRRRRRR7R(R:R+R2RtoldctxtnewnodetinternalchangestparentRt
newmessageRPRRRtnR9tich((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRsD

-
 




(RiRjRzRRRRR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs						RcB@s,eZdZdZdZdZRS(cC@sE|jdj|jkr;tj|j|jttn|jS(NR(R2RRRRRWR(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRscC@stdS(N(R(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRscC@s|jd}|gfS(NR(R2(R:tbasectx((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs
cC@sV|j|krRtd}tj||jtj|jfdtdndS(Ns.%s "%s" changeset was an edited list candidateR{s&base must only use unlisted changesets(RRRRoRKR|(R:RvRwRxtmsg((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRus
(RiRjRRRRu(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs			t
_multifoldsvfold subclass used for when multiple folds happen in a row

    We only want to fire the editor for the folded message once when
    (say) four changes are folded down into a single change. This is
    similar to rollup, but we should preserve both messages so that
    when the last fold operation runs we can show the user all the
    commit messages in their editor.
    RcB@seZdZRS(cC@stS(N(RW(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR)s(RiRjR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRstrollRPs0like fold, but discard this commit's descriptiontrollupcB@seZdZdZRS(cC@stS(N(R(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR/scC@stS(N(RW(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR2s(RiRjRR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR,s	tdroptdsremove commit from historycB@seZdZRS(cC@s,|j|jj}||jtfgfS(N(R2RGR5RR(R:R((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR8s(RiRjR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR5stmesstms3edit commit message without changing commit contentRcB@seZdZRS(cC@stjdtddS(NRRs
histedit.mess(RRRW(R:((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR@s(RiRjR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR<scC@sw|d
kri}n|j|p$d|p-d}tj|d
d \}}|jtdtj|tj|||d
\}}tj	|||}|rg|D]}	|j
|	^q}ntj|||d|}
|
j
s	tjtdnt|jd|
j
}dt|krftd	}td
}
tj|d|
n|j
|dS(sVutility function to find the first outgoing changeset

    Used by initialization codesdefault-pushR~iscomparing with %s
tforcesno outgoing ancestorss
roots(%ln)is&there are ambiguous outgoing revisionss&see 'hg help histedit' for more detailR{iN(R7t
expandpathRtparseurltstatusRRthidepasswordt
addbranchrevstpeertlookupRtfindcommonoutgoingRRRRtrevsR(R+R2tremoteRRtdestRtcheckouttotherRrtoutgoingtrootsRR{((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytfindoutgoingCs$	 %	R%R$tcommandss*read history edits from the specified filetFILERtcontinues$continue an edit already in progresss	edit-plansedit remaining actions listtkR3s,don't strip old nodes after edit is completetabortsabort an edit in progresstoRs#changesets not found in destinationRs.force outgoing even for unrelated repositoriesRrsfirst revision to be editedtREVs)[OPTIONS] ([ANCESTOR] | --outgoing [URL])cO@s_t|}z8|j|_|j|_t|||||Wdt|j|jXdS(sinteractively edit changeset history

    This command lets you edit a linear series of changesets (up to
    and including the working directory, which should be clean).
    You can:

    - `pick` to [re]order a changeset

    - `drop` to omit changeset

    - `mess` to reword the changeset commit message

    - `fold` to combine it with the preceding changeset

    - `roll` like fold, but discarding this commit's description

    - `edit` to edit this changeset

    There are a number of ways to select the root changeset:

    - Specify ANCESTOR directly

    - Use --outgoing -- it will be the first linear changeset not
      included in destination. (See :hg:`help config.paths.default-push`)

    - Otherwise, the value from the "histedit.defaultrev" config option
      is used as a revset to select the base revision when ANCESTOR is not
      specified. The first revision returned by the revset is used. By
      default, this selects the editable history that is unique to the
      ancestry of the working directory.

    .. container:: verbose

       If you use --outgoing, this command will abort if there are ambiguous
       outgoing revisions. For example, if there are multiple branches
       containing outgoing revisions.

       Use "min(outgoing() and ::.)" or similar revset specification
       instead of --outgoing to specify edit target revision exactly in
       such ambiguous situation. See :hg:`help revsets` for detail about
       selecting revisions.

    .. container:: verbose

       Examples:

         - A number of changes have been made.
           Revision 3 is no longer needed.

           Start history editing from revision 3::

             hg histedit -r 3

           An editor opens, containing the list of revisions,
           with specific actions specified::

             pick 5339bf82f0ca 3 Zworgle the foobar
             pick 8ef592ce7cc4 4 Bedazzle the zerlog
             pick 0a9639fcda9d 5 Morgify the cromulancy

           Additional information about the possible actions
           to take appears below the list of revisions.

           To remove revision 3 from the history,
           its action (at the beginning of the relevant line)
           is changed to 'drop'::

             drop 5339bf82f0ca 3 Zworgle the foobar
             pick 8ef592ce7cc4 4 Bedazzle the zerlog
             pick 0a9639fcda9d 5 Morgify the cromulancy

         - A number of changes have been made.
           Revision 2 and 4 need to be swapped.

           Start history editing from revision 2::

             hg histedit -r 2

           An editor opens, containing the list of revisions,
           with specific actions specified::

             pick 252a1af424ad 2 Blorb a morgwazzle
             pick 5339bf82f0ca 3 Zworgle the foobar
             pick 8ef592ce7cc4 4 Bedazzle the zerlog

           To swap revision 2 and 4, its lines are swapped
           in the editor::

             pick 8ef592ce7cc4 4 Bedazzle the zerlog
             pick 5339bf82f0ca 3 Zworgle the foobar
             pick 252a1af424ad 2 Blorb a morgwazzle

    Returns 0 on success, 1 if user intervention is required (not only
    for intentional "edit" command, but also for resolving unexpected
    conflicts).
    N(R1R6Rt	_histedittrelease(R+R2tfreeargsRRG((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR%^snRcC@s=|jdrtS|jdr&tS|jdr9tStS(NRRt	edit_plan(Rtgoalcontinuet	goalaborttgoaleditplantgoalnew(R((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt_getgoalscC@s?|dkrtjjSt|d}|jSWdQXdS(Nt-trb(tsyststdinR=topen(RR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt	_readfiles
cC@sht|dd}|r9|jr9tjtdn|jd}	|jd}
|jd}|jd}|r|	rtjtdn|dkrt|	|||||
frdtjtd	qdn|dkr!t|	||||
frdtjtd
qdnC|dkr]t|	||frdtjtdqdntj	j
tj	j|j	d
rtjtdn|	r|rtjtdnt|dkrdtjtdqdnz|j
|t|dkr:tj||}
|
dk	r:|j|
q:nt|dkrdtjtdndS(Ntmqssource has mq patches appliedRR RRs$--force only allowed with --outgoingRs$no arguments allowed with --continues!no arguments allowed with --aborts	edit-plans1only --commands argument allowed with --edit-planshistedit-states;history edit already in progress, try --continue or --aborts$no revisions allowed with --outgoingis.only one repo argument allowed with --outgoingis/histedit requires exactly one ancestor revision(tgetattrR7tappliedRRRRtanytosRRhRRRRtdesthisteditR(R+R2RGRRtgoalRJRR,toutgteditplanRRt
defaultrev((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt
_validateargssD
$
c	O@st|}|jdg}|jdd}|jdt|_t|||||||||tkr|jt|||}n\|tkrt	||||dS|t
krt|||dSt||||||t
|||t|||dS(NRrRR$R3(R%RRR3R6R!R=tbootstrapcontinueR#t_edithisteditplanR"t_aborthisteditt_newhisteditt_continuehisteditt_finishhistedit(R+R2RGRRR2RRJ((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRs"
cC@sc|j}xktt||ddgD]I\}\}}|jdkr+|r+|jdkr+t|j|_q+q+Wt|j}d}x|jr>|j|jj	d}	|d7}|j
td||	jtd||j
d|	j|	jf|	j\}
}|
j|_|jj|qW|j|j
tdddS(sThis function runs after either:
    - bootstrapcontinue (if the goal is 'continue')
    - _newhistedit (if the goal is 'new')
    iRiteditingtchangesshistedit: processing %s %s
N(R"t	enumeratetzipR7RKRt	__class__RRQtpoptprogressRRRRRR5R9R(R+R2RGR"tidxRUtnextactttotaltpostactobjRtreplacement_((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR;/s(
-$


c
@sjjtj|jdtjjt|\}}}}|rx|jD]\}}|s|j	dt
j|q^|j	dt
j|t
j|dft|dkr^d}	x/|dD] }
|j	|	t
j|
qWq^q^Wnt
jt
j}|rOt
jfdt|Dnt|d||js%|rt|||j|n|rg}xWt|d	jjD]=}||}|j|tfd
|DfqW|r"t
j|q"q%t|d|n|jtjjjdrctjjdnj jd
rj jd
ndS(s7This action runs when histedit is finishing its sessionRshistedit: %s is dropped
shistedit: %s is replaced by %s
iis'histedit:                            %sc3@s+|]!}|kr|dfVqdS(N(((ROtt(R2(s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>bsttempRc3@s|]}|VqdS(N((ROts(R2(s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>qstreplacedtundoshistedit-last-edit.txtN(!R+RRRR5RWRtprocessreplacementt	iteritemsRRR|RRt	isenabledtcreatemarkersoptt
createmarkersRtcleanupnodeR3t
movebookmarksR4t	changelogRrRRRgR0RRhtsjoinRfR<(
R+R2RGtmappingttmpnodestcreatedtntmtprectsuccsRRtsupportsmarkerstmarkers((R2s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR<LsF

	$()	

$
c

C@szy|jt|\}}}}|jdtj|j|j|kr"|jr"|j|j}tj	||}t
j|||}|jdk}	t
|tjs|j|dd|nt
|tjrtj|||	dddd|nWdQXtj|n|jjd|j||Brftj||jdtd	tnt||d
|t||d|Wn6tk
r|jr|jtdnnXWd|jXdS(
Nsrestore wc to old parent %s
shistedit.abortR%sbundle:tsourceturlsparents() and (%n  or %ln::)t
show_statsRRZRKsrwarning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
(R=RORRR|R4R8RRtopenpathR	t
readbundlettransactiont
isinstanceRt
unbundle20tapplytapplybundleR0tremovet
unfilteredRR5tcleanRWRTt	ExceptionReRRRg(
R+R2RGt__tleafsRYR8Rtgenttr((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR9}s8
	"
cC@s|j|sUt|tj|jtj|j}t|||j|}nt|}t	||}g|jD]}|jrz||j^qz}t
|||||||_|jdS(N(R=R0RR|R5R4t
ruleeditorR"R+RFtwarnverifyactionsRQ(R+R2RGRJtcommentR"tactR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR8s
)	cC@sv|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||||}nt|}t||}t|||||||jdj}||_||_|	|_g|_d}tj|tj sit!j"||g|	g|d
}n||_#dS(NRRR$Ris
roots(%ld)is9The specified revisions must have exactly one common roots*%s is not an ancestor of working directoryR%($RRtcheckunfinishedt
bailifchangedRRR7RRRRtrevrangeRRRRRtbetweenR3R|R0RRrR+RFRsR5R"R4R9RRQRRRt_bundleR8(R+R2RGRRRR3RJRR4temptyRtroottrrRPRRtR"R5R8((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR:sJ


$$"				cC@s/|jpd}|r+|jd}n|S(NR$i(Rt
splitlines(RR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRscC@s|j}|jr|jjd}t|rS|jt|rStqSn|j\}}|j|_|j	j
|n|S(Ni(R2R"RBRRRRRR5R9R(R+RGRR2RHRR9((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR7s		

cC@st|jd||}|r|rtj|tjrk|jd||rktjtdn|jd|rtjtdn|d}|j	stjtd|dtd	qng|D]}|j
^qS(
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 mergesis cannot edit public changeset: %sR{s see 'hg help phases' for details(RRRRQtallowunstableoptRRRRRR(R2toldRR3RR|R((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRys

cC@s	|jjddrxtj}x|D]}||j}t|}|jdddj}t}	|j	dr$|d }|t
tBtBkr$||_
|t|dj}
xett|jD]H\}}||j}
t|
}||
krt}	|j|PqqWq$n|	s(g||<q(q(Wg}x4|jD]#\}}|j|||7}qNWndjg|D]}|j^q}|d	7}||7}|j||jid
d6}t|jdd
}|j||j|S(seopen an editor to edit rules

    rules are in the format [ [act, ctx], ...] like in state.rules
    texperimentalshistedit.autoverbRliit!is
s

R%tprefixshistedit-last-edit.txtRM(R+R*RtsortdictRRRtlowerRtendswithR'R(R)RKRtlstriptreversedRRPRWRRRRtusernameR*RQRS(R2R+R"teditcommenttnewactRuRRtfwordtaddedttsumtnaR!tactxtasumRJR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRrsB


	%


(

"

cC@sgd|jDD]"}|r|jdr|^q}g}x|D]}d|krztjtd|n|jdd\}}|tkrtjtd|nt|j||}|j|qLW|S(sARead the histedit rules string and return list of action objects cs@s|]}|jVqdS(N(Rm(RORP((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>Gst#Rlsmalformed line "%s"isunknown action "%s"(	R~RBRRoRRRRsR(RJRGR!R"RPRKRLRU((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRFEs"
cC@sZyt|||Wn?tjk
rU|jjdrO|jtdnnXdS(Nshistedit-last-edit.txts=warning: histedit rules saved to: .hg/histedit-last-edit.txt
(t
verifyactionsRRoR<RhRR(R+R2R"RGR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRsVsc
C@sNtd|D}t}d
}xI|D]A}|j||||}|jd
k	r,|j|jq,q,Wt||}|jjjddrt	|dkrt
jtddtdng|D]}t
||^q}	|	|d*nL|rJt
jtdtj|ddtd	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(ROR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>fsR%R&isno rules providedR{s%use strip extension to remove commitssmissing rules for changeset %ss@use "drop %s" to discard, see also: 'hg help -e histedit.config'N(RR7RzRRRR2R+R*RRRoRRR|(
R"RGRRwRxRvRURRtdrops((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyR_s(	
"
	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 obsolescense 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 obsolescense markersiN(((RRQRRRkRVtnodemaptobsstoreRRtunionRBRR7t
successorsRR(R2toldreplacementstunfitnmRtnewreplacementsRPtoldsuccst	seensuccstsuccstocheckRRR_tmarkertnsuccstnsucc((s2/usr/lib/python2.7/dist-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|	jD]%\}}t|d|j
|	|<qwW|rt|d|jj	jd}nG|	sd}n8|jj	j}|jt|	d|djj}|	|||fS(sprocess the list of replacements to return

    1) the final mapping between original and created nodes
    2) the list of temporary node created by histedit
    3) the list of new commit created by histeditiiRiN(RR2R9RRRt
setdefaultRRjRVRtitemsRRRrR7RR(RGR9tallsuccsRMtfullmappingtrepRRYt	toproceedtfinalRR]RLRRR\t
newtopmostRP((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyROsF		
(

	



"	)cC@s|s
dSg}xt|jjD]\}}||krW|j||fq&n|}|j|d}	|	dkrq&nx5|	s||jj}|j||f}	qW|j||	dfq&W|rd}
}z|j}
|j	d}|j}xZ|D]R\}
}	||
}|j
td|
tj|tj|	f|	||
<qW|j
||jWdt||
XndS(s,Move bookmark from old to newly created nodeNiR%s,histedit: moving bookmarks %s from %s to %s
(Rt
_bookmarksRPRRR7RRRRetnoteRR|trecordchangeRSR(R+R2RXt
oldtopmostRtmovestbkRRRRRqtmarkstmark((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRUs:"	
	
#
c	@s|jd|djg|D]}tj|^qf|j|j}|jjtfd|D}g|j	d|D]}|j^q}x!|D]}t
j|||qWWdQXdS(sdstrip a group of nodes from the repository

    The set of node to strip may contains unknown nodes.sshould strip %s nodes %s
s, c3@s!|]}|kr|VqdS(N((ROR(R(s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>ss
roots(%ln)N(RRRR|RRkRVRRRRRm(R+R2tnametnodesRRR((Rs2/usr/lib/python2.7/dist-packages/hgext/histedit.pyRT	s	3
+
c
O@st|tr|g}ntjjtjj|jdrt|}|jtg|j	D]}|j
rb|j
^qb}|t|@}	|	rtjt
ddjd|	Dqn||||||S(Nshistedit-states$histedit in progress, can't strip %ss, cs@s|]}tj|VqdS(N(RR|(ROR((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pys	<genexpr>*s(RftstrR0RRhRR1R=RR"RRRR(
torigR+R2tnodelisttargsRRGRUthistedit_nodestcommon_nodes((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytstripwrappers$
(#RmcC@s{tjj|jdsdSt|}|j|jrw|jtd|j	tddt
|jndS(Nshistedit-states!hist:   %s (histedit --continue)
s%d remainingshistedit.remaining(R0RRhRR1R=R"RQRtlabelR(R+R2RG((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytsummaryhook/s
	cC@stjjdttjjdtttdtdgtj	jdtdg|j
ddrtdd	gtd
tt
d<ndS(NR%shistedit-stateshistedit in progresss5use 'hg histedit --continue' or 'hg histedit --abort'shg histedit --continueRt
histeditngRtbs:checkout changeset and apply further changesets from there(RtsummaryhooksRRtunfinishedstatesRRRWRtafterresolvedstatesR*RURtglobals(R+((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pytextsetup:s		(Yt__doc__t
__future__RR?R0R(tmercurial.i18nRt	mercurialRRRRRRRR	R
RRR
RRRRRRRDRtcmdtabletcommandt
testedwithRRR'R(R)RR0tobjectR1RkRRRRRRRURWRRRRRRRRR7RR%R!R"R#R$R%R+R6RR;R<R9R8R:RR7RyRrRFRsRRRORURTRtwrapfunctionRR(((s2/usr/lib/python2.7/dist-packages/hgext/histedit.pyt<module>sp							-tt		C					p							!j				-			1	%		3			5				!	#	=	)