ó
    6°hüX ã                  óæ  • S r SSKJr   SSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKJr  SSKJrJrJr  SSKJrJrJrJrJrJrJrJrJrJrJrJrJrJ r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r*J+r+  SSK,J-r-J.r.J/r/  0 r0\%Rb                  " \05      r10 r2\%Rf                  " \25      r3\3" SS	S
S9  \3" SSSS9  \3" SSS
S9  \3" SSSS9  \3" SSS
S9  \3" SSSS9  \3" SSSS9  \3" SSS
SS9  Sr40 r5\6" 5       r7\6" 5       r8\6" 5       r9\6" 5       r:S r; " S S5      r< " S S5      r=S r>S  r?SºS! jr@S" rAS# rBS»S$ jrC\C" S%S&/\" S'5      SS(9 " S) S*\=5      5       rD\C" S+S,/\" S-5      SS(9 " S. S/\=5      5       rE\C" S0S1/\" S25      5       " S3 S4\=5      5       rF\C" S5S6/\" S75      5       " S8 S9\=5      5       rG\C" S:/\" S;5      SS<9 " S= S>\F5      5       rH\C" S?S@/\" SA5      5       " SB SC\F5      5       rI\C" SDSE/\" SF5      5       " SG SH\=5      5       rJ\C" SISJ/\" SK5      SS(9 " SL SM\=5      5       rKS¼SN jrL SSKMrM/ SOQrNSPSQSR.rOSSu  rPrQrRrSrTSTu  rUrVrWSUu  rXrYrZSVu  r[r\SWu  r]r^r_r`raSXu  rbrcrdreSYSZSZS[S[S\SSS]S^S_.	\d0 SES`_S,Sa_S1Sb_SJSc_S&Sd_S@Se_SfSg_ShSi_SjSk_SlSi_SmSk_SnSo_SpSq_SrSo_SsSq_StSu_\cSvSvSwSxSySxSySiSkSz.	\e0 0rfS{ rg " S| S}5      rhS~ riS½S jrjS€ rkS� rl " S‚ Sƒ5      rmS„ rnS… ro\1" SS†S‡S†\" Sˆ5      \" S‰5      4SŠS‹S
\" SŒ5      4S†S�S
\" SŽ5      4SjS�S
\" S�5      4S†S‘S
\" S’5      4S“S”S
\" S•5      4S1S–S
\" S—5      4S@S˜/ \" S™5      \" Sš5      4/\Rà                  -   \" S›5      \1Râ                  Sœ9S� 5       rrSž rsS‹rtS‘ruS�rvSŸrwS  rxS¡ ryS¢ rzS£ r{S¤ r|S¥ r}SºS¦ jr~S§ rS¨ r€S© r�Sª r‚S« rƒS¬ r„S­ r…S¾S® jr†S¯ r‡S° rˆS± r‰S² rŠS³ r‹S´ rŒSºSµ jr�S¶ rŽ\GR                  " \&S·\Ž5        S¸ r�S¹ r‘g! \ a    SrSr GNÎf = f! \ a    SrM GNÊ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ó   uis   interface.histeditó   summary-templates   {rev} {desc|firstline}ó   later-commits-firstT)r%   Úexperimentals   ships-with-hg-corec                ó¶  ^	• [        S5      n/ m	U	4S jn[        [        5      [        [        5      -   [        [        5      -    H  nU" U5        M     T	R                  S5        / nU R                  SS5      (       a  UR                  S5        X1U4-  R                  S5      T	-   U-   nSR                  U Vs/ s H  oˆ(       a  SU-  OS	PM     sn5      $ s  snf )
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                ó<  >• [         U    nUR                  R                  S5      n[        UR                  5      (       a$  SR                  [        UR                  S S95      n TR                  SXS   4-  5        TR                  S/[        U5      S-
  -  5        g )	Nó   
ó   , c                ó   • [        U 5      $ ©N©Úlen)Úvs    Ú0/usr/lib/python3/dist-packages/hgext/histedit.pyÚ<lambda>Ú1geteditcomment.<locals>.addverb.<locals>.<lambda>H  s   € ¼¸Q¼ó    ©Úkeys    %s = %sr   s     %sé   )	ÚactiontableÚmessageÚsplitr6   ÚverbsÚjoinÚsortedÚappendÚextend)r7   ÚaÚlinesÚactionss      €r8   ÚaddverbÚgeteditcomment.<locals>.addverbD  sw   ø€ Ü˜‰NˆØ—	‘	—‘ Ó&ˆÜˆq�w‰w�<‰<Ø—
‘
œ6 !§'¡'Ñ/?Ñ@ÓAˆAØ�‰�{ a¨q© ]Ñ2Ô3Ø�‰˜�y¤C¨£J°¡NÑ3Õ4r;   r;   r&   r'   sK   Deleting a changeset from the list will DISCARD it from the edited history!r1   s   # %s
s   #
)	r   rD   ÚprimaryactionsÚsecondaryactionsÚtertiaryactionsrE   Ú
configboolrA   rC   )
ÚuiÚfirstÚlastÚintrorJ   r7   ÚhintsrH   ÚlrI   s
            @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   Â8Cc                  óH   • \ rS rSrS rS rS rSS jrS rS r	S	 r
S
 rSrg)Úhisteditstatei`  c                ó¸   • Xl         S U l        S U l        S U l        S U l        S U l        S U l        S U l        [        R                  " US5      U l
        / U l        g ©Nó   histedit-state)ÚreporI   ÚkeepÚtopmostÚparentctxnodeÚlockÚwlockÚ
backupfileÚstatemodÚcmdstateÚstateobjÚreplacements)Úselfr\   s     r8   Ú__init__Úhisteditstate.__init__a  sV   € ØŒ	ØˆŒØˆŒ	ØˆŒØ!ˆÔØˆŒ	ØˆŒ
ØˆŒÜ ×)Ò)¨$Ð0AÓBˆŒØˆÕr;   c                óD  • U R                   R                  5       (       d*  [        R                  " U R                  [        S5      5        U R                  5       nUS   U l        [        US   U 5      nX l	        US   U l
        US   U l        US   U l        US   U l        g)	z;Load histedit state from disk and set fields appropriately.r&   ó   parentctxnodeó   rulesó   keepó   topmostó   replacementsó
   backupfileN)re   Úexistsr	   Úwrongtooltocontinuer\   r   Ú_readr_   Ú
parserulesrI   r]   r^   rf   rb   )rg   ÚdatarI   s      r8   ÚreadÚhisteditstate.readm  s‹   € à�}‰}×#Ñ#×%Ñ%Ü×'Ò'¨¯	©	´1°[³>ÔBà�z‰z‹|ˆà!Ð"2Ñ3ˆÔÜ˜T (™^¨TÓ2ˆØŒØ˜‘MˆŒ	Ø˜JÑ'ˆŒØ  Ñ1ˆÔØ˜}Ñ-ˆ�r;   c           	     óT  • U R                   R                  R                  S5      nUR                  S5      (       a  U R	                  5       nUu  p4pVpxO[
        R                  " U5      nUu  p4pVnS nSR                  U V	V
s/ s H  u  pšSXš4-  PM     sn
n	5      nUUUUUUS.$ s  sn
n	f )Nr[   ó   v1
r1   s   %s %s)rk   rl   rm   rn   ro   rp   )r\   Úvfsrv   Ú
startswithÚ_loadÚpickleÚloadsrC   )rg   Úfpru   r_   Úrulesr]   r^   rf   rb   ÚverbÚrests              r8   rs   Úhisteditstate._read|  s¬   € Ø�Y‰Y�]‰]×ÑÐ 1Ó2ˆØ�=‰=˜×!Ñ!Ø—:‘:“<ˆDØLPÑIˆM $°¸zä—<’< Ó#ˆDØ@DÑ=ˆM $°ØˆJØ—
‘
ÉÔNÊ¹¸˜H¨ |Ô3ÉÒNÓOˆð ,ØØØØ)Ø%ñ
ð 	
ùó Os   ÂB$
Nc                óÚ   • U(       a  UR                  SSU R                  SS9  g U R                  R                  SS5       nU R                  U5        S S S 5        g ! , (       d  f       g = f)Nr[   )r[   s   plain)Úlocationó   w)ÚaddfilegeneratorÚ_writer\   rz   )rg   ÚtrÚfs      r8   ÚwriteÚhisteditstate.write�  sV   € ÞØ×ÑØ!Ø$Ø—‘Ø!ð	  ò ð —‘—‘Ð0°$Ô7¸1Ø—‘˜A”÷ 8×7Ö7ús   ÁAÁ
A*c           
     ó  • UR                  S5        UR                  S[        U R                  5      -  5        UR                  S[        U R                  5      -  5        UR                  SU R                  (       a  SOS-  5        UR                  S[        U R                  5      -  5        U R                   H%  nUR                  SUR                  5       -  5        M'     UR                  S[        U R                  5      -  5        U R                   H>  nUR                  S[        US   5      SR                  S	 US
    5       5      4-  5        M@     U R                  nU(       d  SnUR                  SU-  5        g )Nry   s   %s
ó   Trues   Falses   %d
s   %s%s
r   r;   c              3  ó8   #   • U  H  n[        U5      v •  M     g 7fr4   )r   ©Ú.0Úrs     r8   Ú	<genexpr>Ú'histeditstate._write.<locals>.<genexpr>ª  s   é € Ð<ª^¨œS ŸV˜Vª^ùó   ‚r>   )r‹   r   r_   r^   r]   r6   rI   Útostaterf   rC   rb   )rg   r   ÚactionÚreplacementrb   s        r8   rˆ   Ú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           
     óâ  • U R                   R                  SS5      nUR                  5        Vs/ s H  o"S S PM	     nnSnX4     US-  n[        X4   5      nUS-  n[        X4   5      nUS-  nX4   S:H  nUS-  n/ n[	        X4   5      n	US-  n[        U	5       H'  n
X4   nUS-  nX4   nUS-  nUR                  X¼45        M)     / n[	        X4   5      nUS-  n[        U5       Ha  n
X4   n[        US S 5      n[        S[        U5      S5       V
s/ s H  n
[        XúU
S-    5      PM     nn
UR                  UU45        US-  nMc     X4   nUS-  nUR                  5         XXXvUU4$ s  snf s  sn
f )Nr[   ó   réÿÿÿÿr   r>   rŽ   é(   )	r\   rz   Ú	readlinesr   ÚintÚrangerE   r6   Úclose)rg   r   rU   rH   Úindexr_   r^   r]   r€   ÚrulelenÚiÚ
ruleactionÚrulerf   Úreplacementlenr˜   ÚoriginalÚsuccrb   s                      r8   r|   Ú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ùòBs   ¯E'ÄE,c                óz   • U R                  5       (       a&  U R                  R                  R                  S5        g g rZ   )Ú
inprogressr\   rz   Úunlink©rg   s    r8   ÚclearÚhisteditstate.clearã  s+   € Ø�?‰?×ÑØ�I‰I�M‰M× Ñ Ð!2Õ3ð r;   c                óL   • U R                   R                  R                  S5      $ rZ   )r\   rz   rq   r®   s    r8   r¬   Úhisteditstate.inprogressç  s   € Ø�y‰y�}‰}×#Ñ#Ð$5Ó6Ð6r;   )
rI   rb   r]   r`   r_   rf   r\   re   r^   ra   r4   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rh   rv   rs   r‹   rˆ   r|   r¯   r¬   Ú__static_attributes__© r;   r8   rX   rX   `  s,   † ò
ò.ò
ô(
ò'ò,/Mòb4õ7r;   rX   c                  ó`   • \ rS rSrS r\S 5       rS rS rS r	S r
S rS	 rS
 rS rS rSrg)Úhisteditactionië  c                ó>   • Xl         UR                  U l        X l        g r4   )r   r\   Únode)rg   r   r¼   s      r8   rh   Úhisteditaction.__init__ì  s   € ØŒ
Ø—J‘JˆŒ	Ø�	r;   c                ó’  • UR                  5       R                  SS5      S   n [        U5      nU " X5      $ ! [        R                   az     [
        R                  " UR                  U5      nUR                  5       n[        U5      n N[! [        R                   a#    [        R                  " [        S5      U-  5      ef = ff = f)zCParses the given rule, returning an instance of the histeditaction.ó    r>   r   s   invalid changeset %s)ÚstriprA   r   ÚbinasciiÚErrorr   Ú	revsingler\   r   r   ÚRepoLookupErrorÚ
ParseErrorr   )Úclsr   r¦   Ú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ÃCc                ó  • U R                   n[        U R                  5      n[        R                  " XE5      U l        U R                  c%  [
        R                  " [        S5      USS -  5      eU R                  XU5        g)z)Verifies semantic correctness of the ruleNs   unknown changeset %s listedé   )	r\   r   r¼   r   Úresolvehexnodeidprefixr   rÅ   r   Ú_verifynodeconstraints)rg   ÚprevÚexpectedÚseenr\   Úhas         r8   ÚverifyÚhisteditaction.verify  sf   € à�y‰yˆÜ�—‘‹^ˆÜ×2Ò2°4Ó<ˆŒ	Ø�9‰9ÑÜ×"Ò"¤1Ð%CÓ#DÀrÈ#È2ÀwÑ#NÓOÐOØ×#Ñ# D°DÕ9r;   c                ó@  • U R                   U;  aI  [        R                  " [        S5      U R                  [        U R                   5      4-  [        S5      S9eU R                   U;   a5  [        R                  " [        S5      [        U R                   5      -  5      eg )Ns%   %s "%s" changeset was not a candidates   only use listed changesets©Úhints#   duplicated command for changeset %s)r¼   r   rÅ   r   r�   r   )rg   rÑ   rÒ   rÓ   s       r8   rÐ   Ú%histeditaction._verifynodeconstraints  sŠ   € à�9‰9˜HÓ$Ü×"Ò"ÜÐ:Ó;Ø—9‘9œe D§I¡IÓ.Ð/ñ0äÐ4Ó5ñð ð �9‰9˜ÓÜ×"Ò"ÜÐ8Ó9¼EÀ$Ç)Á)Ó<LÑLóð ð r;   c                óä  • U R                   U R                     nU R                   R                  nUR                  SS0S5         [        R
                  " XR                  SS5      5      nSSS5        SU R                  U[        R                  " W5      4-  nU R                   R                  R                  SS5      n[        US5      n[        R                  " XE5      $ ! , (       d  f       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.torule  sÈ   € ð �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   • SU R                   [        U R                  5      4-  $ )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�   r   r¼   r®   s    r8   r–   Úhisteditaction.tostate0  s    € ð ˜DŸI™I¤s¨4¯9©9£~Ð6Ñ6Ð6r;   c                ób   • U R                  5         U R                  5         U R                  5       $ )zfRuns the action. The default behavior is simply apply the action's
rulectx onto the current parentctx.)ÚapplychangeÚcontinuedirtyÚcontinuecleanr®   s    r8   ÚrunÚhisteditaction.run6  s+   € ð 	×ÑÔØ×ÑÔØ×!Ñ!Ó#Ð#r;   c                óD  • U R                   nXR                     nUR                  R                  5          [        R
                  " XR                  R                  SS9  SSS5        [        UR                  X0 5      nUR                  R                  UR                  5       UR                  5       5        UR                  (       aI  [        R                  " [!        S5      U R"                  [%        U R                  5      4-  [!        S5      S9eg! , (       d  f       N¸= f)zdApplies the changes from this action's rulectx onto the current
parentctx, but does not commit them.T©Ú
quietemptyNs   Fix up the change (%s %s)s    hg histedit --continue to resumerØ   )r\   r¼   rP   Úsilentr   Úupdater   r_   ÚapplychangesÚdirstateÚ	setbranchÚbranchÚcurrenttransactionÚunresolvedcountr   ÚInterventionRequiredr   r�   r   )rg   r\   ÚrulectxÚstatss       r8   rî   Ú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Ä
Dc                ód  • U R                   nXR                     nU R                  5       n[        X5      nUR                  R                  SS5      (       a  [        R                  " 5       nOUR                  5       nU" UR                  5       UR                  5       UUR                  5       US9  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ÚcommitfuncforrP   rO   r   Úmakedater  Údescriptionr  r  )rg   r\   rÿ   r	  Úcommitr  s         r8   rï   Úhisteditaction.continuedirtyL  s�   € ð �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    r8   r
  Úhisteditaction.commiteditor`  s   € àr;   c                óª  • U R                   S   nUR                  5       U R                  R                  :X  a\  U R                   R                  R                  [        S5      [        U R                  5      -  5        XR                  [        5       4/4$ UR                  5       U R                  :X  a  U/ 4$ XR                  UR                  5       44/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¼   r   r_   rP   Úwarnr   r   Útuple)rg   rå   s     r8   rð   Úhisteditaction.continuecleand  s§   € ð �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\   r   N)r³   r´   rµ   r¶   rh   ÚclassmethodrË   rÕ   rÐ   ré   r–   rñ   rî   rï   r
  rð   r·   r¸   r;   r8   rº   rº   ë  sH   † òð
 ñó ðò :òò1ò.7ò$òò
ò(õ1r;   rº   c                ó<   ^ ^^• TR                  5       mUU U4S jnU$ )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                 ó  >• ST0nTR                   R                  US5         U R                  S0 5      R                  5       nTR	                  5       US'   X S'   TR
                  " S0 U D6sS S S 5        $ ! , (       d  f       g = f)N©s   phasess
   new-commitr&   r  ó   histedit_sourcer¸   )rP   rÞ   ÚgetÚcopyr   r  )Ú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   `` @r8   r  r  t  s   ú€ ð �y‰y‹{€H÷)ð Ðr;   c                óB  • UR                  5       R                  5       UR                  R                  5       :X  aJ  U R                  5          [        R
                  " XUSS9  [        R                  " SSSS5      nSSS5        U$  UR                  R                  SSUR                  SS5      S	5        [        R                  " UU/ S
QS9nUR                  R                  SSSS	5        U$ ! , (       d  f       W$ = f! UR                  R                  SSSS	5        f = f)z@Merge changeset from ctx (only) in the current working directoryT)Úallr   Nr+   s
   forcemerges   toolr;   r&   )s   already editeds   current changes   parent of current change)Úlabels)Úp1r¼   rù   rö   r	   ÚrevertÚmergemodÚupdateresultrP   Ú	setconfigr  Úgraft)rP   r\   rå   Úoptsr   s        r8   rø   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,ÂAC> Ã,
C;Ã> Dc                óP  ^^^• [        U R                  SUR                  5       TR                  5       5      5      nU(       d  gU HQ  nUR                  5       (       a  M  [        R
                  " [        S5      [        UR                  5       5      -  5      e   UR                  5       n[        5       nU H"  n	UR                  U	R                  5       5        M$     [        R                  " UT5      mU V
s/ s H$  n
[        R                  " U
TU5      (       a  M"  U
PM&     nn
TR!                  5       mUUU4S jnUR#                  S5      (       a  US   nOUR%                  5       nUR#                  S5      nUR#                  S5      nUR#                  S5      nUR                  5       R                  5       UR'                  5       R                  5       4nSnU(       d  [        R(                  " S	S
S9n[*        R,                  " U UUUUUUUUS9	nU R/                  U5      $ s  sn
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                óÖ   >• UT;   ab  TU   nUR                  5       n[        R                  " U UUR                  5       UR	                  5       SU;   SU;   TR                  U5      S9nU$ g )Nó   lrÜ   )ÚislinkÚisexecÚ
copysource)Úflagsr
   Ú
memfilectxÚpathru   r  )	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>  r  r  r  r	  )ÚlistÚsetrÈ   Úmutabler   rÅ   r   r   r¼   r(  r÷   rH  r   Ú
pathcopiesr	   ÚsamefileÚmanifestr  r  Úp2Úgetcommiteditorr
   ÚmemctxÚ	commitctx)r\   Úfirstctxr=  Ú
commitoptsÚ
skippromptÚctxsÚcÚbaserH  rå   rŠ   r>  r@   r  r  r  rG  r	  Ú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 Is   Ã8!H#ÄH#c                ó&   • U S    R                  SS9$ )NT)Úmissing)Údirty©r\   s    r8   Ú
_isdirtywcr_  ó  s   € Ø�‰:×Ñ DÐÐ)Ð)r;   c                 óP   • [         R                  " [        S5      [        S5      S9e)Ns    working copy has pending changessY   amend, commit, or revert them and run histedit --continue, or abort with histedit --abortrØ   )r   Ú
StateErrorr   r¸   r;   r8   Ú
abortdirtyrb  ÷  s+   € Ü
×
Ò
Ü	Ð
-Ó.Üð:ó
ñð r;   c                ó    ^ ^^^• UUUU 4S jnU$ )Nc                óf  >• T(       a	  T(       a   eTS   nT(       a  [         R                  U5        OWT(       a  [        R                  U5        O:[        T5      S:”  a  [        R                  U5        O[
        R                  U5        Xl        TU l        TU l        T H  nU [        U'   M     U $ ©Nr   r>   )
rL   ÚaddÚinternalactionsr6   rM   rN   r�   rB   r@   r?   )rÆ   r�   Úinternalr@   ÚpriorityrB   s     €€€€r8   ÚwrapÚaction.<locals>.wrap  sŒ   ø€ Þ¦8Ð+Ð+Ø�Q‰xˆÞÜ×Ñ˜tÕ$ÞÜ×Ñ Õ%Ü�‹Z˜!‹^Ü× Ñ  Õ&ä×Ñ Ô%àŒØˆŒ	ØˆŒÛˆDØ #ŒK˜Óñ àˆ
r;   r¸   )rB   r@   ri  rh  rj  s   ```` r8   r—   r—     s   û€ ÷ð ð& €Kr;   ó   pickó   ps
   use commit)ri  c                  ó(   ^ • \ rS rSrU 4S jrSrU =r$ )Úpicki  c                ó<  >• U R                   U R                     nUR                  5       R                  5       U R                  R                  :X  a?  U R                   R
                  R                  S[        U R                  5      -  5        U/ 4$ [        TU ]%  5       $ )Ns   node %s unchanged
)
r\   r¼   r(  r   r_   rP   Údebugr   Úsuperrñ   )rg   rÿ   Ú	__class__s     €r8   rñ   Úpick.run  sq   ø€ Ø—)‘)˜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__©rs  s   @r8   ro  ro    s   ø† ÷ó r;   ro  ó   editó   es4   use commit, but allow edits before making new commitc                  ó    • \ rS rSrS rS rSrg)rE  i#  c                ó`  • U R                   nXR                     n[        R                  " XR                  R
                  SS9  [        UR                  X0 5        [        S5      n[        R                  " [        S5      [        U R                  5      -  U[        U R                  5      -  S9e)NTrô   s9   to edit %s, `hg histedit --continue` after making changess6   Editing (%s), commit as needed now to split the changerØ   )r\   r¼   r   r÷   r   r_   rø   rP   r   r   rþ   r   )rg   r\   rÿ   rÙ   s       r8   rñ   Ú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                  " SSS9$ )NTs   histedit.editrD  ©r	   rP  r®   s    r8   r
  Úedit.commiteditor5  ó   € Ü×&Ò&¨DÐ;KÑLÐLr;   r¸   N)r³   r´   rµ   r¶   rñ   r
  r·   r¸   r;   r8   rE  rE  #  s   † ò

õMr;   rE  ó   foldó   fs-   use commit, but combine it with the one abovec                  óL   ^ • \ rS rSrU 4S jrS rS rS rS rS r	S r
S	rU =r$ )
Úfoldi9  c                ó`  >• [         TU ]  XU5        U R                  nU(       d  X@R                     R	                  5       nOUR
                  S;  a  gXAR                     nUR                  5       (       d9  [        R                  " [        S5      [        UR                  5       5      -  5      eg)z.Verifies semantic correctness of the fold rule)rl  ó   baseNr0  )rr  rÕ   r\   r¼   r(  r�   rK  r   rÅ   r   r   )rg   rÑ   rÒ   rÓ   r\   rW  rs  s         €r8   rÕ   Úfold.verify;  s‡   ø€ ä‰‰�t tÔ,Ø�y‰yˆÞØ—Y‘Y‘×"Ñ"Ó$‰AØ—‘Ð0Ó0Øà—Y‘Y‘ˆAØ�y‰y�{‰{Ü×"Ò"ÜÐ6Ó7¼%ÀÇÁÃ»/ÑIóð ð r;   c                óà   • U R                   nXR                     n[        X5      nU" S[        U R                  5      -  UR	                  5       UR                  5       UR                  5       S9  g )Ns   fold-temp-revision %s)r  r  r  r  )r\   r¼   r  r   r  r  r  )rg   r\   rÿ   r  s       r8   rï   Úfold.continuedirtyJ  sT   € Ø�y‰yˆØ—y‘y‘/ˆä˜tÓ-ˆÙØ)¬E°$·)±)Ó,<Ñ<Ø—‘“Ø—‘“Ø—-‘-“/ó		
r;   c                ób  • U R                   nUS   nXR                     nU R                  R                  nUR                  5       U:X  aK  UR                  R                  [        S5      [        U R                  5      -  5        X R                  U44/4$ X   nUR                  SUR                  5       UR                  5       5       Vs1 s H  nUR                  5       iM     nnU(       dd  UR                  R                  [        S5      [        U R                  5      [        U5      4-  5        X R                  UR                  5       44/4$ UR                  5       nUR                  UR                  5       5        U R                  UR                  XX2R                  5       U5      $ s  snf )Nr  s   %s: empty changeset
s   (%d::. - %d)sI   %s: cannot fold - working copy is not a descendant of previous commit %s
)r\   r¼   r   r_   rP   r  r   r   rJ  rÈ   r  ÚdiscardÚ
finishfold)	rg   r\   rå   rÿ   r_   Ú	parentctxrW  Ú
newcommitsÚmiddlecommitss	            r8   rð   Úfold.continuecleanV  sh  € Ø�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    r8   rU  Úfold.skippromptu  s   € ð 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                  " UR                  5       5        0 nUR                  5       US'   U R	                  5       (       d  UR                  5       nOYSR                  UR                  5       /U V	s/ s H  o’U	   R                  5       PM     sn	-   UR                  5       /-   5      S-   nX‡S'   U R                  5       (       a  UR                  5       US'   O+[        UR                  5       UR                  5       5      US'   UR                  SS5      (       a  [        R                  " 5       US'   UR                  5       R                  5       n
SUR                  5       UR                  5       4-  U
S	'   X§S
'   [        UR!                  5       UR!                  5       5      nSU0nUR"                  R%                  US5         ['        UUX%   UU R)                  5       S9nS S S 5        Wc  U/ 4$ [         R                  " X-   5        UR+                  5       U44UR+                  5       U44X]44/nU H  nUR-                  Xý445        M     X-   U4$ s  sn	f ! , (       d  f       N}= f)NrA  s   
***
r1   r@  rB  r  r  s   %s,%sr  rC  r  r&   )rU  )r*  r÷   r(  r  r“  r  rC   r–  r  rã   rO   r   r  r  r  r   r$  rP   rÞ   rZ  rU  r¼   rE   )rg   rP   r\   rå   ÚoldctxÚnewnodeÚinternalchangesrT  Ú
newmessager’   r  r   r  Únrf   Úichs                   r8   r‹  Ú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˜Ð$Ð$ùòS G÷. <Õ;ús   Á?I 
ÇI%É%
I3r¸   )r³   r´   rµ   r¶   rÕ   rï   rð   rU  r“  r–  r‹  r·   ru  rv  s   @r8   rƒ  rƒ  9  s+   ø† õò

ò
ò>òò÷5%ð 5%r;   rƒ  r…  ó   bs:   checkout changeset and apply further changesets from therec                  ó,   • \ rS rSrS rS rS rS rSrg)rX  iÆ  c                óÒ   • U R                   S   R                  5       U R                  :w  a-  [        R                  " U R                   U R                     5        U R	                  5       $ ©Nr  )r\   r¼   r*  Úclean_updaterð   r®   s    r8   rñ   Úbase.runË  sI   € Ø�9‰9�T‰?×ÑÓ! T§Y¡YÓ.Ü×!Ò! $§)¡)¨D¯I©IÑ"6Ô7Ø×!Ñ!Ó#Ð#r;   c                ó   • [        5         g r4   )rb  r®   s    r8   rï   Úbase.continuedirtyÐ  s   € Ü�r;   c                ó(   • U R                   S   nU/ 4$ r£  r^  )rg   Úbasectxs     r8   rð   Úbase.continuecleanÓ  s   € Ø—)‘)˜D‘/ˆØ˜ˆ{Ðr;   c                ó¸   • U R                   U;   aJ  [        S5      n[        R                  " X@R                  [        U R                   5      4-  [        S5      S9eg )Ns.   %s "%s" changeset was an edited list candidates&   base must only use unlisted changesetsrØ   )r¼   r   r   rÅ   r�   r   )rg   rÑ   rÒ   rÓ   Úmsgs        r8   rÐ   Ú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;   r8   rX  rX  Æ  s   † ò
$ò
òõr;   rX  s
   _multifoldsv  fold 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.
    )rh  c                  ó   • \ rS rSrS rSrg)Ú
_multifoldiá  c                ó   • g©NTr¸   r®   s    r8   rU  Ú_multifold.skippromptð  ó   € Ør;   r¸   N)r³   r´   rµ   r¶   rU  r·   r¸   r;   r8   r¯  r¯  á  s   † õr;   r¯  ó   rollr›   s9   like fold, but discard this commit's description and datec                  ó&   • \ rS rSrS rS rS rSrg)Úrollupiô  c                ó   • g)NFr¸   r®   s    r8   r“  Úrollup.mergedescsù  s   € Ør;   c                ó   • gr±  r¸   r®   s    r8   rU  Úrollup.skippromptü  r³  r;   c                ó   • gr±  r¸   r®   s    r8   r–  Úrollup.firstdateÿ  r³  r;   r¸   N)r³   r´   rµ   r¶   r“  rU  r–  r·   r¸   r;   r8   r¶  r¶  ô  s   † ò
òõr;   r¶  ó   dropó   ds   remove commit from historyc                  ó   • \ rS rSrS rSrg)Údropi  c                óx   • U R                   U R                  R                     nXR                  [	        5       4/4$ r4   )r\   r   r_   r¼   r  )rg   rŒ  s     r8   rñ   Údrop.run  s1   € Ø—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;   r8   rÀ  rÀ    s   † õ1r;   rÀ  ó   messó   ms3   edit commit message without changing commit contentc                  ó   • \ rS rSrS rSrg)r@   i
  c                ó,   • [         R                  " SSS9$ )NTs   histedit.messrD  r}  r®   s    r8   r
  Úmessage.commiteditor  r  r;   r¸   N)r³   r´   rµ   r¶   r
  r·   r¸   r;   r8   r@   r@   
  s   † õMr;   r@   c                óô  • Uc  0 n[         R                  " SXU5      nU R                  [        S5      [         R                  " UR
                  5      -  5        [        R                  " XUR                  / 4S5      u  pg[        R                  " XU5      nU(       a   U V	s/ s H  o‘R                  U	5      PM     nn	[        R                  " XXcS9n
U
R                  (       d  [        R                  " [        S5      5      e[!        UR#                  SU
R                  5      5      n[%        U5      S:”  a*  [        S5      n[        S	5      n[        R                  " XÍS
9eXS      R'                  5       $ s  sn	f )zRutility function to find the first outgoing changeset

Used by initialization codeNr&   s   comparing with %s
)Úforces   no 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\  r   ra  rI  Úrevsr6   r¼   )rP   r\   ÚremoterÉ  r.  r8  rÓ  Ú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)rl  rw  r€  r½  rÃ  r´  s   ^folds   ^roll)r€  r´  )r>   é   é   é   é   )é   é   é   )é	   é
   é   )r>   rÚ  )rÛ  rÜ  rÝ  rÞ  rß  )r   r>   rÚ  rÛ  ó   globaló   next-actionó   prev-actionó   quitó	   showpatchó   help)	ó   hs	   KEY_RIGHTr2  s   KEY_LEFTó   qó   có   Có   vó   ?s   action-drops   action-edits   action-folds   action-messs   action-picks   action-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
                  S5      5      $ )Ns   hhr>   s       )ÚstructÚunpackÚfcntlÚioctlÚtermiosÚ
TIOCGWINSZr¸   r;   r8   Úscreen_sizer
  p  s&   € Ü�=Š=˜¤§¢¨A¬w×/AÑ/AÀ7Ó KÓLÐLr;   c                  ó‚   • \ rS rSrS	S jrS r\R                  " \5      r\	S 5       r
\R                  S 5       rS rSrg)
Úhisteditruleit  c                óN   • Xl         X l        X@l        X0l        X0l        / U l        g r4   )rP   rå   r—   ÚorigposÚposÚ	conflicts)rg   rP   rå   r  r—   s        r8   rh   Úhisteditrule.__init__u  s"   € ØŒØŒØŒØŒØŒØˆ�r;   c                ó8   • SU R                   U R                  4-  $ )Ns   %s%s)ÚprefixÚdescr®   s    r8   Ú	__bytes__Úhisteditrule.__bytes__}  s   € ð ˜$Ÿ+™+ t§y¡yÐ1Ñ1Ð1r;   c                ó,  • [         R                  U R                  U R                  5      nU R                  R	                  5       SS nU R                  R                  5       nSSU R                  -  R                  S5      UR                  S5      UU4-  $ )Nr   rÎ   s   #%s %s %d:%s   s   %drÚ  rÞ  )ÚACTION_LABELSr  r—   rå   r   rÈ   r  Úljust)rg   r—   Úhr’   s       r8   r  Úhisteditrule.prefix‹  s}   € ô
 ×"Ñ" 4§;¡;°·±Ó<ˆà�H‰H�L‰L‹N˜1˜RÐ ˆØ�H‰H�L‰L‹Nˆà!Ø�T—\‘\Ñ!×(Ñ(¨Ó+Ø�L‰L˜‹OØØð	%
ñ 
ð 	
r;   c                óæ   • [         R                  " U R                  U R                  R	                  SS5      5      nU(       a  U$ [
        R                  " U R                  R                  5       5      $ )Nr&   r,   )r	   rß   rå   rP   rà   r    rá   r  )rg   ræ   s     r8   r  Úhisteditrule.descœ  sU   € ä×(Ò(Ø�H‰H�d—g‘g—n‘n [Ð2EÓFó
ˆö ØˆNô ×#Ò# D§H¡H×$8Ñ$8Ó$:Ó;Ð;r;   c                óÊ  • UR                   U R                   :”  a”  UR                  U R                  ::  az  [        UR                  R	                  5       5      [        U R                  R	                  5       5      -  [        5       :w  a'  U R
                  R                  U5        U R
                  $ XR
                  ;   a  U R
                  R                  U5        U R
                  $ r4   )r  r  rJ  rå   rH  r  rE   Úremove)rg   rÖ  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—   r  rå   r  r  rP   N)rl  )r³   r´   rµ   r¶   rh   r  r   Ú	strmethodÚ__str__Úpropertyr  r   Úpropertycacher  r   r·   r¸   r;   r8   r  r  t  sO   † ôò
2ð × Ò  Ó+€Gàñ
ó ð
ð  
×Ññ	<ó ð	<õr;   r  c                óp   • / nU  H-  n UR                  SU R                  U R                  4-  5        M/     U$ )zWReturns a list of commands consumable by histedit --commands based on
our list of ruless   %s %s
)rE   r—   rå   )r€   Úcommandss     r8   Úmakecommandsr(  ³  s6   € ð €HÛˆØ�‰˜
 e§l¡l°E·I±IÐ%>Ñ>Ö?ñ à€Or;   c                óò   • U R                  5       u  pVUS-
  U-
  n[        U5      R                  U5      SU nUS:  a  XQ-   nUS:  a  Xb-   nU(       a  U R                  XX45        gU R                  XU5        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                ó:   • [        U 5      U::  a  U $ SXS-
  * S  -   $ )Ns   > rÚ  r5   ©rç   r�  s     r8   Ú_trunc_headr7  Ì  s(   € Ü
ˆ4ƒy�Aƒ~ØˆØ�4˜a™%˜˜
Ð#Ñ#Ð#r;   c                ó:   • [        U 5      U::  a  U $ U S US-
   S-   $ )NrÚ  s    >r5   r6  s     r8   Ú_trunc_tailr9  Ò  s'   € Ü
ˆ4ƒy�Aƒ~ØˆØ��!�a‘%ˆ=˜5Ñ Ð r;   c                  óˆ   • \ rS rSrS rS rS rS rS rS r	S r
SS	 jrS
 rS rS rS rS rS rS rS rSS jrS rSrg)Ú_chistedit_stateiØ  c                óä   • Xl         X l        X0l        UR                  R	                  SS5      U l        SU l        S U l        [        [        4U l	        S U l
        [        SS0[        SS00U l        g )Nr&   r-   r   ó   line_offset)r\   r€   ÚstdscrrP   rO   Úlater_on_topr  ÚselectedÚ	MODE_INITÚmodeÚpage_heightÚ
MODE_RULESÚ
MODE_PATCHÚmodes)rg   r\   r€   r>  s       r8   rh   Ú_chistedit_state.__init__Ù  sy   € ð Œ	ØŒ
ØŒØ ŸG™G×.Ñ.ØÐ/ó
ˆÔð
 ˆŒØˆŒÜ¤	Ð*ˆŒ	ØˆÔäØ ðô Ø ðð	
ˆ�
r;   c                óú  • U R                   U R                  U R                  5         nUR                  nUR	                  5         UR                  5       u  pEUS-
  nSUR                  5       UR                  5       SS 4-  nUR                  SSUSU 5        SUR                  5       -  nUR                  SSUSU 5        U R                  R                  UR                  5       5      nSS	R                  U5      -  nUR                  SSUSU 5        S
[        R                  " UR!                  5       5      -  nUR                  SSUSU 5        SnUR                  SSU5        S[#        U5      -   n	Xi-
  S-   n
SnUSU-   -
  S-
  nUR%                  5       n['        U5       Hp  u  pï[#        U5      U:”  a<  XìS-
  :X  a4  UR                  X¹[)        SR                  XÞS 5      U
5      5        US-   n  O$UR                  X¹[+        Xú5      5        US-   nMr     UR,                  n[#        U5      S:”  a"  SR                  [/        S U5      5      nSU-  nOSnUR                  USUSU 5        UR1                  5         g)zKRenders the commit window that shows the log of the current selected
commitrÛ  s   changeset: %d:%sNrÎ   r>   s   user:      %srÚ  s   bookmark:  %sr¿   s   summary:   %srÜ  s   files:     rÝ  ó   ,r   c                ó<   • U R                   R                  5       S S $ )NrÎ   )rå   r   )r’   s    r8   r9   Ú0_chistedit_state.render_commit.<locals>.<lambda>  s   € °!·%±%·)±)³+¸c¸rÑ2Br;   s   changed files overlap with %ss
   no overlap)r€   Údisplay_pos_to_rule_posr  rå   Úboxr*  rÈ   r   r,  r  r\   Únodebookmarksr¼   rC   r    rá   r  r6   rH  Ú	enumerater9  r7  r  ÚmapÚnoutrefresh)rg   r-  r¦   rå   r1  r2  r3  rç   ÚbmsÚfnxÚfnmaxxr.  ÚfnmaxnrH  r¤   Ú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                óÎ   • U R                   S   [        :X  a  SnUR                  5       $ SnU R                  (       a  US-  nUR                  5       $ US-  nUR                  5       $ )Nr   s}   ?: 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.
)rB  rE  r?  Ú
splitlines)rg   Úhelps     r8   Ú	helplinesÚ_chistedit_state.helplines%  sn   € Ø�9‰9�Q‰<œ:Ó%ðˆDð �‰Ó Ð ðˆDð
 × × ØÐIÑI�ð �‰Ó Ð ð ÐIÑI�Ø�‰Ó Ð r;   c           
     óæ   • UR                  5       u  p#[        U R                  5       5       H2  u  pEXB:¼  a    O*[        XSU[        R
                  " [        5      5        M4     UR                  5         g ©Nr   )r*  rO  r]  r4  ÚcursesÚ
color_pairÚ
COLOR_HELPrQ  )rg   r-  r1  r2  r.  rç   s         r8   Úrender_helpÚ_chistedit_state.render_help7  sT   € Ø—\‘\“^‰
ˆÜ  §¡Ó!1Ö2‰GˆAØ‹yÙÜ�#˜!˜T¤6×#4Ò#4´ZÓ#@ÖAñ 3ð 	�‰Õr;   c                óð   • U R                   R                  5       u  p[        U R                  5       5      nX-
  S-
  nUS:  a+  [        R
                  " [        S5      X4-  [        S5      S9eSU4X24XB4S.$ )NrÎ   r>   s:   terminal dimensions %d by %d too small for curses histedits7   enlarge your terminal or use --config ui.interface=textrØ   )ó   commitré  ó   main)r>  r*  r6   r]  r   ÚAbortr   )rg   r1  r2  ÚhelplenÚmainlens        r8   ÚlayoutÚ_chistedit_state.layout?  s†   € Ø—[‘[×)Ñ)Ó+‰
ˆÜ�d—n‘nÓ&Ó'ˆØ‘. 2Ñ%ˆØ�Q‹;Ü—+’+ÜÐOÓPØ�,ñäØNóñð ð ˜D�zØ�_Ø�_ñ
ð 	
r;   c                ó^   • U R                   (       a  [        U R                  5      S-
  U-
  $ U$ )a  Converts 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?  r6   r€   )rg   Údisplay_poss     r8   rL  Ú(_chistedit_state.display_pos_to_rule_posQ  s+   € ð ××Ü�t—z‘z“? QÑ&¨Ñ4Ð4àÐr;   c           
     ó  • U R                   [           S   nU R                   Vs/ s H!  o3R                  (       d  M  UR                  PM#     nn[        U5      S:”  aS  SSR                  [        [        R                  U5      5      -  n[        USSU[        R                  " [        5      5        [        U[        U R                  5      5       GHŸ  nXb-
  nUS:  d  XpR                  :¼  a  M  U R!                  U5      nU R                  U   n	[        U	R                  5      S:”  a-  UR#                  USS[        R                  " [        5      5        O"UR#                  USS[        R$                  5        X`R&                  :X  a-  [(        n
[        XSU	[        R                  " [*        5      5        OaX`R,                  :X  a?  [.        n
[        UUSU	[        R                  " [0        5      [        R2                  -  5        O[4        n
[        XSU	5        U	R6                  S:X  d  GMW  UR#                  US[        U	R8                  5      -   U	R:                  [        R                  " U
5      5        GM¢     UR=                  5         g s  snf )	Nr=  r   s   potential conflict in %srI  rœ   r¿   rÚ  r´  )rF  rD  r€   r  rå   r6   rC   rP  r   Úbytestrr4  ra  rb  Ú
COLOR_WARNr    rC  rL  r,  ÚCOLOR_BLACKr@  ÚCOLOR_ROLL_SELECTEDÚCOLOR_SELECTEDr  ÚCOLOR_ROLL_CURRENTÚCOLOR_CURRENTÚA_BOLDÚ
COLOR_ROLLr—   r  r  rQ  )rg   ÚrulesscrÚstartr’   r  rç   ro  r.  Ú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÷	ñ9 9ðF 	×ÑÕùòU ?s
   ¥J½Jc           	     ó   • UR                  5       u  pE[        US-
  [        U5      5      n[        SU5       GH  nX'   nU(       aá  UR	                  S5      (       a.  UR                  USU[        R                  " [        5      5        MS  UR	                  S5      (       a.  UR                  USU[        R                  " [        5      5        M—  UR	                  S5      (       a.  UR                  USU[        R                  " [        5      5        MÛ  UR                  USU5        Mð  UR                  USU5        GM     UR                  5         g )Nr>   r   ó   +ó   -s   @@ )r*  Úminr6   r    r{   r,  ra  rb  ÚCOLOR_DIFF_ADD_LINEÚCOLOR_DIFF_DEL_LINEÚCOLOR_DIFF_OFFSETrQ  )	rg   r-  ÚoutputÚ
diffcolorsr1  r2  r3  r.  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                ó‚   • U R                   [           S   nU R                   [           S   nU R                  XUS  SS9  g )Nr=  ó   patchcontentsT)r‰  )rF  rE  rŠ  )rg   r-  r|  Úcontents       r8   Úrender_patchÚ_chistedit_state.render_patch£  sB   € Ø—
‘
œ:Ñ& ~Ñ6ˆØ—*‘*œZÑ(Ð)9Ñ:ˆØ×Ñ˜3¨¨ ¸DÐÒAr;   c                óà  ^• U R                   nT[        R                  S4;   a  [        $ TnTb  STs=::  a  S::  a  O  OSnU R                  u  pE[
        U   R                  U[
        S   R                  U5      5      nUc  gUS;   a\  [        US-   [        U R                  5      S-
  5      nU R                  X'5        U R                  c  US:X  a  U R                  X'5        ggUS	;   aF  [        S
US-
  5      nU R                  X'5        U R                  c  US:X  a  U R                  X'5        ggUS:X  a  U R                  USS9  gUS:X  a  U R                  USS9  gUS:X  a2  U R                  c  UOSU l        U R                  U R                  5        gUS:X  a�  [!        T5      [        U R                  5      s=:  a  S::  ag  O  Od[#        U4S jU R                   5       5      nU R                  X(R                   5        U R                  b  U R                  X(R                   5        ggUR%                  S5      (       a  U R'                  X&SS 5        gUS:X  a"  U R)                  U[*        :w  a  [*        OU5        gUS:X  a"  U R)                  U[,        :w  a  [,        OU5        gUS:X  a  [.        $ US:X  a  [0        $ US:X  a  [2        $ US:X  a  [4        $ US:X  a  [6        $ US:X  a  [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ú  r   rú  rå  T)Únextræ  Frð  rþ  râ  c              3  ó\   >#   • U  H!  oR                   [        T5      :X  d  M  Uv •  M#     g 7fr4   )r  rŸ   )r‘   r’   Úchs     €r8   r“   Ú)_chistedit_state.event.<locals>.<genexpr>Ï  s    øé € ÐI¢j ·I±IÄÀRÃÑ4HŸ1™1¢jùs   ƒ,£	,s   action-rß  rè  ré  rç  r&   rÿ  r   r  r  )r  ra  Ú
KEY_RESIZEÚE_RESIZErB  ÚKEYTABLEr  r„  r6   r€   Ú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)	rg   r•  Ú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                óâ  • U R                   nU R                  U R                  U R                  5         n[        R
                  " UR                  USSS.SS9nSS0nUR                  R                  USS9   UR                  UR                  5        UR                  5         S S S 5        UR                  UR                  R                  5          R                  5       $ ! , (       d  f       NC= f)NTs   status)s   patchs   template)Úbuffered)r+   s   verboser&   )Úsource)r\   r€   rL  r  r   ÚchangesetdisplayerrP   rÞ   Úshowrå   r¡   ÚhunkrÈ   r[  )rg   r\   r¦   Ú	displayerr  s        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 l         U R                  u  p4U[        :X  aL  U R                  [           nX%S   :  a  X%S'   O,X%S   U R                  -   S-
  :”  a  X R                  -
  S-   US'   SU R                  [
           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>   r   N)r  rB  rD  rF  rC  rE  )rg   r§  r«  rB  r   Ú	modestates         r8   rš  Ú_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                óŽ   • U R                   u  p#X4U l         U[        :X  a%  U R                  5       U R                  [           S'   g g )Nr�  )rB  rE  r¶  rF  )rg   rB  r©  r   s       r8   rŸ  Ú_chistedit_state.change_mode	  s@   € Ø—Y‘Y‰
ˆØ�OˆŒ	Ø”:ÓØ7;×7JÑ7JÓ7LˆD�J‰J”zÑ"Ð#3Ò4ð r;   c                ó   • Xl         g r4   )r@  )rg   r  s     r8   r�  Ú_chistedit_state.make_selection  s   € Ø�r;   c                óø  • U R                  U5      nU R                  U5      nU R                  nSUs=::  a  [        U5      :  a  O   eSUs=::  a  [        U5      :  d   e   eXT   XS   sXS'   XT'   XEU   l        X5U   l        [	        X45      n[        X45      n[        XgS-   5       H-  nXT   R                  XX   5        XS   R                  XX   5        M/     U R                  (       a  U R                  U5        gg)zOSwap two positions and calculate necessary conflicts in
O(|newpos-oldpos|) timer   r>   N)
rL  r€   r6   r  r„  rã   r    r   r@  r�  )	rg   r§  r«  Úold_rule_posÚnew_rule_posr€   r|  Úendr’   s	            r8   r›  Ú_chistedit_state.swap  s  € ð ×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                ó–   • U R                  U5      nSUs=::  a  [        U R                  5      :  d   e   eX R                  U   l        g)z?Change the action state on the given position to the new actionr   N)rL  r6   r€   r—   )rg   r  r—   r}  s       r8   rž  Ú_chistedit_state.change_action-  sB   € à×/Ñ/°Ó4ˆØ�HÕ.œs 4§:¡:›Ó.Ð.Ñ.Ð.Ð.Ø&,�
‰
�8ÑÕ#r;   c                óZ  • U R                  U5      nSUs=::  a  [        U R                  5      :  d   e   eU R                  U   R                  nU[        ;   d   e[        R                  U5      nU(       a  US-  nOUS-  nU R                  U[        U[        [        5      -     5        g)zMChanges the action state the next or the previous action from
the action listr   r>   N)rL  r6   r€   r—   ÚKEY_LISTr¢   rž  )rg   r  r“  r}  Úcurrentr¢   s         r8   rœ  Ú_chistedit_state.cycle_action3  sš   € ð ×/Ñ/°Ó4ˆØ�HÕ.œs 4§:¡:›Ó.Ð.Ñ.Ð.Ð.Ø—*‘*˜XÑ&×-Ñ-ˆàœ(Ó"Ð"Ð"ä—‘˜wÓ'ˆÞØ�Q‰J‰Eà�Q‰JˆEð 	×Ñ˜3¤¨´´X³Ñ)>Ñ ?Õ@r;   c                ó  • U R                   u  p4U[        :w  a  gU R                  U   n[        US   5      nU R                  nUS:X  a  UOSnSUS-
  U-  -   nUS-
  U-  n	US   X-  -   n
[        S[        Xš5      5      US'   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   )rB  rE  rF  r6   rC  rã   r„  )rg   ÚdeltaÚunitrB  r   Ú
mode_stateÚ	num_linesrC  Ú	num_pagesÚ
max_offsetÚnewlines              r8   Úchange_viewÚ_chistedit_state.change_viewE  s˜   € ð —)‘)‰ˆØ”:ÓØØ—Z‘Z Ñ%ˆ
Ü˜
Ð#3Ñ4Ó5ˆ	Ø×&Ñ&ˆØ" g›o‰{°1ˆØ˜ Q™¨;Ñ6Ñ6ˆ	Ø !‘m {Ñ2ˆ
Ø˜^Ñ,¨u©|Ñ;ˆÜ%(¨¬C°
Ó,DÓ%Eˆ
�>Ò"r;   )	r?  rB  rF  rC  r  r\   r€   r@  r>  N©F)r³   r´   rµ   r¶   rh   rX  r]  rd  rl  rL  r  rŠ  r�  r­  r¶  rš  rŸ  r�  r›  rž  rœ  rÓ  r·   r¸   r;   r8   r;  r;  Ø  sc   † ò
ò6/òb!ò$ò
ò$ò-ô^ò,Bò
<ò|;ò3ò(Mòò(ò6-ôAõ$Fr;   r;  c                óÖ
  •  [         R                  " 5         [         R                  " [        [         R
                  [         R                  5        [         R                  " [        [         R                  [         R
                  5        [         R                  " [        [         R                  [         R                  5        [         R                  " [        [         R                  [         R                  5        [         R                  " [        [         R
                  [         R                  5        [         R                  " [        [         R                  S5        [         R                  " [         [         R"                  S5        [         R                  " [$        [         R                  S5        [         R                  " [&        [         R"                  S5        [         R                  " [(        [         R                  [         R                  5        [         R                  " [*        [         R"                  [         R
                  5         [         R,                  " S5        S n[/        XU5      nS nUR1                  5         UR3                  5          UR4                  u  pgU[6        :X  a  UR9                  [:        5        UR=                  U5      nU[>        :X  a  gU[@        :X  a  URB                  $ U[D        :X  a0  [G        5       n	X’RI                  5       :w  a  [         RJ                  " U	6   URM                  5       n
UR4                  u  p·X¶:w  a3  U
S   S   Ul'        URQ                  URR                  URR                  5        Su  pÍU" U
S   XÍ5      u  pìnU" U
S   XÍ5      u  pünU" U
S   XÍ5      u  npÍU[T        [V        [X        [Z        4;   as  U[T        :X  a  UR]                  S	S
5        OVU[V        :X  a  UR]                  SS
5        O9U[X        :X  a  UR]                  S	S5        OU[Z        :X  a  UR]                  SS5        UR_                  5         UR_                  5         UR_                  5         U[`        :X  a  URc                  U5        O_U[d        :X  a3  URg                  U[h        Rk                  5       Rm                  5       5        O"URo                  U5        URq                  U5        URs                  U5        [         Rt                  " 5         [v        Rx                  " UR{                  5       5      nGM¥  ! [         R                   a     GN5f = f! [         R                   a     GN	f = f)Nrœ   r   c                óT   • [         R                  " U S   U S   X5      nXS   -  nX1U4$ re  )ra  Únewwin)Úsizer.  r/  r-  s       r8   ÚdrawvertwinÚ#_chisteditmain.<locals>.drawvertwinq  s1   € Ü�mŠm˜D ™G T¨!¡W¨aÓ3ˆØ	�!‰W‰ˆØ�qˆyÐr;   Frh  )r   r   ré  rg  r>   rË  s   line)>ra  Úuse_default_colorsr   Ú	init_pairrc  ÚCOLOR_WHITEÚ
COLOR_BLUErv  rt  rs  ÚCOLOR_YELLOWÚCOLOR_OKÚCOLOR_GREENrx  ÚCOLOR_MAGENTAr…  r†  Ú	COLOR_REDr‡  rz  rw  ru  Úcurs_setr;  r¯   ÚrefreshrB  rA  rŸ  rD  r­  r¡  r¢  r€   r˜  r
  r*  Ú
resizetermrl  rC  rš  r  r£  r¤  r¥  r¦  rÓ  ÚeraserE  r�  r   rŠ  Ú__doc__rÀ   r[  r  rX  rd  Údoupdater   Ú
strtolocalÚgetkey)r\   r€   r>  rÚ  r   r•  ÚoldmodeÚunusedÚerÙ  Úsizesr©  r.  r/  ÚhelpwinÚmainwinÚ	commitwins                    r8   Ú_chisteditmainrô  V  sÖ  € ðÜ×!Ò!Ô#ô
 ×Ò”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 Ô5UÕUÕU(Õ'U(c           	     ó,  • [         c  [        R                  " [        S5      5      eSU l         UR                  S5      nUR                  S/ 5      SS n[        R                  " U5        [        R                  " U5        UR                  U5        U(       d*  [        R                  " X5      nUb  UR                  U5        [        U5      S:w  a  [        R                  " [        S5      5      e[        UR!                  S["        R$                  " X5      5      5      n[        U5      S:w  a  [        R                  " [        S5      5      eUS	   R'                  5       n	UR(                  R+                  5       n
[-        XX¥5      nU(       d+  [        R                  " [        S
5      [/        U	5      -  5      e/ n[1        U5       H#  u  pÍUR                  [3        XU   U5      5        M%     [4        R6                  " 5          [         R8                  " [:        R<                  " [>        X5      5      nSSS5        WSL a  U RA                  [        S5      5        g	[C        U5      [        L av  U RE                  [        S5      5        [G        U5      nURI                  SS5       nU H  nURA                  U5        M     URJ                  US'   SSS5        [M        XX#U5      $  g! , (       d  f       N¸= f! , (       d  f       N.= f! [N         a     gf = 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.Ns   Python curses library requiredrm   ó   revr>   ó/   histedit requires exactly one ancestor revisionó
   roots(%ld)ó9   The specified revisions must have exactly one common rootr   ó*   %s is not an ancestor of working directoryFs   histedit aborted
s   performing changes
s	   chistedits   w+ó   commandsrœ   )(ra  r   ri  r   Ú
_colormoder  r	   ÚcheckunfinishedÚbailifchangedrF   r   ÚdesthisteditrE   r6   Ú
InputErrorrI  rJ  r   Úrevranger¼   rù   r(  Úbetweenr   rO  r  r   Úwith_lc_ctypeÚwrapperÚ	functoolsÚpartialrô  r‹   ÚtyperÌ  r(  rz   ÚnameÚ_texthisteditÚKeyboardInterrupt)rP   r\   r   Úfreeargsr.  r]   rÓ  Ú
defaultrevÚrrÚrootr^   r€   r¤   r’   Úrcr   s                   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   ¯GL È0K$È2'L ÉA	L Ê#*K5ËL Ë$
K2Ë.L Ë5
LË?L Ì
LÌLr;   rû  s*   read history edits from the specified files   FILErì  ó   continues$   continue an edit already in progressó	   edit-plans   edit remaining actions listrm   s,   don't strip old nodes after edit is completeó   aborts   abort an edit in progressó   oó   outgoings#   changesets not found in destinationó   forces.   force outgoing even for unrelated repositoriesrö  s   first revision to be editeds   REVs)   [OPTIONS] ([ANCESTOR] | --outgoing [URL]))Úhelpcategoryc           	     óÀ  • [         R                  " U5      n[        U5      nUR                  5        oQR	                  5        nXTl        Xdl        U R                  S5      S:X  a2  [        U5      [        :X  a  [        XXBU5      sSSS5        sSSS5        $ [        XXBU5      sSSS5        sSSS5        $ ! , (       d  f       O= fSSS5        g! , (       d  f       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&   s   cursesN)
r   ÚbyteskwargsrX   ra   r`   Ú	interfaceÚ_getgoalÚgoalnewr  r	  )rP   r\   r  r.  r   ra   r`   s          r8   Úhisteditr  ÷  s–   € ôF ×Ò Ó%€Dä˜$Ó€EØ	�‰Œ˜§	¡	¤¨tØŒØŒ
ð �<‰<˜Ó$¨	Ó1´h¸t³nÌÓ6OÜ˜b¨¸Ó>÷ !, �‰ô ˜R u¸Ó=÷ !, �‰§¥ú��Žús0   ²CÁAB5Â	CÂB5Â"	CÂ5
C	Â?CÃ
Cc                ó   • [        XX#U5        g r4   )Ú	_histedit)rP   r\   r   r  r.  s        r8   r	  r	  ˆ  s   € Üˆb˜¨Õ.r;   s   newc                ó¶   • U R                  S5      (       a  [        $ U R                  S5      (       a  [        $ U R                  S5      (       a  [        $ [        $ )Nr  r  ó	   edit_plan)r  ÚgoalcontinueÚ	goalabortÚgoaleditplanr  )r.  s    r8   r  r  ’  sF   € Ø‡x�x�×ÑÜÐØ‡x�x�×ÑÜÐØ‡x�x�×ÑÜÐÜ€Nr;   c                óÆ   • US:X  a5  U R                  S5         U R                  R                  5       sS S S 5        $ [        R                  " U5      $ ! , (       d  f       g = f)Nrƒ  r&   )ÚtimeblockedsectionÚfinrv   r   Úreadfile)rP   r8  s     r8   Ú	_readfiler)  œ  sF   € Øˆtƒ|Ø×"Ñ" ;Õ/Ø—6‘6—;‘;“=÷ 0Ñ/ô �}Š}˜TÓ"Ð"÷ 0Õ/ús   ˜AÁ
A c                ój  • [        USS 5      nU(       a0  UR                  (       a  [        R                  " [	        S5      5      eUR                  S5      nUR                  S5      n	UR                  S5      n
UR                  S5      nU(       a&  U(       d  [        R                  " [	        S5      5      eUS:X  a3  [        XŠXbXY45      (       a  [        R                  " [	        S	5      5      eg US:X  a3  [        X†X%U	45      (       a  [        R                  " [	        S
5      5      eg US:X  a2  [        X†U45      (       a  [        R                  " [	        S5      5      eg U(       aU  U(       a  [        R                  " [	        S5      5      e[        U5      S:”  a  [        R                  " [	        S5      5      eg UR                  U5        [        U5      S:X  a*  [        R                  " X5      nUb  UR                  U5        [        U5      S:w  a  [        R                  " [	        S5      5      eg )NÚmqs   source has mq patches appliedr  r!  r  r  s$   --force only allowed with --outgoingr  s$   no arguments allowed with --continues!   no arguments allowed with --abortr  s1   only --commands argument allowed with --edit-plans$   no revisions allowed with --outgoingr>   s.   only one repo argument allowed with --outgoingr   r÷  )ÚgetattrÚappliedr   ra  r   r  r   Úanyr6   rF   r   rÿ  rE   )rP   r\   r  r.  Ú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           	     ó¸  • U R                  SU5      nUR                  5         [        U5      nUR                  S/ 5      nU R	                  SS5      (       + nUR                  SS5      n	UR                  SS5      Ul        [        XX4XiU5        Sn
U(       an  [        R                  " X5      nU Vs/ s H  o±U   PM	     nnU H>  nUR                  5        Vs/ s H  oîS	:w  d  M
  UPM     nnU
(       a  M3  [        U5      n
M@     U
(       a=  U R                  [        S
5      SS9(       a  [        R                  " [        S5      5      eU[        :X  a  UR!                  5         [#        XU5      nO9U[$        :X  a  ['        XX)5        g U[(        :X  a  [+        XX(S9  g [-        XX'X45        [/        XU5        [1        XX%5        UR3                  5         g s  snf s  snf )Nr&   rö  r  ó   backup-bundlerû  r;   rm   Fs   tips{   warning: tags associated with the given changeset will be lost after histedit.
do you want to continue (yN)? $$ &Yes $$ &Nor>   r$   s   histedit cancelled
©Únobackup)Ú	formatterÚ	startitemr  r  rO   r]   r3  r   r  Útagsr6   Úpromptchoicer   r   ÚCanceledErrorr"  rv   Úbootstrapcontinuer$  Ú_edithisteditplanr#  Ú_aborthisteditÚ_newhisteditÚ_continuehisteditÚ_finishhisteditrÂ  )rP   r\   r   r  r.  Úfmr/  rÓ  r7  r€   ÚhastagsrÈ   rV  rå   Útagr:  s                   r8   r  r  Ô  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   Â1GÃ	GÃ%Gc                óf  • UR                   SS n[        [        X3SS S/-   5      5       HM  u  nu  pVUR                  S:X  d  M  U(       d  M#  UR                  S:X  d  M5  [        UR                   U   l        MO     UR                  5         SnU R                  SS5      (       a  UR                  S5      nU R                  [        S5      [        S5      [        UR                   5      S9nU   [        R                  " U5         UR                   (       aÙ  UR                  US	9  UR                   S
   n	UR                  U	R                  5       S9  U R!                  SU	R                  U	R                  5       4-  5        U	R#                  5       u  p«U
R%                  5       Ul        UR(                  R+                  U5        UR                   R-                  S
5        UR                   (       a  MÙ  SSS5        SSS5        UR                  5         g! , (       d  f       N'= f! , (       d  f       N0= f)zwThis function runs after either:
- bootstrapcontinue (if the goal is 'continue')
- _newhistedit (if the goal is 'new')
Nr>   r€  r&   r*   s   editings   changes)rÍ  Útotal)r‰   r   )Úitems   histedit: processing %s %s
)rI   rO  Úzipr�   r¯  rs  r‹   rO   ÚtransactionÚmakeprogressr   r6   r   ÚacceptinterventionÚ	incrementré   rq  rñ   r¼   r_   rf   rF   Úpop)rP   r\   r   rI   Úidxr—   Únextactr‰   ÚprogressÚactobjrŒ  Úreplacement_s               r8   rA  rA    s¨  € ð �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Ç0H"È
H	ÈH"È"
H0c                óä  ^• [         R                  " XR                     5        [        U5      u  pEpgU(       a¦  UR	                  5        H’  u  p‰U	(       d  U R                  S[        U5      -  5        M+  U R                  S[        U5      [        U	S   5      4-  5        [        U	5      S:”  d  Mg  Sn
U	SS  H   nU R                  U
[        U5      -  5        M"     M”     UR                  (       d  U(       a  [        XR                  U5        O0 nU H  nX±;   d  M
  SXK'   M     UR                  5       R                  R                  R                  mUR	                  5        VVs0 s H2  u  pÍT" U5      (       d  M  [        U4S jU 5       5      (       d  M0  XÍ_M4     nnn[         R"                  " XS	5        UR$                  nUR&                  nUR(                  nU" UR	                  5        VVVs0 s H*  u  nnU" U5      U" U Vs/ s H
  o¾" U5      PM     snS
S9_M,     snnnSSS9nUR+                  US9  UR-                  5         [.        R0                  R3                  UR5                  S5      5      (       a%  [.        R6                  " UR5                  S5      5        UR8                  R3                  S5      (       a  UR8                  R7                  S5        ggs  snnf s  snf s  snnnf )z7This action runs when histedit is finishing its sessions   histedit: %s is dropped
s   histedit: %s is replaced by %s
r   r>   s'   histedit:                            %sNr¸   c              3  ó4   >#   • U  H  nT" U5      v •  M     g 7fr4   r¸   ©r‘   r�  Úhas_nodes     €r8   r“   Ú"_finishhistedit.<locals>.<genexpr>S  s   øé € Ð6²A¨q™x¨Ÿ{˜{²Aùs   ƒr&   s   node)r  s   oldnodes   newnodes)r=   Úvalue)Únodechangess   undoó   histedit-last-edit.txt)r*  r÷   r_   ÚprocessreplacementÚitemsrq  r   r6   r]   Úmovetopmostbookmarksr^   Ú
unfilteredÚ	changelogr¢   rW  r&  r   ÚcleanupnodesÚhexfuncÚ
formatlistÚ
formatdictru   r¯   Úosr8  rq   Úsjoinr­   rz   )rP   r\   r   rC  ÚmappingÚtmpnodesÚcreatedÚntmÚprecÚsuccsÚmr�  Úkr7   ÚhfÚflÚfdÚoldnÚnewnrZ  rW  s                       @r8   rB  rB  0  s_  ø€ ä‡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 Ç2K+ÈK&È
K+Ë&K+c           	     óÂ  •  UR                  5         [        U5      u  pEpdU R                  S[        UR                  5      -  5        UR                  U;  a®  UR
                  (       a�  UR                  R                  UR
                  5      n[        R                  " X5      n[        R                  " XU5      n	UR                  S5       n
[        R                  " UU	U
SSU-   S9  S S S 5        [        R                   " U5        UR#                  5       R%                  SUR&                  XV-  5      (       a   [        R(                  " XR                  SSS9  [+        XXcS	9  [+        XXSS	9   UR5                  5         g ! , (       d  f       Nœ= f! [,         a1    UR/                  5       (       a  U R1                  [3        S
5      5        e f = f! UR5                  5         f = f)Ns   restore wc to old parent %s
s   histedit.abortr&   s   bundle:)r±  Úurls   parents() and (%n  or %ln::)T)Ú
show_statsrõ   r6  sr   warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
)rv   r\  rq  r   r^   rb   rz   rC   r   Úopenpathr   Ú
readbundlerJ  r   Úapplybundlere  r  r_  rÓ  r_   ÚcleanÚcleanupnodeÚ	Exceptionr¬   r  r   r¯   )rP   r\   r   r7  Ú__Úleafsrh  rb   rŠ   Úgenr‰   s              r8   r?  r?  j  sƒ  € ð)Ø�
‰
ŒÜ"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=Ã'BF Å=
FÆF Æ;G	Ç	G ÇGc           	     ó  • [        U5      nU R                  SS5      (       + nUR                  5        oAR                  5        nXBl        XRl        [	        XX#S9  S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nr  r5  r6  )rX   rO   ra   r`   r?  )rP   r\   r   r7  ra   r`   s         r8   Úhgaborthisteditr�  —  sZ   € Ü˜$Ó€EØ—=‘= Ð-=Ó>Ô>€HØ	�‰Œ˜§	¡	¤¨tØŒØŒ
Ü�r Ò:÷ !,�ˆ§¥ú��ús#   ³A<ÁA+ÁA<Á+
A9	Á5A<Á<
B
c                ó¸  • UR                  5         U(       dK  [        U [        UR                  5      [        UR                  5      5      n[        XUR                  U5      nO[        X5      n[        X25      nUR                   Vs/ s H#  ofR                  (       d  M  XR                     PM%     nn[        XXRU5        XRl        UR                  5         g s  snf r4   )rv   rV   r   r_   r^   Ú
ruleeditorrI   r)  rt   r¼   Úwarnverifyactionsr‹   )rP   r\   r   r€   ÚcommentrI   ÚactrV  s           r8   r>  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ùò As   ÂCÂCc                ó*  • UR                  S5      nUR                  SS5      nUR                  S5      n[        R                  " U5        [        R                  " U5        UR                  R                  5       n	U(       a  U(       a  US   n
OS n
[        XX¨U5      nOp[        UR                  S[        R                  " X5      5      5      n[        U5      S:w  a  [        R                  " [        S5      5      eUS   R                  5       n[!        XX’R"                  5      nU(       d+  [        R                  " [        S	5      [%        U5      -  5      eU Vs/ s H  oÑU   PM	     nnUS    nUS
   /nUS   R                  5       /U-    H  n [&        R(                  " UUUUSSSSS9  M!     U(       dH  [/        U [%        U5      [%        U	5      5      nU Vs/ s H  n[1        X-5      PM     nn[3        XUU5      nO[5        X5      n[7        Xr5      n[9        XUX.5        X   R                  5       R                  5       nUUl        UUl        X’l        / Ul         U RC                  SS[        U5      [        U5      S9  S n[D        RF                  " U[D        RH                  5      (       d  [J        RL                  " UU/U	/US5      nUUl'        g s  snf ! [        R*                   a#    [        R,                  " [        S5      U-  5      ef = fs  snf )Nr  rû  r;   r  r   rø  r>   rù  rú  r  F)ÚbranchmergerÉ  ÚacceptremoteÚfollowcopiess>   untracked files in working directory conflict with files in %sr&   s   %d actions to histedit
)Úhistedit_num_actions)(r  r	   rý  rþ  rù   r(  rÙ  rI  rJ  r   r  r6   r   r   r   r¼   r  r]   r   r*  Úcalculateupdatesri  ra  rV   ro  rƒ  r)  rt   r„  r_   rI   r^   rf   Úlogr   Ú	isenabledÚcreatemarkersoptr   Úbackupbundlerb   )rP   r\   r   rÓ  r  r.  r0  r€   rÉ  r^   rÔ  r  r  r’   rV  ÚwctxÚancsrW  r…  rI   r_   rb   s                         r8   r@  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                  " U R                  5       5      $ r4   )r    rá   r  )rå   s    r8   Ú_getsummaryr”  	  s   € Ü×Ò §¡Ó 1Ó2Ð2r;   c                óØ  • UR                   n[        R                  R                  U5      n[        R
                  " U5        UR                  (       a—  UR                  R                  S5      n[        U5      (       a*  UR                  5         [        U5      (       a
  [        5         UR                  5       u  pgUR                  5       Ul        UR                  R                  U5        U$ r`  )r\   Úmergestatemodr   rv   r   ÚcheckunresolvedrI   rN  r_  rï   rb  rð   r¼   r_   rf   rF   )rP   r   r.  r\   ÚmsrR  rŒ  rf   s           r8   r=  r=  	  sª   € Ø�:‰:€Dä	×	!Ñ	!×	&Ñ	& tÓ	,€BÜ×Ò˜bÔ!à‡}‡}Ø—‘×"Ñ" 1Ó%ˆä�d×ÑØ× Ñ Ô"Ü˜$×ÑÜ”à"(×"6Ñ"6Ó"8Ñˆ	à'Ÿn™nÓ.ˆÔØ×Ñ×!Ñ! ,Ô/à€Lr;   c                ó¤  • U R                  S0 5      nUR                  5         [        U5      nUR                  5        oAR	                  5        nXCl        XSl        UR                  5         [        XS 5      n[        XU5        [        XX25        UR                  5         S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nr  )
r8  r9  rX   ra   r`   rv   r=  rA  rB  rÂ  )rP   r\   rC  r   ra   r`   s         r8   Úhgcontinuehisteditrš  +	  s‡   € Ø	�‰�k 2Ó	&€BØ‡L�L„Nä˜$Ó€EØ	�‰Œ˜§	¡	¤¨tØŒØŒ
Ø�
‰
ŒÜ! "¨TÓ2ˆÜ˜" EÔ*Ü˜ %Ô,Ø
�‰Œ÷ !,�ˆ§¥ú��ús$   ¾CÁAB0ÂCÂ0
B>	Â:CÃ
Cc                ó2  • U R                  SX5      nU(       aT  U(       dM  [        R                  " XS5        U R                  SU5      (       a  [        R                  " [        S5      5      e[        R                  " U R                  R                  U5      $ )zkselect and validate the set of revision to edit

When keep is false, the specified set can't have children.s   %n::%nrw  s   (%ld) and merge()s(   cannot edit history that contains merges)
rÓ  r   Úprecheckr   ra  r   r   Úmaplistr`  r¼   )r\   ÚoldrY  r]   rÓ  s        r8   r  r  :	  sv   € ð �9‰9�Y Ó)€DÞ–DÜ×Ò˜T¨Ô1Ø�9‰9Ð)¨4×0Ñ0Ü×"Ò"ÜÐ=Ó>óð ô ×Ò˜DŸN™N×/Ñ/°Ó6Ð6r;   c                ó>  • U R                   R                  SS5      (       GaR  [        R                  " 5       nU GH  nXR                     n[        U5      nUR                  SS5      S   R                  5       nSn	UR                  S5      (       a   USS	 nU[        [        -  [        -  ;   aƒ  X…l        U[        U5      S-   S R                  5       n
[        [!        UR#                  5       5      5       H8  u  p¼XR                     n[        U5      nXê:X  d  M%  S
n	UR%                  U5          O   U	(       a  GM  / XE'   GM	     / nUR#                  5        H  u  p¼UR%                  U5        X,-  nM     SR'                  U Vs/ s H  oUR)                  5       PM     sn5      nUS-  nXó-  nUR+                  UUR-                  5       SS0U R.                  SS9nU R1                  SS5       nUR3                  U5        SSS5        U$ s  snf ! , (       d  f       U$ = f)z]open an editor to edit rules

rules are in the format [ [act, ctx], ...] like in state.rules
r"   r#   r¿   r>   r   Fó   !Nrœ   Tr1   s   

s   prefixr&   )Úrepopathr—   r[  s   wb)rP   rO   r   Úsortdictr¼   r”  rA   ÚlowerÚendswithrL   rM   rN   r�   r6   ÚlstripÚreversedrI  r]  rE   rC   ré   rE  Úusernamer8  rz   r‹   )r\   rP   rI   ÚeditcommentÚnewactr†  rå   ræ   ÚfwordÚaddedÚtsumÚnarU   ÚactxÚasumr€   rŠ   s                    r8   rƒ  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È
Hc                óØ  • S U R                  5        5        Vs/ s H&  nU(       d  M  UR                  S5      (       a  M$  UPM(     n n/ nU  H”  nSU;  a"  [        R                  " [	        S5      U-  5      eUR                  SS5      u  pVU[        ;  a"  [        R                  " [	        S5      U-  5      e[        U   R                  X5      nUR                  U5        M–     U$ s  snf )z@Read the histedit rules string and return list of action objectsc              3  ó@   #   • U  H  oR                  5       v •  M     g 7fr4   )rÀ   r�   s     r8   r“   Úparserules.<locals>.<genexpr>‡	  s   é € Ð8Ò%7 —'‘'—)�)Ò%7ùs   ‚ó   #r¿   s   malformed line "%s"r>   s   unknown action "%s")	r[  r{   r   rÅ   r   rA   r?   rË   rE   )r€   r   rU   rI   r’   r�   r‚   r—   s           r8   rt   rt   ƒ	  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#U5        g ! [        R                   a<    UR                  R	                  S5      (       a  U R                  [        S5      5        e f = f)Nr[  s=   warning: histedit rules saved to: .hg/histedit-last-edit.txt
)Úverifyactionsr   rÅ   rz   rq   r  r   )rP   r\   rI   r   rV  s        r8   r„  r„  ˜	  sX   € ð
Ü�g dÕ+øÜ×Ñó Ø�8‰8�?‰?Ð4×5Ñ5Ø�G‰GÜð8óôð 	ðús
   ‚ �AAc                óB  • U Vs1 s H  o3R                  5       iM     nn[        5       nSnU (       aB  U S   R                  S;   a/  [        R                  " [        S5      U S   R                  -  5      eU  HA  nUR                  XdU5        UnUR                   c  M&  UR                  UR                   5        MC     [        XE-
  5      nUR                  R                  R                  SS5      (       aV  [        U 5      S:X  a'  [        R                  " [        S5      [        S5      S	9eU V	s/ s H  n	[        X5      PM     n
n	X SS& gU(       aE  [        R                  " [        S
5      [        US   5      -  [        S5      [        US   5      -  S	9egs  snf s  sn	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'   s   no rules provideds%   use strip extension to remove commitsrØ   s   missing rules for changeset %ss@   use "drop %s" to discard, see also: 'hg help -e histedit.config')r¼   rJ  r�   r   rÅ   r   rÕ   rf  rD   r\   rP   rO   r6   rÀ  r   )rI   r   rV  rW  rÒ   rÓ   rÑ   r—   r\  r�  Údropss              r8   rµ  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Ä.Fc                óÔ  • [         R                  " U [         R                  5      (       d  U$ U R                  5       nUR                  R
                  R                  nU R                  n[        U5      nU Vs/ s H  ofS   PM	     nn[        5       R                  " U6 n[        U5      n	U	(       a²  U	R                  5       n
U" U
5      SL nUR                  R                  U
S5      nU(       a  U(       d  UR                  U
S45        U HL  nUS   nUR                  X®45        U H,  nXø;  d  M
  UR                  U5        U	R                  U5        M.     MN     U	(       a  M²  U$ s  snf )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¸   )r   rŽ  r�  r_  r`  r¢   Úget_revÚobsstorerI  rJ  ÚunionrN  Ú
successorsr  rE   rf  )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   Á8E%c                ó8  • [        U R                  U R                  5      n[        5       n[        5       n0 nU HZ  nUR	                  US   5        UR                  US   5        UR                  US   [        5       5      R	                  US   5        M\     X#-
  nX#-  n[        U5      n0 n	U(       ay  [        U5       Ha  n
XJ   n[        U5       H6  nXÈ;   a    M  XÉ;   d  M  UR                  U5        UR	                  Xœ   5        M8     X¹U
'   UR                  U
5        Mc     U(       a  My  U H  nX�	 M     U R                  R                  R                  R                  nU	R                  5        H  u  pû[        X¾S9XŸ'   M     U(       a+  [        X`R                  R                  R                  S9S   nO`U	(       d  SnOVU R                  R                  R                  nU R                  [        U	US9S      R                  5       R!                  5       nX—UU4$ )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>   r   r<   rœ   N)rÇ  r\   rf   rJ  r÷   rf  Ú
setdefaultrI  r  r`  r¢   r¹  r]  rD   rÈ   r(  r¼   )r   rf   ÚallsuccsÚreplacedÚfullmappingÚreprY  rh  Ú	toproceedÚfinalr/  rl  Úsr�  r¹  rk  Ú
newtopmostr’   s                     r8   r\  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(       a  U(       d  gU R                  U5      nU(       ao  U R                  5          U R                  S5       nU R                  n/ nU H  nUR	                  Xr45        M     UR                  XU5        SSS5        SSS5        gg! , (       d  f       N= f! , (       d  f       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&   )rN  r`   rJ  Ú
_bookmarksrE   rø   )r\   Ú
oldtopmostrÑ  Ú	oldbmarksr‰   ÚmarksÚchangesr  s           r8   r^  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)Â)
B7c                ó’  ^• UR                  5          UR                  5       nUR                  R                  R                  m[        U4S jU 5       5      nUR                  SU5       Vs/ s H  oDR                  5       PM     nnU(       a  U(       + n[        R                  " XXVS9  SSS5        gs  snf ! , (       d  f       g= f)z`strip a group of nodes from the repository

The set of node to strip may contains unknown nodes.c              3  óF   >#   • U  H  nT" U5      (       d  M  Uv •  M     g 7fr4   r¸   rV  s     €r8   r“   Úcleanupnode.<locals>.<genexpr>U
  s   øé € Ð7¢%˜Q©8°A¯;—q‘q¢%ùs   ƒ!˜	!rÊ  )ÚbackupN)
r`   r_  r`  r¢   rW  rD   rJ  r¼   r   rÀ   )rP   r\   Únodesr7  rW  rØ  rÛ  rW  s          @r8   r{  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   ’AB8Á,B3Â%B8Â3B8Â8
Cc                óÀ  • [        U[        5      (       a  U/n[        U5      nUR                  5       (       a•  UR	                  5         UR
                   Vs1 s H!  owR                  (       d  M  UR                  iM#     nnU[        U5      -  n	U	(       a8  [        R                  " [        S5      SR                  S U	 5       5      -  5      eU " XU/UQ70 UD6$ s  snf )Ns$   histedit in progress, can't strip %sr2   c              3  ó8   #   • U  H  n[        U5      v •  M     g 7fr4   )r   )r‘   r/  s     r8   r“   Ústripwrapper.<locals>.<genexpr>i
  s   é € Ð<ª|¨!œU 1ŸX˜Xª|ùr•   )Ú
isinstancer+  rX   r¬   rv   rI   r¼   rJ  r   ri  r   rC   )
ÚorigrP   r\   ÚnodelistÚargsr  r   r—   Ú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Á/CrÀ   c                ó"  • [        U5      nUR                  5       (       d  g UR                  5         UR                  (       aM  U R	                  [        S5      U R                  [        S5      S5      [        UR                  5      -  -  5        g g )Ns!   hist:   %s (histedit --continue)
s   %d remainings   histedit.remaining)rX   r¬   rv   rI   r‹   r   Úlabelr6   )rP   r\   r   s      r8   Úsummaryhookré  q
  sr   € Ü˜$Ó€EØ×Ñ×ÑØØ	‡J�J„LØ‡}‡}à
�‰ÜÐ3Ó4à—‘œ˜?Ó+Ð-BÓCÜ�e—m‘mÓ$ñ%ñõ	
ð r;   c           	     óŽ   • [         R                  R                  S[        5        [        R
                  " SSSS[        [        S9  g )Nr&   r[   T)ÚfnameÚallowcommitÚcontinueflagÚ	abortfuncÚcontinuefunc)r	   Úsummaryhooksrf  ré  rc   Úaddunfinishedr�  rš  )rP   s    r8   Úextsetuprò  �
  s8   € Ü×Ñ×Ñ˜[¬+Ô6Ü×ÒØØØØÜ!Ü'ór;   rÕ  )FF)NFNr4   )r;   )’ré  Ú
__future__r   r  r  ÚImportErrorrÁ   r  re  r}   r  Úmercurial.i18nr   Úmercurial.noder   r   r   Ú	mercurialr   r	   r
   r   r   r   r   r   r   r   r   r   r   r*  r   r–  r   r   r   r   r   r   r   r   rc   r   Úmercurial.utilsr   r    r!   ÚcmdtableÚcommandÚconfigtableÚ
configitemÚ
testedwithr?   rJ  rL   rM   rN   rg  rV   rX   rº   r  rø   rZ  r_  rb  r—   ro  rE  rƒ  rX  r¯  r¶  rÀ  r@   rÙ  ra  rÇ  r  rc  rv  rá  rs  rx  r…  r†  r‡  rz  rw  ru  r¡  r¢  r£  r¤  r¦  r¥  r˜  rA  rE  rD  r   r™  r
  r  r(  r4  r7  r9  r;  rô  r  ÚformatteroptsÚCATEGORY_CHANGE_MANAGEMENTr  r	  r"  r#  r$  r  r  r)  r3  r  rA  rB  r?  r�  r>  r@  r”  r=  rš  r  rƒ  rt   r„  rµ  rÇ  r\  r^  r{  ræ  Úwrapfunctionré  rò  r¸   r;   r8   Ú<module>r     sã  ðñxõt #ðÛÛó
 Û Û 	Û Û å ÷ñ ÷
÷ ÷ ÷ ÷ ÷ ñ ÷2ñ ð €Ø
×
Ò
˜HÓ
%€à€Ø×!Ò! +Ó.€
Ù 
ØØØòñ
 ØØØòñ
 ØØØòñ
 ØØØòñ
 ØØØòñ
 Ø	ØØòñ
 ˆ;Ð+Ð5NÒ Oñ ØÐ'°ÀTòð #€
à€Ù“€Ù“5Ð Ù“%€Ù“%€ò0E÷fH7ñ H7÷VF1ñ F1ò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€àØñ€ð
 CPÑ ?€
ˆ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*€òZM÷<ñ <ò~ôò $ò!÷{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/ð €Ø€	Ø€Ø
€òò#ò-ò`-ò`)òX73ôt*òZ;òò ^"òB3òò,ò7ô8òvò*ò*
òZ#òL;,ò|2ô$9ò&5ð$ × Ó ˜ ¨Ô 6ò
ó 	øðuM ó Ø€EØƒGðûðV ó ØƒFðús#   ŠO È!O$ Ï
O!Ï O!Ï$O0Ï/O0