403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.139
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/proc/self/root/usr/lib/python3/dist-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/proc/self/root/usr/lib/python3/dist-packages/hgext/__pycache__/histedit.cpython-313.pyc
�

6�h�X����SrSSKJr SSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKJr SSK
JrJrJr SSKJrJrJrJrJrJrJrJrJrJrJrJrJrJ r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r*J+r+ SSK,J-r-J.r.J/r/ 0r0\%Rb"\05r10r2\%Rf"\25r3\3"SS	S
S9 \3"SS
SS9 \3"SSS
S9 \3"SSSS9 \3"SSS
S9 \3"SSSS9 \3"SSSS9 \3"SSS
SS9 Sr40r5\6"5r7\6"5r8\6"5r9\6"5r:Sr;"SS5r<"SS5r=Sr>S r?S�S!jr@S"rAS#rBS�S$jrC\C"S%S&/\"S'5SS(9"S)S*\=55rD\C"S+S,/\"S-5SS(9"S.S/\=55rE\C"S0S1/\"S255"S3S4\=55rF\C"S5S6/\"S755"S8S9\=55rG\C"S:/\"S;5SS<9"S=S>\F55rH\C"S?S@/\"SA55"SBSC\F55rI\C"SDSE/\"SF55"SGSH\=55rJ\C"SISJ/\"SK5SS(9"SLSM\=55rKS�SNjrLSSKMrM/SOQrNSPSQSR.rOSSurPrQrRrSrTSTurUrVrWSUurXrYrZSVur[r\SWur]r^r_r`raSXurbrcrdreSYSZSZS[S[S\SSS]S^S_.	\d0SES`_S,Sa_S1Sb_SJSc_S&Sd_S@Se_SfSg_ShSi_SjSk_SlSi_SmSk_SnSo_SpSq_SrSo_SsSq_StSu_\cSvSvSwSxSySxSySiSkSz.	\e00rfS{rg"S|S}5rhS~riS�SjrjS�rkS�rl"S�S�5rmS�rnS�ro\1"SS�S�S�\"S�5\"S�54S�S�S
\"S�54S�S�S
\"S�54SjS�S
\"S�54S�S�S
\"S�54S�S�S
\"S�54S1S�S
\"S�54S@S�/\"S�5\"S�54/\R�-\"S�5\1R�S�9S�5rrS�rsS�rtS�ruS�rvS�rwS�rxS�ryS�rzS�r{S�r|S�r}S�S�jr~S�rS�r�S�r�S�r�S�r�S�r�S�r�S�S�jr�S�r�S�r�S�r�S�r�S�r�S�r�S�S�jr�S�r�\GR"\&S�\�5 S�r�S�r�g!\a SrSrGN�f=f!\a SrMGN�f=f)�a�interactive 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 allow edits before making new commit
 #  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 allow edits before making new commit
 #  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

The summary of a change can be customized as well::

  [histedit]
  summary-template = '{rev} {bookmarks} {desc|firstline}'

The customized summary should be kept short enough that rule lines
will fit in the configured line length. See above if that requires
customization.

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

�)�annotationsN)�_)�bin�hex�short)�bundle2�cmdutil�context�copies�destutil�	discovery�encoding�error�exchange�
extensions�hg�
logcmdutil�merge�
mergestate�	mergeutil�obsolete�pycompat�	registrar�repair�rewriteutil�scmutil�state�util)�dateutil�
stringutil�urlutil�experimental�histedit.autoverbF��default�histedits
defaultrev�dropmissing�linelen�P�singletransaction�uisinterface.histedit�summary-templates{rev} {desc|firstline}�later-commits-firstT)r%�experimentalsships-with-hg-corec�^	�[S5n/m	U	4Sjn[[5[[5-[[5-HnU"U5 M
 T	RS5 /nUR
SS5(aURS5 X1U4-RS5T	-U-nSRUVs/sHo�(aSU-OS	PM sn5$s snf)
z�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.
s�Edit history between %s and %s

Commits are listed from least to most recent

You can reorder changesets by reordering the lines

Commands:
c�<>�[UnURRS5n[UR5(a$SR[
URSS95nTRSXS4-5 TRS/[U5S-
-5 g)	N�
�, c��[U5$�N��len)�vs �0/usr/lib/python3/dist-packages/hgext/histedit.py�<lambda>�1geteditcomment.<locals>.addverb.<locals>.<lambda>Hs���Q����keys %s = %srs  %s�)	�actiontable�message�splitr6�verbs�join�sorted�append�extend)r7�a�lines�actionss   �r8�addverb�geteditcomment.<locals>.addverbDsw�����N���	�	����&���q�w�w�<�<��
�
�6�!�'�'�/?�@�A�A����{�a�q��]�2�3�����y�C��J��N�3�4r;r;r&r'sKDeleting a changeset from the list will DISCARD it from the edited history!r1s# %s
s#
)	rrD�primaryactions�secondaryactions�tertiaryactionsrE�
configboolrArC)
�ui�first�last�introrJr7�hintsrH�lrIs
         @r8�geteditcommentrV-s����
�	�	
�E��G�5�	�~��
�!�
"�	#�
��
!�	"�	
�
	��
�		"�
�N�N�3���E�	�}�}�[�.�1�1�
���
8�	
�
�T�]�
"�)�)�%�0�7�:�U�B�E��8�8�U�C�U��a�Y��]�V�3�U�C�D�D��Cs�8Cc�H�\rSrSrSrSrSrSSjrSrSr	S	r
S
rSrg)
�
histeditstatei`c��XlSUlSUlSUlSUlSUlSUlSUl[R"US5Ul
/Ulg�N�histedit-state)�reporI�keep�topmost�
parentctxnode�lock�wlock�
backupfile�statemod�cmdstate�stateobj�replacements)�selfr\s  r8�__init__�histeditstate.__init__asV���	������	����!�����	���
���� �)�)�$�0A�B��
���r;c�D�URR5(d*[R"UR[S55 UR
5nUSUl[USU5nX l	USUl
USUlUSUlUSUl
g)	z;Load histedit state from disk and set fields appropriately.r&�
parentctxnode�rules�keep�topmost�replacements�
backupfileN)re�existsr	�wrongtooltocontinuer\r�_readr_�
parserulesrIr]r^rfrb)rg�datarIs   r8�read�histeditstate.readms����}�}�#�#�%�%��'�'��	�	�1�[�>�B��z�z�|��!�"2�3����T�(�^�T�2������M��	��J�'��� ��1����}�-��r;c	�T�URRRS5nURS5(aUR	5nUup4pVpxO[
R"U5nUup4pVnSnSRUV	V
s/sHup�SX�4-PM
 sn
n	5nUUUUUUS.$s sn
n	f)Nr[�v1
r1s%s %s)rkrlrmrnrorp)r\�vfsrv�
startswith�_load�pickle�loadsrC)rg�fprur_�rulesr]r^rfrb�verb�rests           r8rs�histeditstate._read|s���
�Y�Y�]�]�
�
� 1�
2��
�=�=��!�!��:�:�<�D�LP�I�M�$��z��<�<��#�D�@D�=�M�$���J��
�
��N����H��|�3��N�O��,����)�%�

�	
��Os�B$
Nc���U(aURSSURSS9 gURRSS5nURU5 SSS5 g!,(df   g=f)Nr[)r[splain)�location�w)�addfilegenerator�_writer\rz)rg�tr�fs   r8�write�histeditstate.write�sV��
����!�$����!�	
 �
������0�$�7�1����A��8�7�7�s�A�
A*c
��URS5 URS[UR5-5 URS[UR5-5 URSUR(aSOS-5 URS[UR5-5 URH%nURSUR5-5 M' URS[UR5-5 URH>nURS[US5SRS	US
554-5 M@ URnU(dSnURSU-5 g)Nrys%s
�TruesFalses%d
s%s%s
rr;c3�8# �UHn[U5v� M g7fr4)r��.0�rs  r8�	<genexpr>�'histeditstate._write.<locals>.<genexpr>�s���<�^��S��V�V�^���r>)r�rr_r^r]r6rI�tostaterfrCrb)rgr�action�replacementrbs     r8r��histeditstate._write�s(��
�����
����3�t�1�1�2�2�3�
����3�t�|�|�,�,�-�
����t�y�y�G�h�?�@�
����3�t�|�|�,�,�-��l�l�F��H�H�W�v�~�~�/�/�0�#�
����3�t�0�0�1�1�2��,�,�K��H�H����A��'��H�H�<�[��^�<�<���
�-��_�_�
���J�
����:�%�&r;c
���URRSS5nUR5Vs/sHo"SSPM	 nnSnX4 US-
n[X45nUS-
n[X45nUS-
nX4S:HnUS-
n/n[	X45n	US-
n[U	5H'n
X4nUS-
nX4nUS-
nUR
X�45 M) /n
[	X45nUS-
n[U5Han
X4n[USS5n[S[U5S5V
s/sHn
[X�U
S-5PM nn
U
R
UU45 US-
nMc X4nUS-
nUR5 XXXvU
U4$s snfs sn
f)Nr[�r���rr>r��()	r\rz�	readlinesr�int�rangerEr6�close)rgrrUrH�indexr_r^r]r��rulelen�i�
ruleaction�rulerf�replacementlenr��original�succrbs                   r8r|�histeditstate._load�s���
�Y�Y�]�]�,�d�
3��!#����0��A�3�B����0���
��
��
���E�L�)�
�
��
���e�l�#��
��
���|�w�&��
��
�����e�l�#��
��
���w��A���J��Q�J�E��<�D��Q�J�E��L�L�*�+�,� ����U�\�*��
��
���~�&�A��,�K��;�s��+�,�H��r�3�{�#3�R�8��8�A��K�A��F�+�,�8�
��
����4� 0�1��Q�J�E�'��\�
�
��
��
���
��T�L�*�L�L��[1��Bs�E'�E,c�z�UR5(a&URRRS5 ggrZ)�
inprogressr\rz�unlink�rgs r8�clear�histeditstate.clear�s+���?�?����I�I�M�M� � �!2�3�r;c�L�URRRS5$rZ)r\rzrqr�s r8r��histeditstate.inprogress�s���y�y�}�}�#�#�$5�6�6r;)
rIrbr]r`r_rfr\rer^rar4)
�__name__�
__module__�__qualname__�__firstlineno__rhrvrsr�r�r|r�r��__static_attributes__�r;r8rXrX`s,��
�
.�
�(
�'�,/M�b4�7r;rXc�`�\rSrSrSr\S5rSrSrSr	Sr
SrS	rS
r
SrSrS
rg)�histeditactioni�c�>�XlURUlX lgr4)rr\�node)rgrr�s   r8rh�histeditaction.__init__�s���
��J�J��	��	r;c��UR5RSS5Sn[U5nU"X5$![Raz [
R"URU5nUR5n[U5nN[![Ra# [R"[S5U-5ef=ff=f)zCParses the given rule, returning an instance of the histeditaction.� r>rsinvalid changeset %s)
�striprAr�binascii�Errorr�	revsingler\rr�RepoLookupError�
ParseErrorr)�clsrr��ruleid�rev�_ctx�rulehashs       r8�fromrule�histeditaction.fromrule�s�������#�#�D�!�,�Q�/��	L��f�+�C��5�����~�~�	L�
L��(�(����V�<���8�8�:���(�m����(�(�
L��&�&�q�)@�'A�F�'J�K�K�
L��	L�s�8�C�
<B�7C�Cc��URn[UR5n[R"XE5UlURc%[
R"[S5USS-5eURXU5 g)z)Verifies semantic correctness of the ruleNsunknown changeset %s listed�)	r\rr�r�resolvehexnodeidprefixrr�r�_verifynodeconstraints)rg�prev�expected�seenr\�has      r8�verify�histeditaction.verifysf���y�y��
����^���2�2�4�<��	��9�9���"�"�1�%C�#D�r�#�2�w�#N�O�O��#�#�D�D�9r;c�@�URU;aI[R"[S5UR[UR54-[S5S9eURU;a5[R"[S5[UR5-5eg)Ns%%s "%s" changeset was not a candidatesonly use listed changesets��hints#duplicated command for changeset %s)r�rr�rr�r)rgr�r�r�s    r8r��%histeditaction._verifynodeconstraintss����9�9�H�$��"�"��:�;��9�9�e�D�I�I�.�/�0��4�5��
��9�9����"�"��8�9�E�$�)�)�<L�L��
�r;c���URURnURRnURSS0S5 [R
"XR
SS55nSSS5 SURU[R"W54-nURRRSS5n[US5n[R"XE5$!,(df   N|=f)	zcbuild a histedit rule line for an action

by default lines are in the form:
<hash> <rev> <summary>
)s
templatealiass
label(l,x)�xr&r,Ns%s %s %sr(�)
r\r�rP�configoverrider	�rendertemplate�configr�r �	firstline�	configint�max�ellipsis)rg�ctxrP�summary�line�maxlens      r8�torule�histeditaction.torules����i�i��	�	�"��
�Y�Y�\�\���
�
�
.��5�{�
��,�,��Y�Y�{�,?�@��G�
��d�i�i��j�.B�.B�7�.K�L�L�������'�'��Z�@���V�R����"�"�4�0�0�
�
�s�'C!�!
C/c�J�SUR[UR54-$)zoPrint an action in format used by histedit state files
(the first line is a verb, the remainder is the second)
s%s
%s)r�rr�r�s r8r��histeditaction.tostate0s ���D�I�I�s�4�9�9�~�6�6�6r;c�b�UR5 UR5 UR5$)zfRuns the action. The default behavior is simply apply the action's
rulectx onto the current parentctx.)�applychange�
continuedirty�
continuecleanr�s r8�run�histeditaction.run6s+��	
���������!�!�#�#r;c�D�URnXRnURR5 [R
"XRRSS9 SSS5 [URX05nURRUR5UR55 UR(aI[R"[!S5UR"[%UR54-[!S5S9eg!,(df   N�=f)zdApplies the changes from this action's rulectx onto the current
parentctx, but does not commit them.T��
quietemptyNsFix up the change (%s %s)s hg histedit --continue to resumer�)r\r�rP�silentr�updaterr_�applychanges�dirstate�	setbranch�branch�currenttransaction�unresolvedcountr�InterventionRequiredrr�r)rgr\�rulectx�statss    r8r��histeditaction.applychange=s����y�y���y�y�/��
�W�W�^�^�
��I�I�d�J�J�4�4��F���T�W�W�d�R�8���
�
������ 0�$�2I�2I�2K�L�� � ��,�,��.�/�4�9�9�e�D�I�I�>N�2O�O��:�;��
�!�	�
�s�*D�
Dc�d�URnXRnUR5n[X5nURRSS5(a[R"5nOUR5nU"UR5UR5UUR5US9 g)z}Continues the action when changes have been applied to the working
copy. The default behavior is to commit the dirty changes.�rewrite�update-timestamp)�text�user�date�extra�editorN)r\r��commiteditor�
commitfuncforrPrOr�makedater�descriptionrr)rgr\r�r	�commitrs      r8r��histeditaction.continuedirtyLs����y�y���y�y�/���"�"�$���t�-���7�7���j�*=�>�>��$�$�&�D��<�<�>�D���$�$�&�������-�-�/��	
r;c��g)z1The editor to be used to edit the commit message.Fr�r�s r8r
�histeditaction.commiteditor`s��r;c��URSnUR5URR:Xa\URRR[
S5[UR5-5 XR[54/4$UR5UR:XaU/4$XRUR544/4$)z�Continues the action when the working copy is clean. The default
behavior is to accept the current commit as the new version of the
rulectx.�.s$%s: skipping changeset (no changes)
)	r\r�rr_rP�warnrr�tuple)rgr�s  r8r��histeditaction.continuecleands����i�i��o���8�8�:����1�1�1��I�I�L�L����:�;�e�D�I�I�>N�N�
��)�)�U�W�-�.�.�.��8�8�:����"���7�N��i�i�#�(�(�*��/�0�0�0r;)r�r\rN)r�r�r�r�rh�classmethodr�r�r�r�r�r�r�r�r
r�r�r�r;r8r�r��sH���
���� :��1�.7�$�
�
�(�
1r;r�c�<^^^�TR5mUUU4SjnU$)a)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�>�ST0nTRRUS5 URS05R5nTR	5US'X S'TR
"S0UD6sSSS5 $!,(df   g=f)N�sphasess
new-commitr&r�histedit_sourcer�)rPr��get�copyrr)�kwargs�	overridesr�phaseminr\�srcs   ���r8�
commitfunc�!commitfuncfor.<locals>.commitfunc�sm���/��:�	�
�W�W�
#�
#�I�{�
;��J�J�w��+�0�0�2�E�(+���	�E�$�%�#�7�O��;�;�(��(�	<�
;�
;�s�A	A5�5
B)�phase)r\r!r"r s`` @r8rrts����y�y�{�H�)��r;c�B�UR5R5URR5:XaJUR5 [R
"XUSS9 [R"SSSS5nSSS5 U$URRSSURSS5S	5 [R"UU/S
QS9nURRSSSS	5 U$!,(df   W$=f!URRSSSS	5 f=f)z@Merge changeset from ctx (only) in the current working directoryT)�allrNr+s
forcemergestoolr;r&)salready editedscurrent changesparent of current change)�labels)�p1r�r�r�r	�revert�mergemod�updateresultrP�	setconfigr�graft)rPr\r��optsrs     r8r�r��s���
�v�v�x�}�}��$�-�-�*�*�,�,��Y�Y�[��N�N�2�S�d�3��)�)�!�Q��1�5�E��(�L�!	F��G�G����}�d�h�h�w��&<�k�
��N�N�����E�
�G�G���e�]�C��E��L�)�[�(�L��
�G�G���e�]�C��E�s�0C,�AC>�,
C;�> Dc�P^^^�[URSUR5TR555nU(dgUHQnUR5(aM[R
"[
S5[UR55-5e UR5n[5nUH"n	URU	R55 M$ [R"UT5mUV
s/sH$n
[R"U
TU5(aM"U
PM& nn
TR!5mUUU4SjnUR#S5(aUSnOUR%5nUR#S5n
UR#S5nUR#S5nUR5R5UR'5R54nSnU(d[R("S	S
S9n[*R,"UUUUUU
UUUS9	nUR/U5$s sn
f)
z�collapse 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::%dN�!cannot fold into public change %sc��>�UT;abTUnUR5n[R"UUUR5UR	5SU;SU;TRU5S9nU$g)N�lr�)�islink�isexec�
copysource)�flagsr
�
memfilectx�pathrur)	r\r�r8�fctxr6�mctx�copied�headmf�lastctxs	      ���r8�	filectxfn�collapse.<locals>.filectxfn�sj����6�>��4�=�D��J�J�L�E��%�%����	�	���	�	���u�}��u�}�!�:�:�d�+��D��K�r;�message�user�date�extraTs
histedit.fold��edit�editform)�parentsr�filesr>rrrr	)�list�setr��mutablerr�rrr�r(r�rHr�
pathcopiesr	�samefile�manifestrr
�p2�getcommiteditorr
�memctx�	commitctx)r\�firstctxr=�
commitopts�
skipprompt�ctxs�c�baserHr�r�r>r@rrrrGr	�newr;r<s  `                @@r8�collapserZ�s���������H�L�L�N�G�K�K�M�B�C�D���
���y�y�{�{��"�"��6�7�%�����/�I��
��
�;�;�=�D�
�E�E���
���S�Y�Y�[�!���
�
�t�W�
-�F��H��1�W�%5�%5�a��$�%G�Q��E�H�
�
�
�
�F�� �~�~�j�!�!��Z�(���&�&�(���>�>�'�"�D��>�>�'�"�D��N�N�8�$�E��{�{�}�!�!�#�X�[�[�]�%7�%7�%9�:�G�
�F���(�(�d�=M�N��
�.�.���
���
�
���
�C��>�>�#����W
Is�8!H#�H#c�&�USRSS9$)NT)�missing)�dirty�r\s r8�
_isdirtywcr_�s����:���D��)�)r;c�P�[R"[S5[S5S9e)Ns working copy has pending changessYamend, commit, or revert them and run histedit --continue, or abort with histedit --abortr�)r�
StateErrorrr�r;r8�
abortdirtyrb�s+��
�
�
�	�
-�.�
�
:�
��r;c� ^^^^�UUUU4SjnU$)Nc�f>�T(a	T(aeTSnT(a[RU5 OWT(a[RU5 O:[T5S:�a[RU5 O[
RU5 XlTUlTUlTHnU[U'M U$�Nrr>)
rL�add�internalactionsr6rMrNr�rBr@r?)r�r��internalr@�priorityrBs  ����r8�wrap�action.<locals>.wraps�����8�+�+��Q�x������t�$�
�����%�
��Z�!�^�� � ��&�����%�����	�����D� #�K�����
r;r�)rBr@rirhrjs```` r8r�r�s�����&�Kr;�pick�ps
use commit)ric�(^�\rSrSrU4SjrSrU=r$)�pickic�<>�URURnUR5R5URR:Xa?URR
R
S[UR5-5 U/4$[TU]%5$)Nsnode %s unchanged
)
r\r�r(rr_rP�debugr�superr�)rgr��	__class__s  �r8r��pick.runsq����)�)�D�I�I�&���:�:�<����$�*�*�":�":�:��I�I�L�L���5��d�i�i�8H�H�I��B�;���w�{�}�r;r�)r�r�r�r�r�r��
__classcell__�rss@r8roros
����r;ro�edit�es4use commit, but allow edits before making new commitc� �\rSrSrSrSrSrg)rEi#c�`�URnXRn[R"XRR
SS9 [
URX05 [S5n[R"[S5[UR5-U[UR5-S9e)NTr�s9to edit %s, `hg histedit --continue` after making changess6Editing (%s), commit as needed now to split the changer�)r\r�rr�rr_r�rPrrr�r)rgr\r�r�s    r8r��edit.run)s����y�y���y�y�/��
�	�	�$�
�
�0�0�T�B��T�W�W�d�R�0��M�N���(�(�
�G�H��D�I�I��
���d�i�i�(�(�
�	
r;c�,�[R"SSS9$)NTs
histedit.editrD�r	rPr�s r8r
�edit.commiteditor5����&�&�D�;K�L�Lr;r�N)r�r�r�r�r�r
r�r�r;r8rErE#s
��

�Mr;rE�fold�fs-use commit, but combine it with the one abovec�L^�\rSrSrU4SjrSrSrSrSrSr	Sr
S	rU=r$)
�foldi9c�`>�[TU]XU5 URnU(dX@RR	5nOUR
S;agXARnUR
5(d9[R"[S5[UR55-5eg)z.Verifies semantic correctness of the fold rule)rl�baseNr0)rrr�r\r�r(r�rKrr�rr)rgr�r�r�r\rWrss      �r8r��fold.verify;s����
���t�t�,��y�y����Y�Y��"�"�$�A����0�0���Y�Y��A��y�y�{�{��"�"��6�7�%�����/�I��
�r;c���URnXRn[X5nU"S[UR5-UR	5UR5UR
5S9 g)Nsfold-temp-revision %s)rrrr)r\r�rrrrr)rgr\r�rs    r8r��fold.continuedirtyJsT���y�y���y�y�/���t�-���)�E�$�)�)�,<�<����������-�-�/�		
r;c�b�URnUSnXRnURRnUR5U:XaKURR[
S5[UR5-5 X RU44/4$XnURSUR5UR55Vs1sHnUR5iM nnU(ddURR[
S5[UR5[U54-5 X RUR544/4$UR5nURUR55 URURXX2R5U5$s snf)Nrs%s: empty changeset
s(%d::. - %d)sI%s: cannot fold - working copy is not a descendant of previous commit %s
)
r\r�rr_rPrrrrJr�r�discard�
finishfold)	rgr\r�r�r_�	parentctxrW�
newcommits�
middlecommitss	         r8r��fold.continuecleanVsh���y�y���4�j���y�y�/���
�
�0�0�
��8�8�:��&��G�G�L�L��3�4�u�T�Y�Y�7G�G�H��)�)�m�%5�6�7�7�7��'�	��X�X�o�y�}�}��	�
�
��P�
�P��
�F�F�H�P�	�
���G�G�L�L��:������#�U�=�%9�:�	;�
��)�)�c�h�h�j�]�3�4�4�4�"���)�
����c�h�h�j�)�����G�G�T�g�x�x�z�=�
�	
��#
s�
F,c��g)z�Returns true if the rule should skip the message editor.

For example, 'fold' wants to show an editor, but 'rollup'
doesn't want to.
Fr�r�s r8rU�fold.skippromptus��r;c��g)z�Returns true if the rule should merge messages of multiple changes.

This exists mainly so that 'rollup' rules can be a subclass of
'fold'.
Tr�r�s r8�
mergedescs�fold.mergedescs}s��r;c��g)z�Returns 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'.
Fr�r�s r8�	firstdate�fold.firstdate�s��r;c	���[R"UR55 0nUR5US'UR	5(dUR5nOYSR
UR5/UV	s/sHo�U	R5PM sn	-UR5/-5S-nX�S'UR5(aUR5US'O+[UR5UR55US'URSS5(a[R"5US'UR5R5n
SUR5UR54-U
S	'X�S
'[UR!5UR!55nSU0nUR"R%US5 ['UUX%UUR)5S
9n
SSS5 W
cU/4$[R"X-5 UR+5U44UR+5U
44X]44/nUHnUR-X�445 M X-U4$s sn	f!,(df   N}=f)NrAs
***
r1r@rBrrs%s,%srrCrr&)rU)r*r�r(rr�r
rCr�rr�rOrrrrrr$rPr�rZrUr�rE)rgrPr\r��oldctx�newnode�internalchangesrT�
newmessager�rr r�nrf�ichs                r8r��fold.finishfold�s/���������!��
�!�h�h�j�
�7����� � ����*�J�����_�_�&�'�6E�F�o��A�w�*�*�,�o�F�G��)�)�+�,�-��
��
�",�:���>�>���"%�(�(�*�J�w��"%�c�h�h�j�&�+�+�-�"@�J�w��
�=�=��%8�9�9�"*�"3�"3�"5�J�w���	�	�� � �"��%-����	�6�:�:�<�/H�$H�� �!�$�8���s�y�y�{�F�L�L�N�3��/��:�	�
�W�W�
#�
#�I�{�
;�����
���?�?�,��A�<�
�9���7�N������ �
�[�[�]�W�J�'�
�X�X�Z�!���
�d�O�
��
#�C�����d��,�#��w��$�$��SG�.<�
;�s�?I 
�I%�%
I3r�)
r�r�r�r�r�r�r�rUr�r�r�r�rurvs@r8r�r�9s+���
�

�
�>���5%�5%r;r�r��bs:checkout changeset and apply further changesets from therec�,�\rSrSrSrSrSrSrSrg)rXi�c���URSR5UR:wa-[R"URUR5 UR	5$�Nr)r\r�r*�clean_updater�r�s r8r��base.run�sI���9�9�T�?���!�T�Y�Y�.��!�!�$�)�)�D�I�I�"6�7��!�!�#�#r;c��[5 gr4)rbr�s r8r��base.continuedirty�s���r;c�(�URSnU/4$r�r^)rg�basectxs  r8r��base.continueclean�s���)�)�D�/����{�r;c��URU;aJ[S5n[R"X@R[UR54-[S5S9eg)Ns.%s "%s" changeset was an edited list candidates&base must only use unlisted changesetsr�)r�rrr�r�r)rgr�r�r��msgs     r8r��base._verifynodeconstraints�sR���9�9�� ��E�F�C��"�"��y�y�%��	�	�"2�3�3��@�A��
�!r;r�N)	r�r�r�r�r�r�r�r�r�r�r;r8rXrX�s��
$�
��r;rXs
_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.
    )rhc��\rSrSrSrSrg)�
_multifoldi�c��g�NTr�r�s r8rU�_multifold.skipprompt����r;r�N)r�r�r�r�rUr�r�r;r8r�r��s��r;r��rollr�s9like fold, but discard this commit's description and datec�&�\rSrSrSrSrSrSrg)�rollupi�c��g)NFr�r�s r8r��rollup.mergedescs�s��r;c��gr�r�r�s r8rU�rollup.skipprompt�r�r;c��gr�r�r�s r8r��rollup.firstdate�r�r;r�N)r�r�r�r�r�rUr�r�r�r;r8r�r��s��
��r;r��drop�dsremove commit from historyc��\rSrSrSrSrg)�dropic�x�URURRnXR[	54/4$r4)r\rr_r�r)rgr�s  r8r��drop.runs1���I�I�d�j�j�6�6�7�	��I�I�u�w�/�0�0�0r;r�N)r�r�r�r�r�r�r�r;r8r�r�s��1r;r��mess�ms3edit commit message without changing commit contentc��\rSrSrSrSrg)r@i
c�,�[R"SSS9$)NTs
histedit.messrDr}r�s r8r
�message.commiteditorrr;r�N)r�r�r�r�r
r�r�r;r8r@r@
s��Mr;r@c���Uc0n[R"SXU5nUR[S5[R"UR
5-5 [R"XUR/4S5upg[R"XU5nU(a UV	s/sHo�RU	5PM nn	[R"XXcS9n
U
R(d[R"[S55e[!UR#SU
R55n[%U5S:�a*[S5n[S	5n
[R"X�S
9eXSR'5$s sn	f)zRutility function to find the first outgoing changeset

Used by initialization codeNr&scomparing with %s
)�forcesno outgoing ancestors�
roots(%ln)r>s&there are ambiguous outgoing revisionss&see 'hg help histedit' for more detailr�r)r!�get_unique_push_path�statusr�hidepassword�locr�
addbranchrevsr��peer�lookupr
�findcommonoutgoingr\rrarI�revsr6r�)rPr\�remoter�r.r8r��checkout�otherr��outgoing�rootsr�r�s              r8�findoutgoingr�s.���|����'�'��T�v�F�D��I�I�a�&�'�'�*>�*>�t�x�x�*H�H�I��%�%�d�4�;�;��2C�T�J�N�D��G�G�D��%�E��,0�1�D�S���C� �D��1��+�+�D��K�H�������q�!9�:�;�;�����=�(�*:�*:�;�<�E�
�5�z�A�~��9�:���:�;�����s�.�.��a��>��� � ��2s�!E5)rlrwr�r�r�r�s^folds^roll)r�r�)r>����)���)�	�
�)r>r�)r�r�r�r�r�)rr>r�r��global�next-action�prev-action�quit�	showpatch�help)	�hs	KEY_RIGHTr2sKEY_LEFT�q�c�C�v�?saction-dropsaction-editsaction-foldsaction-messsaction-picksaction-rollr��select�j�down�k�up�KEY_DOWN�KEY_UP�J�	move-down�K�move-up�	KEY_NPAGE�	KEY_PPAGE�0�goto�	page-down�page-up�	line-down�line-up)	r�r�r�r�r�r�r�r�r�c�x�[R"S[R"S[R
S55$)Nshhr>s    )�struct�unpack�fcntl�ioctl�termios�
TIOCGWINSZr�r;r8�screen_sizer
ps&���=�=�����A�w�/A�/A�7� K�L�Lr;c��\rSrSrS	SjrSr\R"\5r\	S5r
\RS5r
SrSrg)
�histeditruleitc�N�XlX lX@lX0lX0l/Ulgr4)rPr�r��origpos�pos�	conflicts)rgrPr�rr�s     r8rh�histeditrule.__init__us"��������������r;c�8�SURUR4-$)Ns%s%s)�prefix�descr�s r8�	__bytes__�histeditrule.__bytes__}s���$�+�+�t�y�y�1�1�1r;c�,�[RURUR5nURR	5SSnURR5nSSUR-RS5URS5UU4-$)Nrr�s#%s %s %d:%s   s%dr�r�)�
ACTION_LABELSrr�r�rr�r�ljust)rgr��hr�s    r8r�histeditrule.prefix�s}��
�"�"�4�;�;����<���H�H�L�L�N�1�R� ���H�H�L�L�N��!�
�T�\�\�
!�(�(��+��L�L��O�
�
�	%
�
�	
r;c���[R"URURR	SS55nU(aU$[
R"URR55$)Nr&r,)r	r�r�rPr�r r�r
)rgr�s  r8r�histeditrule.desc�sU���(�(��H�H�d�g�g�n�n�[�2E�F�
����N��#�#�D�H�H�$8�$8�$:�;�;r;c���URUR:�a�URUR::az[URR	55[URR	55-[5:wa'UR
R
U5 UR
$XR
;aUR
RU5 UR
$r4)rrrJr�rHrrE�remove)rgr�s  r8�checkconflicts�histeditrule.checkconflicts�s����9�9�t�x�x��E�M�M�T�\�\�$A��5�9�9�?�?�$�%��D�H�H�N�N�,<�(=�=���F����%�%�e�,��~�~�%��N�N�"��N�N�!�!�%�(��~�~�r;)r�rr�rrrPN)rl)r�r�r�r�rhrr�	strmethod�__str__�propertyrr�
propertycacherr r�r�r;r8rrtsO���
2�� � ��+�G�
�
��
� 
���	<��	<�r;rc�p�/nUH-nURSURUR4-5 M/ U$)zWReturns a list of commands consumable by histedit --commands based on
our list of ruless%s %s
)rEr�r�)r��commandss  r8�makecommandsr(�s6���H������
�e�l�l�E�I�I�%>�>�?���Or;c���UR5upVUS-
U-
n[U5RU5SUnUS:aXQ-nUS:aXb-nU(aURXX45 gURXU5 g)z�Add a line to the given window left padding but 100% filled with
whitespace characters, so that the color appears on the whole liner>Nr)�getmaxyx�bytesr�addstr)�win�y�xr��color�maxy�maxx�lengths        r8�addlnr4�st������J�D�
�A�X��\�F���;���V�$�W�f�-�D��1�u��H���1�u��H����
�
�1��%��
�
�1��r;c�:�[U5U::aU$SXS-
*S-$)Ns> r�r5�r�r�s  r8�_trunc_headr7�s(��
�4�y�A�~����4�a�%��
�#�#�#r;c�:�[U5U::aU$USUS-
S-$)Nr�s >r5r6s  r8�_trunc_tailr9�s'��
�4�y�A�~�����!�a�%�=�5� � r;c��\rSrSrSrSrSrSrSrSr	Sr
SS	jrS
rSr
SrS
rSrSrSrSrSSjrSrSrg)�_chistedit_statei�c���XlX lX0lURR	SS5UlSUlSUl[[4Ul	SUl
[SS0[SS00Ul
g)Nr&r-r�line_offset)r\r��stdscrrPrO�later_on_topr�selected�	MODE_INIT�mode�page_height�
MODE_RULES�
MODE_PATCH�modes)rgr\r�r>s    r8rh�_chistedit_state.__init__�sy���	��
��� �G�G�.�.��/�
���
�����
��	�*��	��������
����	
��
r;c��URURUR5nURnUR	5 UR5upEUS-
nSUR
5UR5SS4-nURSSUSU5 SUR5-nURSSUSU5 URRUR55nSS	RU5-nURSSUSU5 S
[R"UR!55-nURSSUSU5 SnURS
SU5 S[#U5-n	Xi-
S-n
S
nUSU--
S-
nUR%5n
['U
5Hpup�[#U
5U:�a<X�S-
:Xa4URX�[)SRX�S5U
55 US-n O$URX�[+X�55 US-nMr UR,n[#U5S:�a"SR[/SU55nSU-nOSnURUSUSU5 UR15 g)zKRenders the commit window that shows the log of the current selected
commitr�schangeset: %d:%sNr�r>s
user:      %sr�s
bookmark:  %sr�s
summary:   %sr�sfiles:     r��,rc�<�URR5SS$)Nr�)r�r)r�s r8r9�0_chistedit_state.render_commit.<locals>.<lambda>s��!�%�%�)�)�+�c�r�2Br;schanged files overlap with %ss
no overlap)r��display_pos_to_rule_posrr��boxr*r�rr,rr\�
nodebookmarksr�rCr r�r
r6rH�	enumerater9r7r�map�noutrefresh)rgr-r�r�r1r2r3r��bms�fnx�fnmaxxr.�fnmaxnrHr��line1r�conflictstrs                  r8�
render_commit�_chistedit_state.render_commit�s6���z�z�$�6�6�t�x�x�@�A���h�h�����	��\�\�^�
������"�c�g�g�i�����3�B��%@�@���
�
�1�a��g�v��'��#�(�(�*�,���
�
�1�a��g�v��'��i�i�%�%�c�h�h�j�1���$�)�)�C�.�0���
�
�1�a��g�v��'��*�"6�"6�s���7H�"I�I���
�
�1�a��g�v��'����
�
�1�a����#�d�)�m�����!��
����Q���!�#���	�	���!�%�(�H�A��5�z�F�"�q�Q�J���
�
�1�;�t�y�y��r��/C�V�#L�M���E����J�J�q�{�5�9�:��A��A�
)��N�N�	��y�>�A���)�)�C�(B�I�$N�O�K�:�[�H�K�'�K��
�
�1�a��W�f�-�.����r;c���URS[:XaSnUR5$SnUR(aUS-
nUR5$US-
nUR5$)Nrs}?: help, k/up: line up, j/down: line down, v: stop viewing patch
pgup: prev page, space/pgdn: next page, c: commit, q: abort
s�?: help, k/up: move up, j/down: move down, space: select, v: view patch
d: drop, e: edit, f: fold, m: mess, p: pick, r: roll
pgup/K: move patch up, pgdn/J: move patch down, c: commit, q: abort
s-Newer commits are shown above older commits.
s-Older commits are shown above newer commits.
)rBrEr?�
splitlines)rg�helps  r8�	helplines�_chistedit_state.helplines%sn���9�9�Q�<�:�%��D���� � ��D�
� � ��I�I����� � ��I�I����� � r;c
���UR5up#[UR55H2upEXB:�a O*[XSU[R
"[55 M4 UR5 g�Nr)r*rOr]r4�curses�
color_pair�
COLOR_HELPrQ)rgr-r1r2r.r�s      r8�render_help�_chistedit_state.render_help7sT���\�\�^�
�� ����!1�2�G�A��y���#�!�T�6�#4�#4�Z�#@�A�3�	���r;c���URR5up[UR55nX-
S-
nUS:a+[R
"[
S5X4-[
S5S9eSU4X24XB4S.$)Nr�r>s:terminal dimensions %d by %d too small for curses histedits7enlarge your terminal or use --config ui.interface=textr�)�commitr��main)r>r*r6r]r�Abortr)rgr1r2�helplen�mainlens     r8�layout�_chistedit_state.layout?s����[�[�)�)�+�
���d�n�n�&�'���.�2�%���Q�;��+�+��O�P��,���N���
��D�z��_��_�
�	
r;c�^�UR(a[UR5S-
U-
$U$)aConverts a position in display order to rule order.

The `display_pos` is the order from the top in display order, not
considering which items are currently visible on the screen. Thus,
`display_pos=0` is the item at the top (possibly after scrolling to
the top)
r>)r?r6r�)rg�display_poss  r8rL�(_chistedit_state.display_pos_to_rule_posQs+������t�z�z�?�Q�&��4�4��r;c
��UR[SnURVs/sH!o3R(dMURPM# nn[U5S:�aSSSR
[[RU55-n[USSU[R"[55 [U[UR55GH�nXb-
nUS:dXpR:�aMUR!U5nURUn	[U	R5S:�a-UR#USS[R"[55 O"UR#USS[R$5 X`R&:Xa-[(n
[XSU	[R"[*55 OaX`R,:Xa?[.n
[UUSU	[R"[05[R2-5 O[4n
[XSU	5 U	R6S:XdGMWUR#US[U	R85-U	R:[R"U
55 GM� UR=5 gs snf)	Nr=rspotential conflict in %srIr�r�r�r�)rFrDr�rr�r6rCrPr�bytestrr4rarb�
COLOR_WARNr�rCrLr,�COLOR_BLACKr@�COLOR_ROLL_SELECTED�COLOR_SELECTEDr�COLOR_ROLL_CURRENT�
COLOR_CURRENT�A_BOLD�
COLOR_ROLLr�rrrQ)rg�rulesscr�startr�rr�ror.�rule_posr��	rollcolors           r8�render_rules�_chistedit_state.render_rules^s����
�
�:�&�~�6��$(�J�J�>�J�q�+�+�U�Q�U�U�J�	�>��y�>�A��.�����H�$�$�i�0�2��D�
�(�B��4��):�):�:�)F�G� ���D�J�J��8�K��#�A��1�u��-�-�-���3�3�K�@�H��:�:�h�'�D��4�>�>�"�Q�&�����1�d�F�,=�,=�j�,I�J�����1�d�F�,>�,>�?��m�m�+�/�	��h�1�d�F�,=�,=�n�,M�N����(�.�	�������%�%�m�4�v�}�}�D��'�	��h�1�d�+��{�{�g�%�������D�K�K�(�(��I�I��%�%�i�0�	�99�F	�����U?s
�J�Jc	��UR5upE[US-
[U55n[SU5GHnX'nU(a�UR	S5(a.URUSU[R"[55 MSUR	S5(a.URUSU[R"[55 M�UR	S5(a.URUSU[R"[55 M�URUSU5 M�URUSU5 GM UR5 g)Nr>r�+�-s@@ )r*�minr6r�r{r,rarb�COLOR_DIFF_ADD_LINE�COLOR_DIFF_DEL_LINE�COLOR_DIFF_OFFSETrQ)	rgr-�output�
diffcolorsr1r2r3r.r�s	         r8�
render_string�_chistedit_state.render_string�s����\�\�^�
���T�A�X�s�6�{�+���q�&�!�A��9�D���?�?�4�(�(��J�J��1�d�F�$5�$5�6I�$J���_�_�T�*�*��J�J��1�d�F�$5�$5�6I�$J���_�_�V�,�,��J�J�q�!�T�6�+<�+<�=N�+O�P��J�J�q�!�T�*��
�
�1�a��&�!"�"	���r;c��UR[SnUR[SnURXUSSS9 g)Nr=�
patchcontentsT)r�)rFrEr�)rgr-r|�contents    r8�render_patch�_chistedit_state.render_patch�sB���
�
�:�&�~�6���*�*�Z�(�)9�:�����3����D��Ar;c��^�URnT[RS4;a[$TnTbSTs=::aS::aO OSnURupE[
UR
U[
SR
U55nUcgUS;a\[US-[UR5S-
5nURX'5 URcUS:XaURX'5 ggUS	;aF[S
US-
5nURX'5 URcUS:XaURX'5 ggUS:XaURUS
S9 gUS:XaURUSS9 gUS:Xa2URcUOSUlURUR5 gUS:Xa�[!T5[UR5s=:aS::agO Od[#U4SjUR55nURX(R5 URbURX(R5 ggUR%S5(aUR'X&SS5 gUS:Xa"UR)U[*:wa[*OU5 gUS:Xa"UR)U[,:wa[,OU5 gUS:Xa[.$US:Xa[0$US:Xa[2$US:Xa[4$US:Xa[6$US:Xa[8$g)z�Change state based on the current character input

This takes the current state and based on the current character input from
the user we change the state.
s
KEY_RESIZENr��9r�)r�r�r>r�)r�r�rr�r�T)�nextr�Fr�r�r�c3�\># �UH!oR[T5:XdMUv� M# g7fr4)rr�)r�r��chs  �r8r��)_chistedit_state.event.<locals>.<genexpr>�s ����I�j��I�I��R��4H�1�1�j�s�,�	,saction-r�r�r�r�r&r�rrr)rra�
KEY_RESIZE�E_RESIZErB�KEYTABLErr�r6r��move_cursorr@�swapr��cycle_action�make_selectionr�r�r{�
change_action�change_moderE�	MODE_HELP�E_QUIT�
E_HISTEDIT�
E_PAGEDOWN�E_PAGEUP�
E_LINEDOWN�E_LINEUP)	rgr��oldpos�	lookup_ch�curmode�prevmoder��newpos�newrules	 `       r8�event�_chistedit_state.event�s��������
�&�#�#�]�3�3��O��	�
�>�d�b�0�D�0��I� �I�I����'�"�&�&��x�	�*�.�.�y�9�
���>���,�,���!��S����_�q�%8�9�F����V�,��}�}�(�F�l�,B��	�	�&�)�-C�
�*�
*���F�Q�J�'�F����V�,��}�}�(�F�j�,@��	�	�&�)�-A�
�~�
%����f�4��0�
�~�
%����f�5��1�
�y�
 �&*�m�m�&;�F��D�M�����
�
�.�
�w�
�3�r�7�S����_�#B��#B��I�d�j�j�I�I�G����V�[�[�1��}�}�(��	�	�&�+�+�.�)�
�
�
�z�
*�
*����v�a�b�z�2�
�|�
#����7�j�+@�Z�h�O�
�w�
����'�Y�*>�Y�H�M�
�w�
��M�
�{�
"���
�|�
#���
�z�
!��O�
�|�
#���
�z�
!��O�"r;c���URnURURUR5n[R
"URUSSS.SS9nSS0nURRUSS9 URUR5 UR5 SSS5 URURR5R5$!,(df   NC=f)NTsstatus)spatchstemplate)�buffered)r+sverboser&)�source)r\r�rLrr�changesetdisplayerrPr��showr�r��hunkr�r[)rgr\r��	displayerrs     r8�patch_contents�_chistedit_state.patch_contents�s����y�y���z�z�$�6�6�t�x�x�@�A���1�1��G�G���)�4��	
�	�)�$�/�	�
�W�W�
#�
#�I�k�
#�
B��N�N�4�8�8�$��O�O��C��~�~�d�h�h�l�l�n�-�8�8�:�:�C�
B�s�7,C � 
C.c��X lURup4U[:XaLUR[nX%S:aX%S'O,X%SUR-S-
:�aX R-
S-US'SUR[
S'g)z�Change the rule/changeset that the cursor is pointing to, regardless of
current mode (you can switch between patches from the view patch window).
r=r>rN)rrBrDrFrCrE)rgr�r�rBr�	modestates      r8r��_chistedit_state.move_cursor�s������)�)����:���
�
�:�.�I��.�1�1�,2�.�)��N�3�d�6F�6F�F��J�J�,2�5E�5E�,E��,I�	�.�)�23��
�
�:��~�.r;c��URup#X4UlU[:Xa%UR5UR[S'gg)Nr�)rBrEr�rF)rgrBr�rs    r8r��_chistedit_state.change_mode	s@���Y�Y�
���O��	��:��7;�7J�7J�7L�D�J�J�z�"�#3�4�r;c��Xlgr4)r@)rgrs  r8r��_chistedit_state.make_selections���
r;c��URU5nURU5nURnSUs=::a[U5:aO eSUs=::a[U5:de eXTXSsXS'XT'XEUlX5Ul[	X45n[X45n[
XgS-5H-nXTRXX5 XSRXX5 M/ UR(aURU5 gg)zOSwap two positions and calculate necessary conflicts in
O(|newpos-oldpos|) timerr>N)
rLr�r6rr�r�r�r r@r�)	rgr�r��old_rule_pos�new_rule_posr�r|�endr�s	         r8r��_chistedit_state.swaps���3�3�F�;���3�3�F�;���
�
���L�-�3�u�:�-�P�P�!�|�2P�c�%�j�2P�P�P�2P�P�P�
����	1���U�0�#/�l���".�l����L�/���,�-���u�A�g�&�A���.�.�u�x�8���.�.�u�x�8�'��=�=�����'�r;c��URU5nSUs=::a[UR5:de eX RUlg)z?Change the action state on the given position to the new actionrN)rLr6r�r�)rgrr�r}s    r8r��_chistedit_state.change_action-sB���/�/��4���H�.�s�4�:�:��.�.�.�.�.�&,�
�
�8��#r;c�Z�URU5nSUs=::a[UR5:de eURURnU[;de[RU5nU(aUS-
nOUS-nUR
U[U[[5-5 g)zMChanges the action state the next or the previous action from
the action listrr>N)rLr6r�r��KEY_LISTr�r�)rgrr�r}�currentr�s      r8r��_chistedit_state.cycle_action3s����/�/��4���H�.�s�4�:�:��.�.�.�.�.��*�*�X�&�-�-���(�"�"�"����w�'����Q�J�E��Q�J�E�	
���3����X��)>� ?�@r;c��URup4U[:wagURUn[US5nURnUS:XaUOSnSUS-
U--nUS-
U-n	USX--n
[S[
X�55US'g)z�Change the region of whatever is being viewed (a patch or the list of
changesets). 'delta' is an amount (+/- 1) and 'unit' is 'page' or 'line'.
Nr��pager>r=r)rBrErFr6rCr�r�)rg�delta�unitrBr�
mode_state�	num_linesrC�	num_pages�
max_offset�newlines           r8�change_view�_chistedit_state.change_viewEs����)�)����:����Z�Z��%�
��
�#3�4�5�	��&�&��"�g�o�{�1����Q��;�6�6�	��!�m�{�2�
��^�,�u�|�;��%(��C�
�,D�%E�
�>�"r;)	r?rBrFrCrr\r�r@r>N�F)r�r�r�r�rhrXr]rdrlrLrr�r�r�r�r�r�r�r�r�r�r�r�r�r;r8r;r;�sc��
�6/�b!�$�
�$�-�^�,B�
<�|
;�3�(M��(�6-�A�$Fr;r;c��
�[R"5 [R"[[R
[R5 [R"[[R[R
5 [R"[[R[R5 [R"[[R[R5 [R"[[R
[R5 [R"[[RS5 [R"[ [R"S5 [R"[$[RS5 [R"[&[R"S5 [R"[([R[R5 [R"[*[R"[R
5 [R,"S5 Sn[/XU5nSnUR15 UR35 UR4upgU[6:XaUR9[:5 UR=U5nU[>:XagU[@:XaURB$U[D:Xa0[G5n	X�RI5:wa[RJ"U	6 URM5n
UR4up�X�:wa3U
SSUl'URQURRURR5 Sup�U"U
SX�5up�n
U"U
SX�5up�n
U"U
SX�5unp�U[T[V[X[Z4;asU[T:XaUR]S	S
5 OVU[V:XaUR]SS
5 O9U[X:XaUR]S	S5 OU[Z:XaUR]SS5 UR_5 UR_5 UR_5 U[`:XaURcU5 O_U[d:Xa3URgU[hRk5Rm55 O"URoU5 URqU5 URsU5 [Rt"5 [vRx"UR{55nGM�![Ra GN5f=f![Ra GN	f=f)Nr�rc�T�[R"USUSX5nXS-
nX1U4$re)ra�newwin)�sizer.r/r-s    r8�drawvertwin�#_chisteditmain.<locals>.drawvertwinqs1���m�m�D��G�T�!�W�a�3��	�!�W����q�y�r;Frh)rrr�rgr>r�sline)>ra�use_default_colorsr�	init_pairrc�COLOR_WHITE�
COLOR_BLUErvrtrs�COLOR_YELLOW�COLOR_OK�COLOR_GREENrx�
COLOR_MAGENTAr�r��	COLOR_REDr�rzrwru�curs_setr;r��refreshrBrAr�rDr�r�r�r�r�r
r*�
resizetermrlrCr�rr�r�r�r�r��eraserEr�r�r��__doc__r�r[rrXrd�doupdater�
strtolocal�getkey)r\r�r>r�rr��oldmode�unused�er��sizesr�r.r/�helpwin�mainwin�	commitwins                 r8�_chisteditmainr�Vs���
��!�!�#�
���Z��!3�!3�V�5F�5F�G�
���^�V�%7�%7��9K�9K�L�
���Z��!3�!3�V�5H�5H�I�
���X�v�1�1�6�3E�3E�F�
���]�F�$6�$6��8L�8L�M�
���(�&�*<�*<�b�A�
���(�&�*:�*:�B�?�
���&��(<�(<�b�A�
���Z��!1�!1�2�6�
����F�.�.��0D�0D�����(�&�*:�*:�F�<N�<N�O�
�������

�T�&�1�E�
�B�
�L�L�N�
�N�N��
��*�*����i�����j�)��K�K��O����;���
�?��;�;���H�}�"�}���?�?�,�,��%�%�t�,��L�L�N�E�#�j�j�O�G��!�$)�'�N�1�$5��!��!�!�%�)�)�U�Y�Y�7��D�A�'��g���=�M�G��'��g���=�M�G��)�%�	�*:�A�A�O�I�q��Z��:�x�@�@��
�?��%�%�b�'�2��(�]��%�%�b�'�2��*�_��%�%�b�'�2��(�]��%�%�b�'�2�
�O�O���M�M�O��M�M�O��*�$��"�"�7�+��I�%��#�#�G�W�]�]�_�-G�-G�-I�J��"�"�7�+��#�#�I�.����g�&��O�O���$�$�V�]�]�_�5�B�m��G�<�<�
��
��*�<�<�
��
�s#�T5�U�5U
�U
�U(�'U(c	�,�[c[R"[S55eSUlURS5nURS/5SSn[R"U5 [R"U5 URU5 U(d*[R"X5nUbURU5 [U5S:wa[R"[S55e[UR!S["R$"X555n[U5S:wa[R"[S55eUS	R'5n	UR(R+5n
[-XX�5nU(d+[R"[S
5[/U	5-5e/n[1U5H#up�UR[3XU
U55 M% [4R6"5 [R8"[:R<"[>X55nSSS5 WSLaURA[S55 g	[CU5[LavURE[S
55 [GU5nURISS5nUHn
URAU
5 M URJUS'SSS5 [MXX#U5$g!,(df   N�=f!,(df   N.=f![Na gf=f)z�interactively edit changeset history via a curses interface

Provides a ncurses interface to histedit. Press ? in chistedit mode
to see an extensive help. Requires python-curses to be installed.NsPython curses library requiredrm�revr>�/histedit requires exactly one ancestor revision�
roots(%ld)�9The specified revisions must have exactly one common rootr�*%s is not an ancestor of working directoryFshistedit aborted
sperforming changes
s	chisteditsw+�commandsr�)(rarrir�
_colormoderr	�checkunfinished�
bailifchangedrFr�desthisteditrEr6�
InputErrorrIrJr�revranger�r�r(�betweenrrOrr�
with_lc_ctype�wrapper�	functools�partialr�r��typer�r(rz�name�
_texthistedit�KeyboardInterrupt)rPr\r�freeargsr.r]r��
defaultrev�rr�rootr^r�r�r��rcrs                r8�
_chisteditr�s����~��k�k�!�=�>�?�?��B�M�2
��x�x�� ���x�x���#�A�&������%����d�#����H���!�.�.�r�8�J��%����J�'��t�9��>��"�"��D�E��
��$�(�(�=�*�*=�*=�d�*I�J�
K���r�7�a�<��"�"��/���
��!�u�z�z�|���-�-�"�"�$���t�7�1����"�"��?�@�5��;�N��
����d�O�D�A��L�L��b�q�'�1�5�6�$�
�
�
�
!����	� 1� 1�.�$� N�O�B�"�
��;��H�H�Q�,�-�.����8�t���I�I�a�/�0�1� ��$�E����,��.�"��A��H�H�Q�K��$&�G�G��[�!�/�!��5�D�A�A���"�
!��/�.��
�
��
�
�sI�GL�0K$�2'L�A	L�#*K5�
L�$
K2�.L�5
L�?L�
L�Lr;r�s*read history edits from the specified filesFILEr��continues$continue an edit already in progress�	edit-plansedit remaining actions listrms,don't strip old nodes after edit is complete�abortsabort an edit in progress�o�outgoings#changesets not found in destination�forces.force outgoing even for unrelated repositoriesr�sfirst revision to be editedsREVs)[OPTIONS] ([ANCESTOR] | --outgoing [URL]))�helpcategoryc	��[R"U5n[U5nUR5oQR	5nXTlXdlURS5S:Xa2[
U5[:Xa[XXBU5sSSS5 sSSS5 $[XXBU5sSSS5 sSSS5 $!,(df   O=fSSS5 g!,(df   g=f)a<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 (using the later date)

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

- `edit` to edit this changeset (preserving date)

- `base` to checkout changeset and apply further changesets from there

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).
r&scursesN)
r�byteskwargsrXrar`�	interface�_getgoal�goalnewrr	)rPr\rr.rrar`s       r8�histeditr�s���F����%�D��$��E�	
�����	�	��t����
��<�<��$�	�1�h�t�n��6O��b���>�!,�����R�u��=�!,����������s0�C�AB5�	C�B5�"	C�5
C	�?C�
Cc��[XX#U5 gr4)�	_histedit)rPr\rrr.s     r8r	r	�s��
�b���.r;snewc��URS5(a[$URS5(a[$URS5(a[$[$)Nrr�	edit_plan)r�goalcontinue�	goalabort�goaleditplanr)r.s r8rr�sF���x�x�������x�x�������x�x�������Nr;c���US:Xa5URS5 URR5sSSS5 $[R"U5$!,(df   g=f)Nr�r&)�timeblockedsection�finrvr�readfile)rPr8s  r8�	_readfiler)�sF���t�|�
�
"�
"�;�
/��6�6�;�;�=�0�
/��}�}�T�"�"�0�
/�s�A�
A c�j�[USS5nU(a0UR(a[R"[	S55eURS5nURS5n	URS5n
URS5nU(a&U(d[R"[	S55eUS:Xa3[X�XbXY45(a[R"[	S	55egUS:Xa3[X�X%U	45(a[R"[	S
55egUS:Xa2[X�U45(a[R"[	S55egU(aUU(a[R"[	S
55e[U5S:�a[R"[	S55egURU5 [U5S:Xa*[R"X5nUbURU5 [U5S:wa[R"[	S55eg)N�mqssource has mq patches appliedrr!rrs$--force only allowed with --outgoingrs$no arguments allowed with --continues!no arguments allowed with --abortrs1only --commands argument allowed with --edit-plans$no revisions allowed with --outgoingr>s.only one repo argument allowed with --outgoingrr�)
�getattr�appliedrrarrr�anyr6rFrr�rE)
rPr\rr.�goalr�r�r+�outg�editplan�abortr�rs
             r8�
_validateargsr3�s���
��t�T�	"�B�	�b�j�j����q�!A�B�C�C��8�8�K� �D��x�x��%�H��H�H�X��E��H�H�X��E��T����q�!H�I�J�J��{����T�U�=�>�>��"�"�1�%L�#M�N�N�?�	
��	���H�X�6�7�7��"�"�1�%I�#J�K�K�8�	
��	���H�%�&�&��"�"��F�G��
�'�
���&�&��=�>����8�}�q� ��&�&��G�H���!�

�K�K��!��4�y�A�~�%�2�2�2�<�
��)��K�K�
�+��4�y�A�~��&�&��H�I���r;c	��URSU5nUR5 [U5nURS/5nUR	SS5(+nURSS5n	URSS5Ul[
XX4XiU5 Sn
U(an[R"X5nUVs/sHo�UPM	 nnUH>n
U
R5Vs/sHo�S	:wdM
UPM nnU
(aM3[U5n
M@ U
(a=UR[S
5SS9(a[R"[S
55eU[:XaUR!5 [#XU5nO9U[$:Xa
['XX)5 gU[(:Xa[+XX(S9 g[-XX'X45 [/XU5 [1XX%5 UR35 gs snfs snf)Nr&r�r�
backup-bundler�r;rmFstips{warning: tags associated with the given changeset will be lost after histedit.
do you want to continue (yN)? $$ &Yes $$ &Nor>r$shistedit cancelled
��nobackup)�	formatter�	startitemrrrOr]r3rr�tagsr6�promptchoicerr�
CanceledErrorr"rv�bootstrapcontinuer$�_edithisteditplanr#�_aborthistedit�_newhistedit�_continuehistedit�_finishhisteditr�)rPr\rrr.�fmr/r�r7r��hastagsr�rVr��tagr:s                r8rr�s���	���k�4�	(�B��L�L�N��D�>�D��8�8�F�B��D��=�=��-=�>�>�H��H�H�[�#�&�E����'�5�)�E�J��"�H�D��>��G���"�"�4�.��%)�*�T�c�S�	�T��*��C�#&�8�8�:�?�:�C���C�:�D�?��7��d�)����
�?�?�
�@�
�
�
�
��%�%�a�(?�&@�A�A��|��
�
�
��!�"�T�2��	
��	��"�E�1��	
��	��r��:��	�R�u�H�;��b��&��B�e�(��F�F�H��?+��?s�1G�	G�%Gc�f�URSSn[[X3SSS/-55HMunupVURS:XdMU(dM#URS:XdM5[URUlMO UR
5 SnURSS5(aURS5nUR[S5[S5[UR5S9nU [R"U5 UR(a�UR
US	9 URS
n	URU	R5S9 UR!SU	RU	R54-5 U	R#5up�U
R%5UlUR(R+U5 URR-S
5 UR(aM�SSS5 SSS5 UR
5 g!,(df   N'=f!,(df   N0=f)
zwThis function runs after either:
- bootstrapcontinue (if the goal is 'continue')
- _newhistedit (if the goal is 'new')
Nr>r�r&r*seditingschanges)r��total)r�r)�itemshistedit: processing %s %s
)rIrO�zipr�r�rsr�rO�transaction�makeprogressrr6r�acceptintervention�	incrementr�rqr�r�r_rfrF�pop)rPr\rrI�idxr��nextactr��progress�actobjr��replacement_s            r8rArAs����m�m�A��G�"+�C������v�9M�,N�"O���
�f��;�;�'�!�g�g�'�,�,�'�2I�+5�E�M�M�#��(�#P�
�K�K�M�	
�B�
�}�}�[�"6�7�7��
�
�k�
*�����	�*�
�A�j�M��U�]�]�1C���H�
�4�*�*�2�.��m�m��K�K�2�K���]�]�1�%�F����F�M�M�O��4��H�H�/�6�;�;��
�
��2P�P�
�'-�j�j�l�#�I�"+�.�.�"2�E�����%�%�l�3��M�M���a� ��m�m�m�/��
�K�K�M�/�.����s%�.H"�C)H�0H"�
H	�H"�"
H0c��^�[R"XR5 [U5upEpgU(a�UR	5H�up�U	(dURS[
U5-5 M+URS[
U5[
U	S54-5 [U	5S:�dMgSn
U	SSH nURU
[
U5-5 M" M� UR(dU(a[XRU5 O0nUHnX�;dM
SXK'M UR5RRRmUR	5VV
s0sH2up�T"U5(dM[U4SjU
55(dM0X�_M4 nnn
[ R""XS	5 UR$nUR&nUR(nU"UR	5VVVs0sH*unnU"U5U"UVs/sH
o�"U5PM snS
S9_M, snnnSS
S9nUR+US9 UR-5 [.R0R3UR5S55(a%[.R6"UR5S55 UR8R3S5(aUR8R7S5 ggs sn
nfs snfs snnnf)z7This action runs when histedit is finishing its sessionshistedit: %s is dropped
shistedit: %s is replaced by %s
rr>s'histedit:                            %sNr�c3�4># �UH
nT"U5v� M g7fr4r��r�r��has_nodes  �r8r��"_finishhistedit.<locals>.<genexpr>Ss����6�A�q�x��{�{�A�s�r&snode)rsoldnodesnewnodes)r=�value)�nodechangessundo�histedit-last-edit.txt)r*r�r_�processreplacement�itemsrqrr6r]�movetopmostbookmarksr^�
unfiltered�	changelogr�rWr&r�cleanupnodes�hexfunc�
formatlist�
formatdictrur��osr8rq�sjoinr�rz)rPr\rrC�mapping�tmpnodes�created�ntm�prec�succs�mr��kr7�hf�fl�fd�oldn�newnrZrWs                    @r8rBrB0s_����O�O�D�,�,�-�.�&8��&?�#�G�w��"�=�=�?�K�D�����5��d��C�D����7��T�{�E�%��(�O�4�5���u�:��>�B�A�"�1�2�Y������U�1�X��.�'�+��:�:�� ��}�}�c�:����
���9��G�J��
��� �*�*�0�0�9�9�H��M�M�O��#�D�A��A�;�	
��6�A�6�6�	
���#���
�����4�	���B�	���B�	���B��&�m�m�o�	
�-�
��d�
�t�H�b��.��A�"�Q�%��.�W�=�=�-�	
�
��
�K��G�G��G�$�	�K�K�M�	�w�w�~�~�d�j�j��)�*�*�
�	�	�$�*�*�W�%�&��x�x���0�1�1������1�2�2��-��/��	
s*�%K �<K �K �2K+�K&�
K+�&K+c	���UR5 [U5upEpdURS[UR5-5 URU;a�UR
(a�URRUR
5n[R"X5n[R"XU5n	URS5n
[R"UU	U
SSU-S9 SSS5 [R "U5 UR#5R%SUR&XV-5(a [R("XRSSS9 [+XXcS	9 [+XXSS	9 UR55 g!,(df   N�=f![,a1 UR/5(aUR1[3S
55 ef=f!UR55 f=f)Nsrestore wc to old parent %s
shistedit.abortr&sbundle:)r��urlsparents() and (%n  or %ln::)T)�
show_statsr�r6srwarning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
)rvr\rqrr^rbrzrCr�openpathr�
readbundlerJr�applybundlererr_r�r_�clean�cleanupnode�	Exceptionr�rrr�)rPr\rr7�__�leafsrhrbr��genr�s           r8r?r?js���)�
�
�
��"4�U�";���8�
���1�E�%�-�-�4H�H�I��}�}��$��)9�)9������u�'7�'7�8�J����B�+�A��%�%�b�Z�8�C��!�!�"3�4���#�#����&�"�Z�/��5�
�I�I�j�!��?�?��!�!�+������
�
�

�H�H�T�=�=�T�d�K��B�h�:��B�e�7�	���
�?5�4��(�	�������G�G��$��
�	�	��	���
�s1�C	F�E=�'BF�=
F�F�;G	�	G�Gc	��[U5nURSS5(+nUR5oAR5nXBlXRl[	XX#S9 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nrr5r6)rXrOrar`r?)rPr\rr7rar`s      r8�hgaborthisteditr��sZ���$��E��=�=��-=�>�>�H�	
�����	�	��t����
��r��:�!,��������s#�A<�A+�A<�+
A9	�5A<�<
B
c��UR5 U(dK[U[UR5[UR55n[XURU5nO[X5n[X25nURVs/sH#ofR(dMXRPM% nn[XXRU5 XRlUR5 gs snfr4)rvrVrr_r^�
ruleeditorrIr)rtr��warnverifyactionsr�)rPr\rr��commentrI�actrVs        r8r>r>�s���	�J�J�L�� ���e�)�)�*�E�%�-�-�,@�
���4�U�]�]�G�<���"�$����&�G�&+�m�m�@�m�s�x�x�N�D���N�m�D�@��b���5��M�	�K�K�M��As�C�Cc�*�URS5nURSS5nURS5n[R"U5 [R"U5 URR5n	U(aU(aUSn
OSn
[
XX�U5nOp[URS[R"X555n[U5S:wa[R"[S55eUSR5n[!XX�R"5nU(d+[R"[S	5[%U5-5eUV
s/sHo�U
PM	 nn
USnUS
/nUSR5/U-Hn[&R("UUUUSSSSS9 M! U(dH[/U[%U5[%U	55nUV
s/sHn
[1X-5PM nn
[3XUU5nO[5X5n[7Xr5n[9XUX.5 XR5R5nUUlUUlX�l/Ul URCSS[U5[U5S9 Sn[DRF"U[DRH5(d[JRL"UU/U	/US5nUUl'gs sn
f![R*a# [R,"[S
5U-5ef=fs sn
f)Nrr�r;rrr�r>r�r�rF)�branchmerger��acceptremote�followcopiess>untracked files in working directory conflict with files in %sr&s%d actions to histedit
)�histedit_num_actions)(rr	r�r�r�r(r�rIrJrrr6rrrr�rr]rr*�calculateupdatesrirarVror�r)rtr�r_rIr^rf�logr�	isenabled�createmarkersoptr�backupbundlerb)rPr\rr�rr.r0r�r�r^r�rr
r�rV�wctx�ancsrWr�rIr_rbs                      r8r@r@�s����8�8�K� �D��H�H�[�#�&�E��H�H�X��E����D�!����$���m�m��� �G����a�[�F��F��B�f�T�:��
�$�(�(�=�*�*=�*=�d�*I�J�
K���r�7�a�<��"�"��/���
��!�u�z�z�|���4�w�
�
�3�D�����
�;�<�u�T�{�J�
�	
�"�"�T���G�T�D�"���:�D�
��J�<�D�
�1�g�j�j�l�^�d�
"��	��%�%�����"��"�"�
�#�,� ��U�4�[�%��.�A��+/�0�4�a�4��>�4��0��4�W�g�6���"�$����&�G��b���5��J�M�M�O�(�(�*�M�'�E���E�M��M��E���F�F��#��G�� ��\�	���J����d�H�$=�$=�>�>��(�(��=�/�G�9�d�K�
�
�"�E���}#��2�{�{�	��"�"��U�����
�	��1s�K�K�L�7L
c�J�[R"UR55$r4)r r�r
)r�s r8�_getsummaryr�	s�������� 1�2�2r;c���URn[RRU5n[R
"U5 UR(a�URRS5n[U5(a*UR5 [U5(a
[5 UR5upgUR5Ul
URRU5 U$r`)r\�
mergestatemodrrvr�checkunresolvedrIrNr_r�rbr�r�r_rfrF)rPrr.r\�msrRr�rfs        r8r=r=	s����:�:�D�	�	!�	!�	&�	&�t�	,�B�
���b�!��}�}����"�"�1�%���d���� � �"��$�����"(�"6�"6�"8��	�'�n�n�.���
���!�!�,�/��Lr;c��URS05nUR5 [U5nUR5oAR	5nXClXSlUR5 [
XS5n[XU5 [XX25 UR5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nr)
r8r9rXrar`rvr=rArBr�)rPr\rCrrar`s      r8�hgcontinuehisteditr�+	s���	���k�2�	&�B��L�L�N��$��E�	
�����	�	��t����
�
�
�
��!�"�T�2���"�E�*���%�,�
����!,��������s$�C�AB0�C�0
B>	�:C�
Cc�2�URSX5nU(aTU(dM[R"XS5 URSU5(a[R"[S55e[R"URRU5$)zkselect and validate the set of revision to edit

When keep is false, the specified set can't have children.s%n::%nrws(%ld) and merge()s(cannot edit history that contains merges)
r�r�precheckrrarr�maplistr`r�)r\�oldrYr]r�s     r8rr:	sv���9�9�Y��)�D��D����T��1��9�9�)�4�0�0��"�"��=�>��
����D�N�N�/�/��6�6r;c�>�URRSS5(GaR[R"5nUGHnXRn[U5nUR
SS5SR5nSn	URS5(a�USS	nU[[-[-;a�X�lU[U5S-SR5n
[[!UR#555H8up�XRn
[U
5nX�:XdM%S
n	UR%U5  O U	(aGM/XE'GM	 /nUR#5Hup�UR%U5 X,-
nM SR'UVs/sHoUR)5PM sn5nUS-
nX�-
nUR+UUR-5S
S0UR.SS9nUR1SS5nUR3U5 SSS5 U$s snf!,(df   U$=f)z]open an editor to edit rules

rules are in the format [ [act, ctx], ...] like in state.rules
r"r#r�r>rF�!Nr�Tr1s

sprefixr&)�repopathr�r[swb)rPrOr�sortdictr�r�rA�lower�endswithrLrMrNr�r6�lstrip�reversedrIr]rErCr�rE�usernamer8rzr�)r\rPrI�editcomment�newactr�r�r��fword�added�tsum�narU�actx�asumr�r�s                 r8r�r�H	s���
�w�w���/�+?�@�@�������C��x�x�.�C�!�#�&�G��M�M�$��*�1�-�3�3�5�E��E��~�~�d�#�#��c�r�
���N�-=�=��O�O�$�H�"�3�u�:��>�#3�4�;�;�=�D�"*�$�v�|�|�~�*>�!?���#�G�G�}��*�4�0���<�$(�E��H�H�S�M�!�
"@��5� ���1�6���\�\�^�E�B��N�N�2���L�G�$�
�J�J��8���
�
���8�9�E�	�W��E�	��E��G�G�
�
���
�	�K� �����
�
�E�
���+�U�	3�q�	�����
4��L��#9�
4�	3��L�s�H�,H
�
Hc���SUR55Vs/sH&nU(dMURS5(aM$UPM( nn/nUH�nSU;a"[R"[	S5U-5eURSS5upVU[;a"[R"[	S5U-5e[URX5nURU5 M� U$s snf)z@Read the histedit rules string and return list of action objectsc3�@# �UHoR5v� M g7fr4)r�r�s  r8r��parserules.<locals>.<genexpr>�	s���8�%7��'�'�)�)�%7�s��#r�smalformed line "%s"r>sunknown action "%s")	r[r{rr�rrAr?r�rE)r�rrUrIr�r�r�r�s        r8rtrt�	s���9�U�%5�%5�%7�8�
�8�A��	
��\�\�$�'�	
�8�
�
�
�G�
���q�=��"�"�1�%;�#<�q�#@�A�A��W�W�T�1�%�
���{�"��"�"�1�%;�#<�t�#C�D�D��T�"�+�+�E�8�����v����N��!
s�C'�C'�C'c���[X#U5 g![Ra< URR	S5(aUR[
S55 ef=f)Nr[s=warning: histedit rules saved to: .hg/histedit-last-edit.txt
)�
verifyactionsrr�rzrqrr)rPr\rIrrVs     r8r�r��	sX��
��g�d�+�������8�8�?�?�4�5�5��G�G��8��
�	��s
��AAc�B�UVs1sHo3R5iM nn[5nSnU(aBUSRS;a/[R"[S5USR-5eUHAnUR
XdU5 UnURcM&URUR5 MC [XE-
5nURRRSS5(aV[U5S:Xa'[R"[S5[S5S	9eUV	s/sHn	[X5PM n
n	X�SS&gU(aE[R"[S
5[US5-[S5[US5-S	9egs snfs sn	f)z�Verify 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.
Nr)r�r�s$first changeset cannot use verb "%s"r&r'sno rules provideds%use strip extension to remove commitsr�smissing rules for changeset %ss@use "drop %s" to discard, see also: 'hg help -e histedit.config')r�rJr�rr�rr�rfrDr\rPrOr6r�r)rIrrVrWr�r�r�r�r\r��dropss           r8r�r��	sx��#'�'�$�Q����$�H�'��5�D��D��7�1�:�?�?�&8�8����
�5�6������H�
�	
����
�
�d�d�+����;�;�"��H�H�V�[�[�!�	�
�X�_�%�G��z�z�}�}����^�<�<��w�<�1���"�"��&�'��?�@��
�
*1�1��A��e����1�����	����
�/�0�5����3D�D��0���G�A�J��	 �
�	
�
��7(��.2s�F�.Fc���[R"U[R5(dU$UR5nURR
RnURn[U5nUVs/sHofSPM	 nn[5R"U6n[U5n	U	(a�U	R5n
U"U
5SLnURRU
S5nU(aU(dURU
S45 UHLn
U
SnURX�45 UH,nX�;dM
URU5 U	RU5 M. MN U	(aM�U$s snf)z�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 markersr>Nr�)rr�r�r_r`r��get_rev�obsstorerIrJ�unionrN�
successorsrrErf)r\�oldreplacements�unfir�r��newreplacementsr��oldsuccs�	seensuccs�succstocheckr�r\�markers�marker�nsuccs�nsuccs                r8�adjustreplacementsfrommarkersr��	s:�����d�H�$=�$=�>�>����?�?��D��n�n�"�"�*�*�G��}�}�H��?�+�O�-�.�o��!��o�H�.�����	��I��	�?�L�
�������!�*��$���%�%�)�)�!�R�0���7��"�"�A�r�7�+��F��A�Y�F��"�"�A�;�/����)��M�M�%�(� �'�'��.� ���,����+/s�8E%c�8�[URUR5n[5n[5n0nUHZnUR	US5 URUS5 UR
US[55R	US5 M\ X#-
nX#-n[U5n0n	U(ay[U5Han
XJn[U5H6nX�;a MX�;dMURU5 UR	X�5 M8 X�U
'URU
5 Mc U(aMyUHn
X�	M URRRRnU	R5Hup�[X�S9X�'M U(a+[X`RRRS9SnO`U	(dSnOVURRRnUR[U	US9SR5R!5nX�UU4$)z�process 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 histeditr>rr<r�N)r�r\rfrJr�rf�
setdefaultrIrr`r�r�r]rDr�r(r�)rrf�allsuccs�replaced�fullmapping�reprYrh�	toproceed�finalr/rl�sr�r�rk�
newtopmostr�s                  r8r\r\�	s���1����U�=O�=O�P�L��u�H��u�H��K�������A������S��V�����s�1�v�s�u�-�4�4�S��V�<���
�C��"�H��K� �I��E�
��i��A��N�E��%�[���>���Z��L�L��O��L�L���*�!�!�a��� � ��#�!��)� ���H���j�j�"�"�(�(�0�0�G��{�{�}����U�0���%���C�Z�Z�%9�%9�%=�%=�>�r�B�
�
��
�
�J�J� � �$�$���Z�Z��u�!� 4�Q� 7�8�;�;�=�B�B�D�
��C��+�+r;c�t�U(aU(dgURU5nU(aoUR5 URS5nURn/nUHnUR	Xr45 M URXU5 SSS5 SSS5 gg!,(df   N=f!,(df   g=f)z�Move bookmark from oldtopmost to newly created topmost

This is arguably a feature and we may only want that for the active
bookmark. But the behavior is kept compatible with the old version for now.
Nr&)rNr`rJ�
_bookmarksrEr�)r\�
oldtopmostr��	oldbmarksr��marks�changesrs        r8r^r^7
s����Z���"�"�:�.�I��
�Y�Y�[�$�*�*�;�7�2��O�O�E��G�!������1�2�"����t��1�8�[�[��7�7��[�[�s#�B)�
<B�B)�
B&	�"B)�)
B7c�^�UR5 UR5nURRRm[U4SjU55nUR
SU5Vs/sHoDR5PM nnU(aU(+n[R"XXVS9 SSS5 gs snf!,(df   g=f)z`strip a group of nodes from the repository

The set of node to strip may contains unknown nodes.c3�F># �UHnT"U5(dMUv� M g7fr4r�rVs  �r8r��cleanupnode.<locals>.<genexpr>U
s����7�%�Q�8�A�;�q�q�%�s�!�	!r�)�backupN)
r`r_r`r�rWrDrJr�rr�)rPr\�nodesr7rWr�r�rWs       @r8r{r{I
s����
������� ���>�>�'�'�0�0���7�%�7�7��#'�8�8�M�5�#A�B�#A�a����#A��B��!�\�F��L�L��5�8�
���C�
��s�AB8�,B3�%B8�3B8�8
Cc��[U[5(aU/n[U5nUR5(a�UR	5 UR
Vs1sH!owR(dMURiM# nnU[U5-n	U	(a8[R"[S5SRSU	55-5eU"XU/UQ70UD6$s snf)Ns$histedit in progress, can't strip %sr2c3�8# �UHn[U5v� M g7fr4)r)r�r/s  r8r��stripwrapper.<locals>.<genexpr>i
s���<�|�!�U�1�X�X�|�r�)�
isinstancer+rXr�rvrIr�rJrrirrC)
�origrPr\�nodelist�argsrrr��histedit_nodes�common_nodess
          r8�stripwrapperr�\
s����(�E�"�"��:���$��E������
�
�
��&+�m�m�
�&3�F�{�{�K�F�K�K�m�	�
�&��H�
�5����+�+��9�:��*�*�<�|�<�<�=��
���(�4�T�4�V�4�4��
s�C�/Cr�c�"�[U5nUR5(dgUR5 UR(aMUR	[S5UR
[S5S5[UR5--5 gg)Ns!hist:   %s (histedit --continue)
s%d remainingshistedit.remaining)rXr�rvrIr�r�labelr6)rPr\rs   r8�summaryhookr�q
sr���$��E�������	�J�J�L��}�}�
���
�3�4�����?�+�-B�C��e�m�m�$�%�
�	
�r;c	��[RRS[5 [R
"SSSS[[S9 g)Nr&r[T)�fname�allowcommit�continueflag�	abortfunc�continuefunc)r	�summaryhooksrfr�rc�
addunfinishedr�r�)rPs r8�extsetupr��
s8�������[�+�6��������!�'�
r;r�)FF)NFNr4)r;)�r��
__future__rrr�ImportErrorr�rrer}r�mercurial.i18nr�mercurial.noderrr�	mercurialrr	r
rrr
rrrrrrrr*rr�rrrrrrrrrcr�mercurial.utilsrr r!�cmdtable�command�configtable�
configitem�
testedwithr?rJrLrMrNrgrVrXr�rr�rZr_rbr�rorEr�rXr�r�r�r@r�rar�rrcrvr�rsrxr�r�r�rzrwrur�r�r�r�r�r�r�rArErDr�r�r
rr(r4r7r9r;r�r�
formatteropts�CATEGORY_CHANGE_MANAGEMENTrr	r"r#r$rrr)r3rrArBr?r�r>r@r�r=r�rr�rtr�r�r�r\r^r{r��wrapfunctionr�r�r�r;r8�<module>rs���x�t#����
��	�
�
����
�������2����
�
�
�H�
%����
�
!�
!�+�
.�
�
�����
�����
�����
�����
�����
�	����
�;�+�5N�O���'��T��#�
�������5���%���%��0E�fH7�H7�VF1�F1�R�.�8I�X*���.��$���=�)�D�9��>��:����d�O��=�>�
��
M�>�M��
M�"��$���K�L�M�I%�>�I%�N�I%�X��d�O��C�D���>��	��.��O��	�	��
����
��
��d�O��B�C���T��	����$���8�9�:�1�>�1�;�1���d�O��<�=�
��
M�n�M��
M�
!�8��B��
�
��
�
CP�?�
�N�H�j�-�>E�;��(�*;�6?�3�
�� 3����
�7D�4�
�H�h�
�H�/9�,�	�:�z�9���$��#������
����n���n��	
�n��	
�n�	�
	
�n��	
�n�
�	
�i��	
�g��	
�e��	�W��	�5��	
�l��	
�j��	�l��	�j�� 	
�g�!�$��"� ���!����
��r�S*��ZM�<�<�~�
� $�!�{F�{F�|\6�~?�D	��
���
�;�<�
�g�J�	
�
�{�E�1�%L�#M�N�	�l�E�1�%C�#D�E����
�=�>�		
�

�h��q�!=�>�?�	
�{�E�1�%K�#L�M����
�?�@�		
�
�v�r�1�;�<�a��i�H�1�4���5�6�2�3��3�3�=�@n>�A�@n>�b/����	���
���#�-�`-
�`)�X73�t*�Z;�
� ^"�B3��,�7�8�v�*�*
�Z#�L;,�|2�$9�&5�$������6�

� 	��uM���E��G���V��
�F��s#�O�!O$�
O!� O!�$O0�/O0

Youez - 2016 - github.com/yon3zu
LinuXploit