a —+«b>ã@s° dZddlmZmZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZddlmZmZmZddlmZmZmZmZmZmZmZmZmZmZm Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z,ddl-m.Z.m/Z/m0Z0ej1Z1d d de d ƒfgZ2iZ3e$ 4e3¡Z4d Z5iZ6e$ 7e6¡Z7e7d ddde7d ddde7d ddde7d dddze 8d¡Wn4e9y–Gdd„de:ƒZ;e Z?Gdd„de:ƒZ@gd¢ZAdddd œZBd!d"„ZCd#d$„ZDGd%d&„d&e:ƒZEd'd(„ZFGd)d*„d*ejGƒZHGd+d,„d,e:ƒZId-d.„ZJe4d/d0d1de d2ƒfd3d4ge d5ƒe d6ƒfge d7ƒe4jKd8d9d:„ƒZLe4d;dƒfge2e d?ƒe4jKd8d9d@dA„ƒZMe4dBddédꄃZne4dëge dìƒe4jKd8d?dídZoe4dïdŸdðde dñƒfd˜dòde dóƒfge dôƒe4jKd8dõdö„ƒZpe4d÷d_døde dùƒfdLdMde dúƒe dOƒfdIdûde düƒfdPdQde dýƒfgej_e dþƒe4jKd8dÿd„ƒZqe4ddLdÇde dƒfd dde dƒfddde dƒfddde dƒfge d ƒe4jKd8d d „ƒZre4d dÙd de dƒfge dƒe4jKd8dd„ƒZse4ddÄdÅde dƒfddde dƒfd_dde dƒfddde dƒfddðde dƒfddde dƒfge dƒe4jKd8d@dd„ƒZtd d!„Zud"d#„Zvd$d%„Zwd&d'„Zxd(d)„Zyd*d+„Zze$ {¡Z{e{d,ƒd-d.„ƒZ|e|gZ}d/d0„Z~d1d2d3d4d5d6d5d7œZdS(Aa manage a stack of patches This extension lets you work with a stack of patches in a Mercurial repository. It manages two stacks of patches - all known patches, and applied patches (subset of known patches). Known patches are represented as patch files in the .hg/patches directory. Applied patches are both patch files and changesets. Common tasks (use :hg:`help COMMAND` for more details):: create new patch qnew import existing patch qimport print patch series qseries print applied patches qapplied add known patch to applied stack qpush remove patch from applied stack qpop refresh contents of top applied patch qrefresh By default, mq will automatically use git patches when required to avoid losing file mode changes, copy records, binary files or empty files creations or deletions. This behavior can be configured with:: [mq] git = auto/keep/yes/no If set to 'keep', mq will obey the [diff] section configuration while preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq will override the [diff] section and always generate git or regular patches, possibly losing data in the second case. It may be desirable for mq changesets to be kept in the secret phase (see :hg:`help phases`), which can be enabled with the following setting:: [mq] secret = True You will by default be managing a patch queue named "patches". You can create other, independent patch queues with the :hg:`qqueue` command. If the working directory contains uncommitted files, qpush, qpop and qgoto abort immediately. If -f/--force is used, the changes are discarded. Setting:: [mq] keepchanges = True make them behave as if --keep-changes were passed, and non-conflicting local changes will be tolerated and preserved. If incompatible options such as -f/--force or --exact are passed, this setting is ignored. This extension used to provide a strip command. This command now lives in the strip extension. é)Úabsolute_importÚprint_functionN©Ú_)ÚbinÚhexÚnullrevÚshort)ÚdelattrÚgetattrÚopen)ÚcmdutilÚcommandsÚ dirstateguardÚencodingÚerrorÚ extensionsÚhgÚ localrepoÚlockÚ logcmdutilÚpatchÚphasesÚpycompatÚ registrarÚ revsetlangÚscmutilÚsmartsetÚstripÚ subrepoutilÚutilÚvfs)ÚdateutilÚ stringutilÚurlutilósósummarys print first line of patch headersships-with-hg-coreómqógitóauto)Údefaultó keepchangesFóplainósecretsstripc@seZdZdd„Zdd„ZdS)ÚdummyuicCsdS©N©)ÚselfÚmsgr0r0ú./usr/lib64/python3.9/site-packages/hgext/mq.pyÚdebug›sz dummyui.debugcOsdSr/r0)r1ZeventZmsgfmtZmsgargsÚoptsr0r0r3Úlogžsz dummyui.logN)Ú__name__Ú __module__Ú __qualname__r4r6r0r0r0r3r.šsr.ócCshg}|d}|r||}n| ¡}t|jƒD]6}| |¡ d¡||jvsX| |¡ ¡r,| |¡q,|S)zrreturn list of subrepos at a different revision than substate. Abort if any subrepos have uncommitted changes.NT)Úp1ÚsortedÚsubstateÚsubZ bailifchangedZdirtyÚappend)ÚrepoZbaserevÚinclsubsÚwctxZbctxÚsr0r0r3Ú checksubstate¦s  rDc@s0eZdZdd„Zdd„Ze e¡Ze e¡ZdS)Ú statusentrycCs|||_|_dSr/©ÚnodeÚname)r1rGrHr0r0r3Ú__init__¼szstatusentry.__init__cCst|jƒd|jS)Nó:)rrGrH©r1r0r0r3Ú __bytes__¿szstatusentry.__bytes__N) r7r8r9rIrLrÚ strmethodÚ__str__Ú__repr__r0r0r0r3rE»s rE)ó# User ó# Date s# ó # Branch ó # Node ID ó # Parent éé)sfromódatessubjectc Csº| d¡d}t |¡}t|ƒ}t|t|ƒƒD]v}||}| d¡sRt||ƒ}q¦ttƒD]H\}} | | ¡rZ||krŒ||||<|S||kržt||ƒ}q.qZq.| |||¡|S)aAssuming lines contains a HG patch header, add a header line with value. >>> try: inserthgheader([], b'# Date ', b'z') ... except ValueError as inst: print("oops") oops >>> inserthgheader([b'# HG changeset patch'], b'# Date ', b'z') ['# HG changeset patch', '# Date z'] >>> inserthgheader([b'# HG changeset patch', b''], b'# Date ', b'z') ['# HG changeset patch', '# Date z', ''] >>> inserthgheader([b'# HG changeset patch', b'# User y'], b'# Date ', b'z') ['# HG changeset patch', '# User y', '# Date z'] >>> inserthgheader([b'# HG changeset patch', b'# Date x', b'# User y'], ... b'# User ', b'z') ['# HG changeset patch', '# Date x', '# User z'] >>> inserthgheader([b'# HG changeset patch', b'# Date y'], b'# Date ', b'z') ['# HG changeset patch', '# Date z'] >>> inserthgheader([b'# HG changeset patch', b'', b'# Date y'], ... b'# Date ', b'z') ['# HG changeset patch', '# Date z', '', '# Date y'] >>> inserthgheader([b'# HG changeset patch', b'# Parent y'], ... b'# Date ', b'z') ['# HG changeset patch', '# Date z', '# Parent y'] ó# HG changeset patchrUó# )ÚindexÚ HGHEADERSÚlenÚrangeÚ startswithÚminÚ enumerateÚinsert) ÚlinesÚheaderÚvalueÚstartZnewindexÚbestposÚiÚlineZ lineindexÚhr0r0r3ÚinserthgheaderØs$       rjc CsÄt| ¡}t|ƒ}t|ƒD]Ž\}}d|vrŠ| dd¡d ¡ ¡}t ||d¡}||krtd||f||<|S||krª||krª|}q|rš| |d¡||kr¦|}q¬q| |d||f¡|S)a»For lines containing a plain patch header, add a header line with value. >>> insertplainheader([], b'Date', b'z') ['Date: z'] >>> insertplainheader([b''], b'Date', b'z') ['Date: z', ''] >>> insertplainheader([b'x'], b'Date', b'z') ['Date: z', '', 'x'] >>> insertplainheader([b'From: y', b'x'], b'Date', b'z') ['From: y', 'Date: z', '', 'x'] >>> insertplainheader([b' date : x', b' from : y', b''], b'From', b'z') [' date : x', 'From: z', ''] >>> insertplainheader([b'', b'Date: y'], b'Date', b'z') ['Date: z', '', 'Date: y'] >>> insertplainheader([b'foo: bar', b'DATE: z', b'x'], b'From', b'y') ['From: y', 'foo: bar', 'DATE: z', '', 'x'] rJrUró%s: %sr:)Ú PLAINHEADERSÚlowerr\r`ÚsplitrÚgetra) rbrcrdZnewpriorfrgrhZlheaderZlprior0r0r3Úinsertplainheaders$  rpc@sPeZdZddd„Zdd„Zdd„Zdd „Zd d „Zd d „Ze   e¡Z dd„Z dS)Ú patchheaderFcCsÎdd„}dd„}g}g}d}d}d} d} d} d} d} d}t|dƒD]Ú}| ¡}| d¡sh|rr| d¡rrd }q d}| d ¡rŠd }qBnŠ| d kr4| d ¡r¬|dd…}n†| d¡rÄ|dd…}nn| d¡rà|dd… ¡} nR| d¡rø|dd…} n:| d¡r|dd…} n | d¡s|r| |¡d} nà|dkrHg}d } nÌ| dkr|| d¡sj| d¡r||dd…} d} n˜| dkr°| d¡sž| d¡r°|dd…}d} nd| dkrä| d¡sÒ| d¡rä|dd…}d} n0| dkrþ|d krþd} n|s |r| |¡| |¡qB||ƒ||ƒt|ƒ|_||ƒ||ƒ| rn|  d¡rn| rn| d| ¡||_||_ ||_ ||_ | |_ | |_ | |_|d k|_|pÆd|j voÆtd!d"„|j Dƒƒ|_dS)#NcSs:|r6|d}| d¡s*| d¡s*| d¡r6|d=qq6qdS)Néÿÿÿÿsdiff -sIndex:s ===========©r^)rbÚlr0r0r3Úeatdiff+sÿþýz%patchheader.__init__..eatdiffcSs |r|d ¡s|d=qqqdS)Nrr©r)rbr0r0r3Úeatempty7s z&patchheader.__init__..eatemptyrsrbó diff --gits+++ rVs--- rUshgpatchrPérQs # Parent é rRrSé rYrXstagdones Subject: ó subject: stagóFrom: sfrom: éóDate: sdate: r:css"|]}| d¡p| d¡VqdS)rr}Nrs)Ú.0Úcr0r0r3Ú •sÿz'patchheader.__init__..)r Úrstripr^Úlstripr?r\Z diffstartlineraÚmessageÚcommentsÚuserÚdateÚparentÚnodeidÚbranchÚhaspatchÚanyÚ plainmode)r1ÚpfrŽrurwr…r†r‡rˆr‰ÚformatZsubjectr‹rŠZ diffstartrhr0r0r3rI*s²  ÿÿ          ÿÿ  ÿÿ  ÿÿ        þýzpatchheader.__init__cCs^zt|jd|ƒWn@tyR|jr6t|jd|ƒndd|g}||j|_Yn0||_dS)NrPsFromrX)rjr†Ú ValueErrorrŽrpr‡)r1r‡Útmpr0r0r3Úsetuser›s  zpatchheader.setusercCs^zt|jd|ƒWn@tyR|jr6t|jd|ƒndd|g}||j|_Yn0||_dS)NrQsDaterX)rjr†r‘rŽrprˆ)r1rˆr’r0r0r3Úsetdate¦s  zpatchheader.setdatecCsNzt|jd|ƒWn0tyB|js>dd|g}||j|_Yn0||_dS)NrTrX)rjr†r‘rŽr‰)r1r‰r’r0r0r3Ú setparent±s  zpatchheader.setparentcCsL|jr| ¡|g|_|rH|jr<|jr<|jdr<|j d¡|j |¡dS)Nrrr:)r†Ú_delmsgr…rŽr?)r1r…r0r0r3Ú setmessageºs zpatchheader.setmessagecCs d |j¡ ¡}|sdS|dS)Nó r:s )Újoinr†rƒ)r1rCr0r0r3rLÃszpatchheader.__bytes__cCs|jr\d|jd ¡}t t|jƒ¡D]2}||j| ¡kr(|j|=|jdd…|_q\q(d}|jD]$}||j|kr‚|d7}qj|j|=qfdS)z¤Remove existing message, keeping the rest of the comments fields. If comments contains 'subject: ', message will prepend the field and a blank line.r|rrVNrU)r…rmrÚxranger\r†)r1ZsubjrgZciÚmir0r0r3r–Ës  zpatchheader._delmsgN)F) r7r8r9rIr“r”r•r—rLrrMrNr–r0r0r0r3rq)s q     rqcOsŽ| ¡}|dur$|j dd¡r$tj}ddi}|dur<||d<|j |d¡0|j ddd¡|j|i|¤ŽWdƒS1s€0YdS) z¯helper dedicated to ensure a commit respect mq.secret setting It should be used instead of repo.commit inside the mq source for operation creating new changeset. Nr'r-)óuióallowemptycommitT)sphasess new-commitrœr)Ú unfilteredÚuiÚ configboolrÚsecretZconfigoverrideÚ setconfigÚcommit)r@ÚphaseÚargsÚkwargsZ overridesr0r0r3Ú newcommitÝsr§c@s eZdZdS)ÚAbortNoCleanupN)r7r8r9r0r0r0r3r¨ïsr¨c @s eZdZdwdd„Zejdd„ƒZejdd„ƒZejdd „ƒZejd d „ƒZ d d „Z dxdd„Z dd„Z dd„Z dd„Ze d¡Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zdyd$d%„Zd&d'„Zd(d)„Zdzd*d+„Zd{d,d-„Zd.d/„Zd|d0d1„Zd2d3„Zd4d5„Z d}d7d8„Z!d~d9d:„Z"dd;d<„Z#d=d>„Z$d?d@„Z%dAdB„Z&dCdD„Z'dEdF„Z(d€dGdH„Z)dIZ*dJdK„Z+ddLdM„Z,dNdO„Z-dPdQ„Z.dRdS„Z/dTdU„Z0d‚dVdW„Z1dƒdXdY„Z2d„dZd[„Z3d\d]„Z4d…d^d_„Z5d†d`da„Z6d‡dbdc„Z7dˆdedf„Z8dgdh„Z9d‰didj„Z:dŠdkdl„Z;d‹dmdn„Zdsdt„Z?ddudv„Z@dS)ŽÚqueueNc Cs8||_zjttj |d¡dƒ}| ¡ ¡}Wdƒn1s>0Y|s\tj |d¡}ntj |d|¡}Wn tytj |d¡}Yn0|p˜||_t  |j¡|_ ||_ ||_ d|_ d|_g|_d|_d|_d|_d|_d|_| d d ¡ ¡}t |¡} | dur| rd }nd }||_| d d ¡|_d|_dS)Nó patches.queueÚrbópatchesópatches-Fóseriesóstatusóguardsr'r(óyesónor,T)Úbasepathr ÚosÚpathr™ÚreadrƒÚIOErrorÚvfsmodr!ÚopenerrŸÚbaseuiÚ applieddirtyÚ seriesdirtyÚaddedÚ seriespathÚ statuspathÚ guardspathÚ activeguardsÚ guardsdirtyÚconfigrmr#Z parseboolÚgitmoder rŽÚ checkapplied) r1rŸrºrµÚpatchdirÚfhÚcurZcurpathrÄZboolmoder0r0r3rIôs<*    zqueue.__init__c st‡fdd„}z ˆj ˆj¡ ¡}t||ƒƒWStyn}z*|jtjkrXgWYd}~S‚WYd}~n d}~00dS)Nc3sb|D]X}| dd¡}t|ƒdkr:|\}}tt|ƒ|ƒVq| ¡rˆj tdƒt  |¡¡qdS)NrJrUsmalformated mq status line: %s ) rnr\rErrrŸÚwarnrr#Úpprint)rbrtÚentryÚnrHrKr0r3Ú parseliness  ÿÿz!queue.applied..parselines)r¹r¶r¿Ú splitlinesÚlistr·ÚerrnoÚENOENT)r1rÍrbÚer0rKr3Úapplieds  z queue.appliedc Cs\z|j |j¡ ¡WStyV}z*|jtjkr@gWYd}~S‚WYd}~n d}~00dSr/)r¹r¶r¾rÎr·rÐrÑ)r1rÒr0r0r3Ú fullseries0s  zqueue.fullseriescCs| ¡|jSr/)Ú parseseriesÚseriesrKr0r0r3rÖ9sz queue.seriescCs| ¡|jSr/)rÕÚ seriesguardsrKr0r0r3r×>szqueue.seriesguardscCs>d ¡D]}||jvrt||ƒqd|_d|_d|_d|_dS)Nz&applied fullseries series seriesguardsF)rnÚ__dict__r r»r¼rÂrÁ)r1Úar0r0r3Ú invalidateCs   zqueue.invalidateFcCsxtj|j|d| | d}|jdkr,d|_n8|jdkr8n,|jdvrP|jdk|_nt tdƒ|j¡‚|rt|  ||¡}|S)z„Return diff options tweaked for this mq use, possibly upgrading to git format, and possibly plain and without lossy options.T)ÚgitZ whitespaceZformatchangingr)ókeep)r±r²r±s,mq.git option can be auto/keep/yes/no got %s) ÚpatchmodZdifffeatureoptsrŸrÄÚupgraderÛrÚAbortrÚ patchopts)r1r5ÚpatchfnÚplainÚdiffoptsr0r0r3rãLs*û   ÿÿ zqueue.diffoptscGsN| ¡}|jsJ|jdkrJ|D],}| |d¡}tdd„|Dƒƒ|_| ¡q|S)zReturn a copy of input diff options with git set to true if referenced patch is a git patch and should be preserved as such. rÜórcss|]}| d¡VqdS)rxNrs)r€rhr0r0r3r‚nsz"queue.patchopts..)ÚcopyrÛrÄr¹rÚclose)r1rãÚpatchesráÚpatchfr0r0r3ràes ÿ  zqueue.patchoptscGstjj|jg|¢RŽSr/)r´rµr™)r1Úpr0r0r3r™tsz queue.joincs4‡fdd„}t|jƒD]\}}||ƒr|SqdS)Ncs| dd¡d}| ¡ˆkS)Nó#rUr)rnr)rt©rr0r3Ú matchpatchxsz$queue.findseries..matchpatch)r`rÔ)r1rrìrZrtr0rër3Ú findseriesws   zqueue.findseriess'\s?#([-+][^-+# \t\r\n\f][^# \t\r\n\f]*)cCs°g|_g|_|jD]˜}| d¡}|dkr2|}d}n$|dkr>qn|d|…}||d…}| ¡}|r||jvrŠt tdƒ|| |j ¡f¡‚|j  |¡|j  |j   |¡¡qdS)Nrêrrr:rs%s appears more than once in %s) rÖr×rÔÚfindrrrßrr™r¾r?Úguard_reÚfindall)r1rtrirZcommentr0r0r3rÕƒs*     ÿÿ zqueue.parseseriescCsZ|s tdƒSd}|d}|dvr0tdƒ||fS|D] }||vr4tdƒ||fSq4dS)Nsguard cannot be an empty strings# ró-+s*guard %r starts with invalid character: %rs!invalid character in guard %r: %rr)r1ÚguardZ bad_charsÚfirstrr0r0r3Ú checkguardšsþzqueue.checkguardcCsT|D]}| |¡}|rt |¡‚qtt|ƒƒ}|j dd |¡¡||_d|_ dS)Nsactive guards: %s ó T) rôrrßr<ÚsetrŸr4r™rÁrÂ)r1ÚguardsròÚbadr0r0r3Ú setactive¨s   zqueue.setactivec Cs´|jdur®g|_z|j |j¡ ¡}Wn6ty\}z|jtjkrD‚g}WYd}~n d}~00t|ƒD]F\}}|  |¡}|r |j   d|  |j¡|d|f¡qf|j  |¡qf|jS)Ns %s:%d: %s rU)rÁr¹r¶rÀrnr·rÐrÑr`rôrŸrÉr™r?)r1r÷Úerrrgròrør0r0r3Úactive²s$   ÿÿz queue.activecCsª|D]`}t|ƒdkr&t tdƒ|¡‚|ddvrDt tdƒ|¡‚| |dd…¡}|rt |¡‚q|j d|j|¡}|d dd „|Dƒ¡|j|<|  ¡d |_ dS) NrVsguard %r too shortrrñs!guard %r starts with invalid charrUr:cSsg|] }d|‘qS©s #r0©r€Úgr0r0r3Ú Ðr:z#queue.setguards..T) r\rrßrrôrïr>rÔr™rÕr¼)r1Úidxr÷rþrøZdropr0r0r3Ú setguardsÆs   zqueue.setguardscs®t|tƒr|j |¡}|j|}|s(dS| ¡‰‡fdd„|Dƒ}|rXdt |d¡fSdd„|Dƒ}‡fdd„|Dƒ}|rª|r’dt |d¡fSdd  d d„|Dƒ¡fSd S) N)TNcs*g|]"}| d¡r|dd…ˆvr|‘qS)ó-rUNrsrý©r÷r0r3rÿÛsz"queue.pushable..FrcSsg|]}| d¡r|‘qS)ó+rsrýr0r0r3rÿàr:cs g|]}|dd…ˆvr|‘qS©rUNr0rýrr0r3rÿár:TrõcSsg|]}t |¡‘qSr0)r#rÊ©r€rér0r0r3rÿår:)Tr:) Ú isinstanceÚbytesrÖrZr×rûr#rÊr™)r1rZ patchguardsZexactnegÚposZexactposr0rr3ÚpushableÔs$    ÿzqueue.pushablecCsâ|r|jj}n|jj}|s"|jjrÞt|tƒr8|j |¡}| |¡\}}|r¤|r¤|durn|t dƒ|j|ƒn6|sŠ|t dƒ|j|ƒn|t dƒ|j||fƒ|sÞ|rÈ|t dƒ|j||fƒn|t dƒ|j|ƒdS)Ns"allowing %s - no guards in effect s*allowing %s - no matching negative guards sallowing %s - guarded by %s sskipping %s - guarded by %s s!skipping %s - no matching guards ) rŸÚwriterÉÚverboserrrÖrZr r)r1rÚ all_patchesr r Úwhyr0r0r3ÚexplainpushableèsJ    ÿÿÿÿ ÿÿ ÿÿÿÿzqueue.explainpushablecsš‡fdd„}ˆjr,|ttˆjƒˆjƒdˆ_ˆjrF|ˆjˆjƒdˆ_ˆjr`|ˆj ˆj ƒdˆ_ˆj r–ˆ  ¡‰ˆrˆd  ‡fdd„ˆj Dƒ¡gˆ_ dS)Ncs0ˆ |d¡}|D]}| d|¡q| ¡dS)Nswbó%s )r¹r ræ)ÚitemsrµÚfprgrKr0r3Ú writelists z"queue.savedirty..writelistFc3s|]}|ˆdvr|VqdSr/r0)r€Úf)Úqrepor0r3r‚"r:z"queue.savedirty..)r»ÚmaprrÓr¿r¼rÔr¾rÂrÁrÀr½rÚadd)r1rr0)rr1r3Ú savedirtys zqueue.savedirtyc Csl| d¡}tj |¡sdSzt |¡Wn>tyf}z&|j tdƒt   |¡¡WYd}~n d}~00dS)Nsundoserror removing undo: %s ) Zsjoinr´rµÚexistsÚunlinkÚOSErrorrŸrÉrr#Ú forcebytestr)r1r@ZundoÚinstr0r0r3Ú removeundo%s  ÿzqueue.removeundocCsvt|ƒD]h}| |¡}tj |¡rt |j||¡}|j t dƒ|tj  |¡f¡|rdt   ||¡qt   ||¡qdS)Ns#saving current version of %s as %s )r<Úwjoinr´rµÚlexistsrZ backuppathrŸÚnoterÚrelpathr ÚcopyfileÚrename)r1r@ÚfilesrårZabsfZabsorigr0r0r3Úbackup0s   ÿÿz queue.backupc CsP|dur i}| d¡} t ||||¡} t |j||||||| || |¡ dS)Nsstat)rorÚmatchrZdiffordiffstatrŸ) r1r@rãÚnode1Únode2r%rÚchangesr5ÚstatÚmr0r0r3Ú printdiff@s  ÷zqueue.printdiffcCsr|j||gdd|d\}}|dkr*||fS|durDt tdƒ|¡‚|j tdƒ|¡t ||¡t|j||gddd||} tj | dd} | r¦t td ƒ| ¡‚t |d|   ¡|   ¡dd }|durÖt td ƒ¡‚zt | |¡|jƒ} Wn&tyt td ƒ|¡‚Yn0| ||¡}| |d ¡} t| ƒ} | rD|  | ¡|j||||| d|  ¡| |¡d|fS)NFT)Ú update_statusÚstrictÚmergersapply failed for patch %ss"patch didn't work out, merging %s ©Úupdater&)Zremindsupdate returned %d©Úforceórepo commit failedsunable to read %sów)r)ÚapplyrrßrrŸrÉrÚcleanrr0r§Ú descriptionr‡rqr™rŽÚ Exceptionràr¹rr r-rær)r1r@ÚmergeqÚheadrÚrevrãrúrÌÚctxÚretÚphrèr†r0r0r3Úmergeone[s< ÿ      zqueue.mergeonecCsp|dur:|j ¡\}}||jkr$|S|js.dS|jdjS|j |¡\}}||jkrl|dd„|jDƒvrl|S|S)areturn the mq handled parent or p1 In some case where mq get himself in being the parent of a merge the appropriate parent may be p2. (eg: an in progress merge started with mq disabled) If no parent are managed by mq, p1 is returned. NrrcSsg|] }|j‘qSr0©rG©r€Úxr0r0r3rÿ”r:z"queue.qparents..)ÚdirstateÚparentsÚnullidrÓrGÚ changelog)r1r@r=r;Úp2r0r0r3Úqparentsƒs   zqueue.qparentsc Cs$|js|j| ddq|j tdƒ| ¡tj || ¡}zt| | ¡|j ƒ}Wn2t y¨|j  tdƒ| ¡d} YqYn0|j }|s¾d| }n|rÐ|  d | ¡d  |¡}|jrj| r•r:z"queue._cleanup..s*revision %s refers to unknown patches: %s sunknown patches: %s r:c3s|]}ˆ|VqdSr/r0r©r2r0r3r‚›r:z!queue._cleanup..cSsg|] }|j‘qSr0rBrqr0r0r3rÿŸr:z"queue._cleanup..)rÚforgetr´rr™rrÐrÑrÓr»rír?ÚsortrÔrrŸrÉr rrßrÕr¼) r1rçÚnumrevsZkeepÚrrérÚ qfinishedÚunknownZ sortedseriesrrgr=r0rsr3Ú_cleanuppsL        "zqueue._cleanupc CsÊ||jdj ¡}g}t|ƒD]¤\}}||krBt tdƒ|¡‚||}|j|j}| ¡|krxtdƒ} t | |¡‚|j|j} dD]0} | ¡| | krˆtdƒ} |j   | | ¡qºqˆ|  | ¡q |S)Nrsrevision %d is not manageds/cannot delete revision %d above applied patches)ó[mq]: %ssimported patch %ss-patch %s finalized without changeset message ) rÓrGr=r`rrßrrHr9rŸrgr?) r1r@ÚrevsZfirstrevrçrgr=r>Úbaser2rZfmtr0r0r3Ú _revpatches¡s$    zqueue._revpatchescCsª|j| |t|ƒ¡}| |t|ƒ¡}|r¦|j dd¡r¦||d}t |j¡}|  ¡|kr¦|  ¡  ¡|kr¦|  d¡ }t  ||||¡Wdƒn1sœ0YdS)Nr'r-róqfinish) Z _phasecacher~r<rzr\rŸr rZnewcommitphaser¤r;r[Zadvanceboundary)r1r@r|rçrxZoldqbaseZtphaser_r0r0r3Úfinish¹s   z queue.finishc Csö|s| d¡st tdƒ¡‚g}|D]`}|j|dd}| |¡}|rVt tdƒ|¡‚||jvrrt tdƒ|¡‚||vr$| |¡q$d}| d¡rÞ|js¨t tdƒ¡‚t   || d¡¡}|  ¡|  ||¡} || 7}t | ƒ}| ||| d ¡¡dS) Nórevs4qdelete requires at least one revision or patch nameTrKscannot delete applied patch %sspatch %s not in series fileróno patches appliedrÜ)rorrßrrMrNrÖr?rÓrÚrevrangerur~r\rz) r1r@rçr5Z realpatchesrrQrvr|Z revpatchesr0r0r3ÚdeleteÇs0ÿ     z queue.deletecCsF|jrB|jdj}|jdj}|j ¡|kr:t tdƒ¡‚||fSdS)z'check that working directory is at qtiprrs&working directory revision is not qtip©NN)rÓrGrHrEr;rrßr)r1r@Útoprr0r0r3Ú checktoppatchäs  zqueue.checktoppatchcCs‚t|tƒr|dd…}n|j|j|jf}tdd„|Dƒƒr>dS|jsJ|jsZ|d d¡n$|jrp|d d¡n|d d¡dS)Nrfcss|]}d|vVqdS)rdNr0)r€r%r0r0r3r‚ór:z,queue.putsubstate2changes..rUrdrVr)rrÏÚmodifiedr½ÚremovedrZ any_trackedr?)r1Ú substatestater*Zmarr0r0r3Úputsubstate2changesîs  zqueue.putsubstate2changescCsšd}|rd}tdƒtdƒ| ¡}|sˆt |¡|jsJ|jsJ|jsJ|jrdtdƒt  td|ƒ¡‚t |ƒr–tdƒt  td|ƒ¡‚ntj|dd|S) Nr:s, qrefresh firstó#local changes found, qrefresh firsts,local changed subrepos found, qrefresh firstslocal changes foundslocal changed subrepos foundT)Z skipmerge) rrgr Zcheckunfinishedrˆr½r‰ÚdeletedrrßrD)r1r@r4ÚrefreshZ excsuffixrCr0r0r3Úchecklocalchangesýs$  ÿzqueue.checklocalchanges)r®r¯r°res..cCsŠ||jvrt tdƒ|¡‚|| ¡kr6t tdƒ¡‚dD] }| |¡r:t tdƒ|¡‚q:dD]$}||vr`t tdƒt |¡¡‚q`dS)Ns*"%s" cannot be used as the name of a patchs.patch name cannot begin or end with whitespace)ó.hgs.mqs!patch name cannot begin with "%s")rêrJó r˜s(%r cannot be used in the name of a patch)Ú _reservedrrßrrr^rZbytestr)r1rHÚprefixrr0r0r3Úcheckreservednames(  ÿ ÿ  ÿÿÿzqueue.checkreservednamecCs\| |¡|sXtj | |¡¡rXtj | |¡¡rFt tdƒ|¡‚nt tdƒ|¡‚dS)Ns""%s" already exists as a directoryspatch "%s" already exists) r”r´rµrr™Úisdirrrßr)r1rHr4r0r0r3Úcheckpatchname,s  ÿzqueue.checkpatchnamecCsªt dd| ¡¡ d¡}|dd…}|rRz| |¡WqVtjyN|}YqV0n|}|}d}||jvrz| |¡Wq¦WntjyŽYn0|d7}d||f}q^|S)zdReturn a suitable filename for title, adding a suffix to make it unique in the existing lists[\s\W_]+ó_NéKrrUs%s__%d) Úrer>rmrr”rrßrÔr–)r1ÚtitleZ fallbacknameZnamebaserHrgr0r0r3Ú makepatchname6s&    zqueue.makepatchnamecCs|r|rt tdƒ¡‚dS)Ns*cannot use both --force and --keep-changes)rrßr)r1rYr4r0r0r3ÚcheckkeepchangesOszqueue.checkkeepchangesc st |¡}| d¡}| d¡}| dd¡}| d¡}| d¡} | rLt | ¡} |jd| d¡idd } | d d¡rz| |¡t|ƒ} | r’|j  d ¡} | d ¡sª| d ¡sª|rÖdd„} t j |d||| d}|j |d}n|j |dd}t| ƒ}| |j¡| |j¡| |j¡t  ||¡}t|d ¡ƒdkr@t tdƒ¡‚| |¡| ¡}| ¡ z| |d¡}WnDty²}z*t tdƒ|t |j ¡f¡‚WYd}~n d}~00zÔd|‰t!j"|d}|rü‡fdd„}tdƒ}t!j"|||d}|}n |pˆ}t#|d||| |d|d}|dur6t tdƒ¡‚z8|g|j$||…<|j% &t'||ƒ¡| (¡d|_)d|_*||}t+| ,|¡|j-ƒ}|rš| .|¡| r®| /d | ¡| 0t1| 2¡ 3¡ƒ¡| 4¡ 5¡}|ˆ 5¡krâd!}| 6|¡| 7t8|ƒ¡|rH| 9||¡}| r| :| |¡t;j<||||| d"}|D]}| 7|¡q6| =¡| >¡}|rn|d ?|g¡Wn| @¡‚Yn0WnXtAyâ| ,|¡}ztB C|¡Wn(tDyÚ|jE Ftd#ƒ|¡Yn0‚Yn0| G|¡Wdƒn1s0YdS)$zToptions: msg: a string or a no-argument function returning a string ómsgóeditóeditformsmq.qnewóuserrWr(T©râs checknamerdsincludesexcludecSs|dkrt d||f¡‚dS)Nrdrk)rrß)rr2r0r0r3Úbadfngszqueue.new..badfnN)r¢©r'r3rUscannot manage merge changesetsr6scannot write patch "%s": %sr{©Úeditformcs| ¡r |SˆSdSr/)rƒ©Údesc©Ú defaultmsgr0r3Ú finishdesc†szqueue.new..finishdescó+Leave message empty to use default message.©rªÚextramsgr¥©r'r4Úeditorr5ó%d %dr:)r(r)r*r5serror unlinking %s )HrÚ byteskwargsror"Ú parsedaterãr–rDrEÚ get_entryrr'rgrrÏÚextendrˆr½r‰rlr\rFrrßrr‡Ú fullseriesendrZr¹r·rZ strtolocalÚstrerrorr Úgetcommiteditorr§rÔrÓr?rErÕr¼r»rqr™rŽr“r”r•rr;rGr9rr—r rrJr‹rÝÚdiffrærrZrollbackr:r´rrrŸrÉr) r1r@ráÚpatsr5r2Úeditr¥r‡rˆrãrArŠr¢r'r*Z commitfilesrarérÒr¯rªr­Z commitmsgrÌZnctxr@r‰ÚchunksÚchunkrwZ patchpathr0r¨r3ÚnewSsØ                ÿÿ  ý ø      û  z queue.newcCs4t|jƒD]$\}}|j|kr ||j|jfSq dS)zreturns (index, rev, patch)N)r`rÓrHrG)r1rrgrÙr0r0r3rNÒs zqueue.isappliedc sƇfdd„}|ˆjvr|Stj ˆ |¡¡s°z t|ƒ}WnttfyPYn20tˆjƒ |krttˆjƒkr‚nn ˆj|S|s°||ƒ}|r˜|S|  d¡}|dkr ||d|…ƒ}|r ˆj  |¡}zt||dd…pädƒ}WnttfyYn0||dkr ˆj||S|  d¡} | dkr°||d| …ƒ}|r°ˆj  |¡}zt|| dd…pndƒ}WnttfyŒYn$0||tˆjƒkr°ˆj||St   t dƒ|¡‚dS)NcsªˆˆjvrˆS‡fdd„ˆjDƒ}t|ƒdkr`ˆj tdƒˆ¡|D]}ˆj d|¡qFdS|rl|dSˆjr¦ˆjr¦ˆdkr”ˆjˆ d¡dSˆd kr¦ˆjdSdS) Ncsg|]}ˆ|vr|‘qSr0r0rC©rCr0r3rÿãr:z5queue.lookup..partialname..rUspatch name "%s" is ambiguous: s %s róqtipTóqbase)rÖr\rŸrÉrrÓÚ seriesend)rCÚmatchesr,rKr¾r3Ú partialnameàs     z!queue.lookup..partialnamerrrUrspatch %s not in series)rÖr´rµÚisfiler™Úintr‘Ú OverflowErrorr\ÚrfindrZrrßr) r1rr/rÃZsnoÚresZminusrgZoffZplusr0rKr3rMßsJ   &       z queue.lookupc " Csh| | |¡| ¡} | ¡4g} | ¡ ¡D]} |  | ¡q0| sL|jg} |j ¡| vrn|sn|j   t dƒ¡|j s”|j   t dƒ¡WdƒdS|rp| |¡}| |¡}|rì|dt|jƒdkrì|j   t dƒ|¡WdƒdS| |¡\}}|r*|j  |¡| ¡krnt t dƒ|¡‚nD|r>t dƒ|}nt dƒ}|j   t d ƒ||f¡WdƒdSn<|r¬|j d }| |¡r¬|j   t d ƒ¡WdƒdS| ¡}|t|j ƒkrä|j   t d ƒ¡WdƒdS|s| s|j||jd |r˜| rt t dƒ¡‚|r.t t dƒ¡‚|jrDt t dƒ¡‚|j |}t| |¡|jƒj}|szt t dƒ|¡‚|||dks˜t ||¡|r^|s²t t dƒ¡‚t|jƒD].\}}|j  !|d¡d|j |kr¼qìq¼t|j|d…ƒD](\}}|j  !|d¡d|krþq(qþ||}|j|}|j|=|j "||¡| #¡d|_$d|_%|dkrx| &|¡|s’|j |}|d}n|j  ||¡d}t'ƒ}| s¶|s¼| r|j|dd}| rð| |j(|j)|j*|j+¡n| |j(|j)¡|j ||…}t'ƒ}z2|r0| ,|||| ¡}n|j-|||||| d}Wn‚t.y^‚Ynn|j   t dƒ¡t/j0|j ||ddd|D]"}||jvr|j1j2|ddq|j   t dƒ¡‚Yn0|jsê|dWdƒS|jd j3} |dr(|ddkr(t dƒ}!|j  4|!| ¡n|j  4t dƒ| ¡|dWdƒS1sZ0YdS)Ns"(working directory not at a head) sno patches in series rrUs qpush: %s is already at the top s#cannot push to a previous patch: %ss guarded by %ssno matching guardsscannot push '%s' - %s rrs"all patches are currently applied s#patch series already fully applied )rŽs.cannot use --exact and --keep-changes togethers&cannot use --exact and --move togethers(cannot push --exact with applied patchess"%s does not have a parent recordedres please specify the patch to moveTr3rVs!cleaning up working directory... )Z no_backup©Z ignoremissingsdone s0errors during apply, please fix and qrefresh %s ó now at: %s )5rœrãrZZ branchmapZ iterheadsr´rGrEr;rŸrgrrÖrÉrMrNr\rÓr rZrÁrrßrrqr™rŽr‰rr2r`rÔrïrnrarÕr¼r»r‡rörˆr½r‰rrRr7r¨r ZrevertÚwvfsÚ unlinkpathrHr )"r1r@rr4rÏr;ÚallÚmoveÚexactÚnobackuprYrãÚheadsZhsrQr rPreÚrootÚtargetZ fullstartZrpnrgrZZ fullpatchÚendrXrgrCrWr?rr†r2r0r0r3Úpushs      ÿ ÿÿ   ÿÿÿ  ÿ        ÿþýÿú ü  z queue.pushc sz| ||¡| ¡N|rT| |¡}|s4| |¡}| |¡}|sTt tdƒ|¡‚|js~|j  tdƒ¡| WdƒS|rˆd} n |rš|dd} nt |jƒd} | t |jƒkrÚ|j  tdƒ|¡WdƒdS|s"|j   ¡‰dd„|jDƒ} ˆD] } | | vrþ|j  tdƒ¡d }qþn6d d„|d  ¡Dƒ‰t ‡fd d „|j| d…Dƒƒ}tƒ} |r¼|j||pr|d } |r˜|s¼|  | j| j¡n$|r¼|  | j| j| j| j¡d |_t |jƒ}|j| j}z|j |¡}Wn0tjyt|ƒ}t tdƒ|¡‚Yn0||jdjgkr.sqpop: forcing dirstate update TcSsg|] }| ¡‘qSr0rBrr0r0r3rÿýr:c3s|]}|jˆvVqdSr/rBrq©rFr0r3r‚þszqueue.pop..r3strying to pop unknown node %srrs?popping would remove a revision not managed by this patch queues&popping would remove a public revisionó see 'hg help phases' for detailsr`res!deletions found between repo revsrŒrÉF©rcZ wc_trackeds popping %s r1rÊspatch queue now empty )0rœrZrNrMrrßrrÓrŸrÉr\rErFrrörr2rˆr½r‰rr»rGrHrÑÚ LookupErrorr ÚmutablerJrgr&rhrËrÌÚ update_fileZwwriteÚdataÚflagsrjrGÚreversedrHrr=rr>ror )r1r@rr4r2rÍrÐrYrQreZrrrérXrCrÔr=rÑrGÚqpr>Ústr,rÙrwÚdrZfctxÚstater0r×r3ÚpopÏsº        ÿÿ  ÿÿþ     ÿ  ÿ . z queue.popc Csx| |¡\}}|s&|j tdƒ¡dS| ||¡}| d¡rHd|}}n |d}}| ||¡} |j|| ||||ddS)NrÖsreverse)r%r5)r‡rŸr rrJrorãr-) r1r@r¹r5r†rràr(r)rãr0r0r3r¸Js     z queue.diffc< s(t |¡}|js$|j tdƒ¡dS| dd¡ ¡}| d¡}| dd¡}| d¡}| d ¡}|rpd t  |¡}|  ¡} z”|  |¡|jd j |jd j } } |j | ¡| gkrÀt td ƒ¡‚||  ¡sâtjtd ƒtdƒd‚|j | ¡} | || ¡} t|| ƒ}|r|j d¡}t| | ¡|jƒ‰|jd| d¡i| dd}|rRˆ |¡|rbˆ |¡ˆ t| ƒ¡|j | ddd}| !| | ¡}|j"|j#|j$}}}|| }|dd…}t% &|d||¡}| d¡rt% '||||| (¡¡}t%j&|d|d}n t% )|¡}|j!|d}|j"|j#|j$|j*f\}}}}t+|ƒ}t+|ƒ}t+|ƒ}|D]}||vrR| ,|¡qR|D]0}||vr–| -|¡| ,|¡n | ,|¡qrg} ||D]>}||vrØ| -|¡|  .|¡q°n | /|¡| ,|¡q°t0|ƒ}t0|ƒ}t0|ƒ}|j!| |d}|j"|j#|j$|j*f\}!}"}#}$t+|!|"|#|$ƒ‰‡fdd„|||fDƒ}%t+|ƒ}&|%D]}|& 1|¡qjt% '||&¡}||  2¡}'|j 3¡|d}(zZt4 4|d¡}(|j5sÆ|j6r®i})|D]L}*|j 7|*¡}+|+dur|+|jvr|) 8|+g¡ .|*¡|jj9|*dddqÎ|D]Z}*||* :¡}+|+rh|) 8|+g¡ ;|) |*g¡¡|*|vrh|)|+ .|*¡|*|)vr |)|*=q t <|)¡D]$\}+},|,D]}*|j =|+|*¡q’q†nB|D]}*|jj9|*dddq²t0|j >¡ƒD]}-|j =d|-¡qÚ|D]}-|jj?|-ddqôg}t @tA|ƒdd d ¡D](}.|||.ƒs&| .||.¡||.=q&|D]}-|jj?|-ddqT|D]}-|jj?|-ddqp| D]}-|jj?|-ddqŒˆjBp²| B¡}/||  C¡}0|jD| Ž|j E¡d|_FtG|j|| gddd|( H¡WtI|(ƒn tI|(ƒ0Wdƒn1s$0Yz€d | ‰tJjK|d!}1|r†‡‡fd"d#„}2td$ƒ}3tJjK|2|3|d%}1|p‚d& ˆjL¡}4n0|s¨ˆjLsšˆ}4n d& ˆjL¡}4n|}4ˆ M|¡d}5}6zà| N¡}5| Od'¡}6tP||0|4|/ˆjQ|d|1d(‰d)d„|%Dƒ}7|r | R||7¡tSjT|| |7|d*}8tUˆƒ}9|9r6| |9¡|8D]}:| |:¡q:| H¡|jV};|; W||6‡fd+d„|'Dƒ¡|6 H¡|j .tXˆ| ƒ¡WtY I|6|5¡ntY I|6|5¡0WnH|| d,}|j Z|  ¡| [¡¡| \¡|j ]td-ƒ¡‚Yn0W|  I¡| ^|¡n|  I¡| ^|¡0dS).NrÖrUrr:ržrŸs mq.qrefreshr rWr°rrs(cannot qrefresh a revision with childrenscannot qrefresh public revisionrØr`rdr(Tr¡r6)Z atomictempóshort©r5r£csg|]}| ˆ¡‘qSr0)Ú intersectionrC)Ú allmatchesr0r3rÿÇr:z!queue.refresh..s mq.refreshFrÙrbr1r{r¤cs| ¡rˆ |¡|SˆSr/)rƒr—r¦)r©r@r0r3rªs z!queue.refresh..finishdescr«r¬r˜r'r®cSsg|] }t|ƒ‘qSr0)rÏrCr0r0r3rÿCr:)r*r5csg|] }|ˆf‘qSr0r0)r€Zbm)rÌr0r3rÿQr:rsNqrefresh interrupted while patch was popped! (revert --all, qpush to recover) )_rr±rÓrŸr rrorƒr"r²rZr‡rGrHrHrÑrrßrÛrFrJrDrEr³rqr™rŽrãr“r”r•rr¹rgrˆr½r‰rr'rlr%ZmatchallrrörÚremover?ÚdiscardrÏr2Z bookmarksrhrrÛrÞZcopiedÚ setdefaultrÜZ copysourcer´Ú iteritemsråÚcopiesriršr\r‡r¤rjrär»rrær]r r·r…r—rr[r§rˆr‹rÝr¸rZ _bookmarksZ applychangesrEÚlockmodZrebuildZmanifestrrÉr)ZaaaZmatch1r'Zstbr,rÙrwrârDrtÚcmÚcaZcrZcdZrefreshchangesr%ZbmlistZdsguardríÚdstÚsrcZdstsrrgr‡Zoldphaser¯rªr­r…rr_rr»r†r¼Zmarksr0)rèr©rÌr@r3rŽWsŠ      ÿ þ    ÿ                    ÿ    ÿ   ÿ      4 ý  ø  ÿ   ÿÿ  ÿz queue.refreshc Cs||s tj |j¡r t tdƒ¡‚zt |j¡Wn6tyf}z|jtj ksP|sR‚WYd}~n d}~00|rx|j ddSdS)Ns$patch queue directory already existsT©Úcreate) r´rµr•rrßrÚmkdirrrÐZEEXISTr)r1r@rõrr0r0r3Úinitfsz queue.initcCsŽ|r ||jvr t tdƒ|¡‚|s.| ¡}n|j |¡d}g}t |t|jƒ¡D]4}|  |¡\}}|r~|  ||j|f¡|  |¡qT|S)Nópatch %s is not in series filerU) rÖrrßrrÁrZrršr\r r?r)r1r@rreÚ unappliedrgr rPr0r0r3rùqs  zqueue.unappliedrcs–‡‡fdd„}dd„ˆjDƒ}|dur4tˆjƒ|}|sÞˆjjrTtd||dƒ} t |||¡D]v} ˆj| } | |vr„d\} } n ˆ | ¡drœd \} } nd \} } d }ˆjjrÀd | | | f}n|rÎ|| krÎqd||| | ƒqdn´g}t  ˆj ¡D]r\}}}|tˆj ƒdd…}|D]L}tj   ||¡}|ˆjvr|ˆj ˆj ˆjfvr| d ¡s| |¡qqît|ƒD]&}ˆjjr~dp€d }|||dƒqjdS)NcsØ|rˆj |¡ˆr´tˆ |¡ˆjƒ}|jr8|jd}nd}ˆj ¡r~ˆj ¡t|ƒt|ƒd}|dkrzt   ||¡}nd}ˆjj|d|dˆj d¡ˆjj|d|dnˆjj|d|dˆj d¡dS) Nrr:rVsqseries.©Úlabels: sqseries.message.r˜) rŸr rqr™rŽr…Ú formattedZ termwidthr\r#Zellipsis)Úpfxrnrãr@r2Úwidth©r1Úsummaryr0r3Ú displayname‰s"    z"queue.qseries..displaynamecSsh|] }|j’qSr0©rHrr0r0r3Ú  r:z queue.qseries..ó%drU)óAóappliedr)óUó unapplied)óGóguardedr:s%*d %s resD ómissing)rÓr\rÖrŸr rršr r´Úwalkrµr™r¿r¾rÀr^r?r<)r1r@ÚmissingreÚlengthrgrrrÓZidxwidthrgrÚcharrãrýZ msng_listrÒÚdirsr%rârZflrDr0rÿr3Úqseries€sP     ÿýÿþø  z queue.qseriescCs|jdkrdSdS)Nó.hg.patches.save.lineTr)r1rtr0r0r3Ú issavelineÉs zqueue.issavelinecCs‚|j ¡}|jjrV|jsV|jj|_| dd|j dd¡d¡| dd|j dd¡d¡|sltj |  d¡¡r~t j ||j|dSdS)Nrœs formattedsmqpagers interactiver)rµrõ) rºrårŸZ pageractiver¢rÃr´rµr•r™rÚ repository)r1rõrŸr0r0r3rÍs"   ü üz queue.qrepocCs || ¡ ¡}| ¡}d}g}g} d} t|ƒD]’\} } | dkrJ| d}q0|  d¡r~|  ¡} | dd… d¡} dd„| Dƒ} q0|dur0|  ¡} |  dd¡\}}|r¸|  tt |ƒ|ƒ¡q0| | ¡q0|durà|j   t d ƒ¡dS|j   t d ƒ|d ¡||_ | |_| ¡d |_d |_|j ¡}|r||vrD|j   t d ƒ¡nL|j   t dƒt|ƒ¡|j ¡}||vrvd }nd}t|j ||g|dd| r|j   t dƒt| d ƒt| dƒf¡|r|j  t dƒ¡| ¡}|sö|j   t dƒ¡dSt || d ¡dS)Ns Patch Data:rUs Dirstate:r{rõcSsg|] }t|ƒ‘qSr0)rrCr0r0r3rÿïr:z!queue.restore..rJsno saved patch data found srestoring status: %s rTs*save entry has children, leaving it alone sremoving save entry %s Fr1s&saved queue repository parents: %s %s supdating queue directory s unable to load queue repository )r9rrÎr`r^rƒrnr?rErrŸrÉrrÔrÓrÕr¼r»rHrÑr rErFrgrrr8)r1r@r=r„Úqupdater§rbZ datastartrÖrÓZqpprgrhrtrÌrHrÑÚppr2rwr0r0r3Úrestoreâsf       ÿÿz queue.restorecCs|js|j tdƒ¡dS| |jd¡r>|j tdƒ¡dS|sLtdƒ}nd| d¡}| ¡}|r|j ¡}|dt |d ƒt |dƒf7}|d 7}|d   d d „|jDƒ¡7}|d   dd „|j Dƒ¡7}|j |dd}|sò|j tdƒ¡dS|j  t|dƒ¡d|_| |¡dS)Ns"save: no patches applied, exiting rUrrsstatus is already saved shg patches saved states hg patches: s s Dirstate: %s %srs Patch Data: r:css|]}d|VqdS)rNr0rCr0r0r3r‚* r:zqueue.save..css|]}d|VqdS)s:%s Nr0rCr0r0r3r‚+ r:Tr3srepo commit failed r)rÓrŸrÉrrrƒrrErFrr™rÔr£r?rEr»r)r1r@r2rwrrÌr0r0r3Úsave s.   z queue.savecCs:|jr6|jdj}| |¡}|dur.t|jƒS|dSdS)NrrrUr)rÓrHrír\rÔ)r1rérÔr0r0r3rµ4 s   zqueue.fullseriesendcs^d}‡‡fdd„}ˆjrVˆjdj}zˆj |¡}WntyHYdS0||dƒS||ƒS)zÙIf all_patches is False, return the index of the next pushable patch in the series, or the series length. If all_patches is True, return the index of the first patch past the last applied one. rcs\ˆs|tˆjƒkr|St |tˆjƒ¡D](}ˆ |¡\}}|rF|Sˆ |¡q(tˆjƒSr/)r\rÖrršr r)rergrérP©r r1r0r3Ú nextpatchD s z"queue.seriesend..nextpatchrrrU)rÓrHrÖrZr‘)r1r rÔrrér0rr3rÁ= s    zqueue.seriesendcCs6|j|j}|jjs|}nd|j |¡d|}|S)Nrrõ)rÓrHrŸr rÖrZ)r1rZrOrér0r0r3Ú appliednameW s  zqueue.appliednamec sb‡fdd„}|r<|r"t tdƒ¡‚t ||¡}|jddn|sNt tdƒ¡‚t|ƒdksft|ƒdkrx|rxt tdƒ¡‚g} |rR|j |j  |  ¡¡¡} t| ƒdkr¼t td ƒ|  ¡¡‚ˆj rN|j  |  ¡¡} | d d „ˆj Dƒvrþt td ƒ|  ¡¡‚| ˆj d j gkr(t tdƒ|  ¡¡‚|j  ˆj dj ¡} |j | ¡d} n2| |j  |  ¡¡gkr|t tdƒ|  ¡¡‚d} ˆ d|i¡} | d¡¦}|D]Ž}|| ¡sÎtjtdƒ|tdƒd‚|j |¡\}}|j  |¡}|tkrt tdƒ|¡‚| r,| |kr,t tdƒ|| f¡‚|} |sZˆ || ¡ dd¡dd|¡}||ƒˆ ||¡ˆj d|¡ˆ |d¡$}tj||g|| dWdƒn1s´0Yt||ƒ}ˆj  d|¡ˆj |¡|  |¡d}|r|j  dd¡rt! "||t!j#|g¡ˆ $¡dˆ_%dˆ_&q Wdƒn1sH0Yt'|ƒD]ö\}}|r|dkr‚t tdƒ¡‚t(|ƒ}ˆ )|¡t* +|¡ ,¡rΈ -|¡}t.j/ 0|¡sÎt td ƒ|¡‚|r ˆ ||¡ˆj 1td!ƒ||f¡t2 3|ˆ -|¡¡n|}nÌ|dkr2|s2t td"ƒ¡‚n|sNt(t.j/ 4| 5d#¡¡ƒ}ˆ ||¡z:|dkrtˆjj6 7¡}nt8 9ˆj|¡}| 7¡}| :¡Wn*t;t¡|}|gˆj||…<ˆ $¡dˆ_&ˆj ?td%ƒ|¡ˆj |¡|  |¡d}qZˆ @|¡| S)&Ncs |ˆjvrt tdƒ|¡‚dS)Ns&patch %s is already in the series file)rÖrrßr)rnrKr0r3Ú checkseriesi s  ÿz"queue.qimport..checkseriess*option "-r" not valid when importing filesTrosno files or revisions specifiedrUs5option "-n" not valid when importing multiple patchess/revision %d is the root of more than one branchcSsg|] }|j‘qSr0rB)r€rÌr0r0r3rÿ‰ r:z!queue.qimport..srevision %d is already managedrrs*revision %d is not the parent of the queuers"revision %d has unmanaged childrenr(óqimportsrevision %d is not mutablerØr`scannot import merge revision %ds#revision %d is not the parent of %dr˜s%d.diffr6rær'r-rs%-e is incompatible with import from -spatch %s does not existórenaming %s to %s s$need --name to import a patch from -ó/sunable to read file %ssadding %s to series file )Arrßrrrƒrur\rHrÑrGróÚlastrÓr=Z parentrevsrãr[rÛrr›r9rnr–rÔrar¹r Z exportfilerEr½r?rŸr rZretractboundaryr¡rÕr»r¼r`Únormnamer”r$ÚurlÚislocalr™r´rµrÄr r r$ÚbasenamerƒZfinr¶rZopenpathrærr·rÖrµrÉr)r1r@r%rnr=Úexistingr4rÛrÚimportedrÑr}Z lastparentrãr_rwr;rIrÌrZsergÚfilenameZ originpathÚtextrèrZr0rKr3Úqimport_ s ÿ ÿ ÿÿÿÿÿÿ  þ   ÿÿÿþ 4   * ÿ   ÿ ÿÿÿ          z queue.qimport)N)NNF)F)F)NNNNN)N)FTFNNNNF)FTFNNNNF)F)FT)F)F) NFFNFFFFF)NFTFFF)N)F)N)NrNNF)F)NN)N)F)NNNNF)Ar7r8r9rIr Z propertycacherÓrÔrÖr×rÚrãràr™rír™ÚcompilerïrÕrôrùrûrr rrrr&r-rArJrRrr7r\rzr~r€r„r‡r‹rr’r”r–r›rœr½rNrMrÕrär¸rŽr÷rùrrrrrrµrÁrr)r0r0r0r3r©ósÞ %        ' ÷ ( 'õ 4õ q 1    @õ 7ø {  ù I  7   ør©cCs8| dd¡r | d¡s | d¡r$|St|ƒ}d|d<|S)Nr'r+óforceóexactTó keep_changes)r roÚdict©rŸr5r0r0r3Úfixkeepchangesopts s ÿþýr0sqdelete|qremove|qrmókrÜskeep patch filerärs%stop managing a revision (DEPRECATED)sREVshg qdelete [-k] [PATCH]...)Ú helpcategorycOs&|j}| ||t |¡¡| ¡dS)a=remove patches from queue The patches must not be applied, and at least one patch is required. Exact patch identifiers must be given. With -k/--keep, the patch files are preserved in the patch directory. To stop managing a patch and move it into permanent history, use the :hg:`qfinish` command.r)Úmqr„rr±r)rŸr@rçr5Úqr0r0r3r„ sr„sqappliedó1ólasts%show only the preceding applied patchshg qapplied [-1] [-s] [PATCH]cKsÊ|j}t |¡}|rB||jvr0t tdƒ|¡‚|j |¡d}n | d¡}|  d¡rl|sl|  tdƒ¡dS|  d¡r|dkr|  tdƒ¡dS|  d¡r¨|d}d}nd}|j |||d |  d ¡d d S) zhg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... [FILE]...c Os²t |¡}| ¡d|j}zB|j||| d¡| d¡| d¡| d¡| d¡d}W| ¡n | ¡0Wdƒn1s|0Y|r®| d¡r®| d¡s®| ||d ¡Sd S) aËimport a patch or existing changeset The patch is inserted into the series after the last applied patch. If no patches have been applied, qimport prepends the patch to the series. The patch will have the same name as its source file unless you give it a new one with -n/--name. You can register an existing patch inside the patch directory with the -e/--existing flag. With -f/--force, an existing patch of the same name will be overwritten. An existing changeset may be placed under mq control with -r/--rev (e.g. qimport --rev . -n patch will place the current revision under mq control). With -g/--git, patches imported with --rev will use the git diff format. See the diffs help topic for information on why this is important for preserving rename/copy information and permission changes. Use :hg:`qfinish` to remove changesets from mq control. To import a patch from standard input, pass - as the patch file. When importing from standard input, a patch name must be specified using the --name flag. To import an existing patch while renaming it:: hg qimport -e existing-patch -n new-name Returns 0 if import succeeded. r>r<r+rr()rnr%r4r=rÛNrBrrr)rr±rr3r)rorrÕ)rŸr@r'r5r4r&r0r0r3r)~ s"5  ù 2r)cCsº|j}| ||¡}| ¡|r¶tj | d¡¡sv| dd¡}| d¡| d¡| d¡| d¡| d¡|  ¡tj | d¡¡s˜| dd¡  ¡|d   ddg¡t   ||¡d S) a"initialize a new queue repository This command also creates a series file for ordering patches, and an mq-specific .hgignore file in the queue repository, to exclude the status and guards files (these contain mostly transient state). Returns 0 if initialization succeeded.s .hgignorer6s^\.hg s^\.mq s syntax: glob sstatus sguards r®Nr) r3r÷rr´rµrrrËr rærr)rŸr@rõr4rwrr0r0r3ÚqinitÈ s"        rCsqinitócs create-reposcreate queue repositorys hg qinit [-c]T)r2Ú helpbasiccKst||| d¡dS)aìinit a new queue repository (DEPRECATED) The queue repository is unversioned by default. If -c/--create-repo is specified, qinit will create a separate nested repository for patches (qinit -c may also be run later to convert an unversioned patch repository into a versioned one). You can use qcommit to commit changes to this queue repository. This command is deprecated. Without -c, it's implied by other relevant commands. With -c, use :hg:`init --mq` instead.Z create_reporô)rCro©rŸr@r5r0r0r3r÷ã sr÷sqcloneópulls"use pull protocol to copy metadatarónoupdates)do not update the new working directoriesó uncompresseds)use uncompressed transfer (fast over LAN)ópr¬s#location of source patch repositorysREPOs#hg qclone [OPTION]... SOURCE [DEST])r2Únorepoc KsVt |¡}dd„}|dur$t |¡}t ||¡\}}}t |||¡}| d¡rht || d¡¡\}}}n||ƒ}zt |||¡Wn"tj y¤t  t dƒ¡‚Yn0d\} } |  ¡r0|  ¡} | j jrb| |  ¡tjkrb| j jdj} t |¡sbt|  ¡ƒ} t|  |  | ¡¡ƒ} |  | j | ¡d¡n2| d¡rbz| d ¡} Wntj y`Yn0| t d ƒ¡tj||| ¡|| d ¡| d | d ¡d\}} | t dƒ¡tj||| d¡pÆ||ƒ|| ƒ| d ¡| d¡ | d ¡d|   ¡rR|   ¡} | r&| t dƒ¡t || | gd dd| d¡sR| t dƒ¡t !| | j "¡¡dS)aTclone main and patch repository at same time If source is local, destination will have no patches applied. If source is remote, this command can not check if patches are applied in source, so cannot guarantee that patches are not applied in destination. If you clone remote repository, be sure before that it has no patches applied. Source patch repository is looked for in /.hg/patches by default. Use -p to change. The patch directory must be a nested Mercurial repository, as would be created by :hg:`init --mq`. Return 0 on success. cSs&| ¡}| d¡r|dd…}|dS)z+compute a patch repo url from a repo objectrNrrs /.hg/patches)r"Úendswith)r@r"r0r0r3rÆ( s  zclone..patchdirNr¬s4versioned patch repository not found (see init --mq)r…rslookuprÀscloning main repository rGFrI)Úpullr|r2Ústreamscloning patch repository rH)rMr2rNs6stripping applied patches from destination repository r1s updating destination repository )#rr±rZ defaultdestr$Zget_clone_pathZpeerrorZ RepoErrorrßrÚlocalr3rÓr¤rr¡rGr#rörÑrÏÚ differencer?rHrFZcapablerMr!Úcloner"rr2rm)rŸÚsourceÚdestr5rÆÚ__Ú source_pathÚsrZ patchespathÚqbaseZdestrevr@rÑZdrr0r0r3rQø s|.   ÿ     ø  ù ÿÿ rQs qcommit|qcis commit|cis hg qcommit [OPTION]... [FILE]...)r2Ú inferrepocOs<|j}| ¡}|st d¡‚tj|j|g|¢Ri|¤ŽdS)zscommit changes in the queue repository (DEPRECATED) This command is deprecated; use :hg:`commit --mq` instead.óno queue repositoryN)r3rrrßrr£rŸ)rŸr@r¹r5r4rwr0r0r3r£u s  r£sqseriesómr sprint patches not in seriesshg qseries [-ms]cKs"|jj|| d¡| d¡ddS)z7print the entire series file Returns 0 on success.r r)r rr)r3rrorFr0r0r3rÖ‡ s ÿrÖsqtops hg qtop [-s]cKsV|j}|jr| d¡}nd}|r@|j||ddd| d¡dn| tdƒ¡dSdS) z>print the name of the current patch Returns 0 on success.TrrUrrr:rÖN)r3rÓrÁrror r)rŸr@r5r4Útr0r0r3r†š s  ûr†sqnexts hg qnext [-s]cKsJ|j}| ¡}|t|jƒkr.| tdƒ¡dS|j||d| d¡ddS)zDprint the name of the next pushable patch Returns 0 on success.r9rUr)rerrN)r3rÁr\rÖr rrro)rŸr@r5r4rÔr0r0r3Únext· s r\sqprevs hg qprev [-s]cKsr|j}t|jƒ}|dkr*| tdƒ¡dS|s@| tdƒ¡dS|j |jdj¡}|j||dd|  d¡ddS) zHprint the name of the preceding applied patch Returns 0 on success.rUr7rÖéþÿÿÿrrr:N) r3r\rÓr rrÖrZrHrro)rŸr@r5r4rtrr0r0r3ÚprevÉ s  ÿr^cCsH| d¡s | d¡r | ¡|d<| d¡sD| d¡rDdt ¡|d<dS)Nr ó currentuserrWó currentdater°)roÚusernamer"Zmakedater/r0r0r3Úsetupheaderoptsá s rbsqnewržs invoke editor on commit messagess'import uncommitted changes (DEPRECATED)r_s#add "From: " to patchóur sadd "From: " to patchsUSERóDr`s#add "Date: " to patchódrWsadd "Date: " to patchsDATEs0hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...)r2rErXcOsZt |¡}t ||¡}|j}||d<t||ƒ|j||g|¢Rit |¡¤Ž| ¡dS)acreate a new patch qnew creates a new patch on top of the currently-applied patch (if any). The patch will be initialized with any outstanding changes in the working directory. You may also use -I/--include, -X/--exclude, and/or a list of files after the patch name to add only changes to matching files to the new patch, leaving the rest as uncommitted modifications. -u/--user and -d/--date can be used to set the (given) user and date, respectively. -U/--currentuser and -D/--currentdate set user to current user and date to current date. -e/--edit, -m/--message or -l/--logfile set the patch header as well as the commit message. If none is specified, the header is empty and the commit message is '[mq]: PATCH'. Use the -g/--git option to keep the patch in the git extended diff format. Read the diffs help topic for more information on why this is important for preserving permission changes and copy/rename information. Returns 0 on successful creation of a new patch. rr) rr±r Ú logmessager3rbr½Ú strkwargsr)rŸr@rr¥r5r2r4r0r0r3r½è s+    r½sqrefreshrås;refresh only files already in the patch and specified filess2add/update author field in patch with current users0add/update author field in patch with given users0add/update date field in patch with current dates.add/update date field in patch with given dates=hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...cOs|t |¡}|j}t ||¡}t||ƒ| ¡:|j||fd|it |¡¤Ž}|  ¡|WdƒS1sn0YdS)a>update the current patch If any file patterns are provided, the refreshed patch will contain only the modifications that match those patterns; the remaining modifications will remain in the working directory. If -s/--short is specified, files currently included in the patch will be refreshed just like matched files and remain in the patch. If -e/--edit is specified, Mercurial will start your configured editor for you to enter a message. In case qrefresh fails, you will find a backup of your message in ``.hg/last-message.txt``. hg add/remove/copy/rename work as usual, though you might want to use git-style patches (-g/--git or [diff] git=1) to track copies and renames. See the diffs help topic for more information on the git diff format. Returns 0 on success. r2N) rr±r3r rfrbrZrŽrgr)rŸr@r¹r5r4r…r?r0r0r3rŽ sB    rŽóqdiffshg qdiff [OPTION]... [FILE]...cOs$| d¡|j ||t |¡¡dS)adiff of the current patch and subsequent modifications Shows a diff which includes the current patch as well as any changes which have been made in the working directory since the last refresh (thus showing what the current patch would become after a qrefresh). Use :hg:`diff` if you only want to see the changes made since the last qrefresh, or :hg:`export qtip` if you want to see changes made by the current patch without including changes made since the qrefresh. Returns 0 on success. rhr)Zpagerr3r¸rr±)rŸr@r¹r5r0r0r3r¸i s r¸sqfoldskeep folded patch filess/hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH...cOsðt |¡}|j}|s"t tdƒ¡‚| |¡ds>t tdƒ¡‚| |¡t  ||¡}|  d¡}g}g}|D]V} |  | ¡} | |vsˆ| |krš|  tdƒ| ¡|  | ¡r¶t tdƒ| ¡‚|  | ¡qj|D]^} |sòt| | ¡|jƒ} | jrò|  | j¡| | ¡} | || ¡\} }}| sÆt tdƒ| ¡‚qÆ|szt| |¡|jƒ} | j}|D]&}|rH|rb|  d¡| |¡qHd  |¡}|j| ¡g|¢RŽ}| ¡B|j|||j| d ¡d d | |||¡| ¡Wd ƒn1sâ0Yd S)a,fold the named patches into the current patch Patches must not yet be applied. Each patch will be successively applied to the current patch in the order given. If all the patches apply successfully, the current patch will be refreshed with the new cumulative patch, and the folded patches will be deleted. With -k/--keep, the folded patch files will not be removed afterwards. The header for each folded patch will be concatenated with the current patch header, separated by a line of ``* * *``. Returns 0 on success.s&qfold requires at least one patch namerr‚r¿s!skipping already folded patch %s s*qfold cannot fold already applied patch %sserror folding patch %ss* * *r˜ržsmq.qfold)r2rÛrºr¥N)rr±r3rrßrr‡rr rfrMrÉrNr?rqr™rŽr…rr´ràrãrZrŽrÛror„r)rŸr@r%r5r4r…r‰rçÚmessagesrrér@rZ patchsuccessrTr2rãr0r0r3Úfold… sb       ÿ      ûrjsqgotos keep-changess&tolerate non-conflicting local changessoverwrite any local changess no-backups"do not save backup copies of filesshg qgoto [OPTION]... PATCHcKs„t |¡}t||ƒ}|j}| |¡}| d¡}| d¡}| |¡r^|j||| d¡||d}n|j||| d¡||d}|  ¡|S)zSpush or pop patches until named patch is at top of stack Returns 0 on success.ó no_backupr-r+)r4rÐrY) rr±r0r3rMrorNrärÕr)rŸr@rr5r4rÐrYr?r0r0r3ÚgotoÕ s.      ûûrlsqguardólólistslist all patches and guardsónonesdrop all guardss8hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]csT‡‡‡fdd„}|j‰dd„ˆjDƒ‰d}t|ƒ}| d¡rz|sJ| d¡rXt tdƒ¡‚t t ˆj ƒ¡D] }||ƒqhdS|r’|d d d …d vr²ˆjs¦t td ƒ¡‚ˆjd j }|durØ|d d d …d vrØ|  d ¡}|durît tdƒ¡‚|sþ| d¡r:ˆ  |¡}|dur$t tdƒ|¡‚ˆ ||¡ˆ ¡n|ˆj  ˆ |¡¡ƒdS)a€set or print guards for a patch Guards control whether a patch can be pushed. A patch with no guards is always pushed. A patch with a positive guard ("+foo") is pushed only if the :hg:`qselect` command has activated it. A patch with a negative guard ("-foo") is never pushed if the :hg:`qselect` command has activated it. With no arguments, print the currently active guards. With arguments, set guards for the named patch. .. note:: Specifying negative guards now requires '--'. To set guards on another patch:: hg qguard other.patch -- +2.6.17 -stable Returns 0 on success. csàˆj|pdg}ˆj|ˆvr$d}nˆ |¡dr8d}nd}d||f}ˆ dˆ ˆj||¡¡t|ƒD]d\}}| d¡rŽˆj|d d n(| d ¡r¨ˆj|d d nˆj|d d |t|ƒdkrlˆ d¡qlˆ d¡dS)Ns unguardedrrrr s!qguard.patch qguard.%s qseries.%ss%s: róqguard.positiverúróqguard.negativeóqguard.unguardedrUrõr˜)r×rÖr r rûr`r^r\)rr÷rãrûrgrò©rÓr4rŸr0r3rg" s"    zguard..statuscSsh|] }|j’qSr0rrr0r0r3r9 r:zguard..NrÏZnones.cannot mix -l/--list with options or argumentsrrUrñr‚rrsno patch to work withsno patch named %s)r3rÓrÏrorrßrrršr\rÖrHrärírrrZrM)rŸr@r¥r5rgrrgrr0rsr3rò s8  ÿ       ròsqheadershg qheader [PATCH]cCsd|j}|r| |¡}n"|js.| tdƒ¡dS| d¡}t| |¡|jƒ}| d |j¡d¡dS)zMprint the header of the topmost or specified patch Returns 0 on success.rÖrUr¿r˜N) r3rMrÓr rrqr™rŽr…)rŸr@rr4r@r0r0r3rcV s   rcc Csˆtj |¡\}}t |¡}t d|¡}d}d}|D]8}| |¡}|r4t| d¡ƒ} |dusd| |kr4| }|}q4|r„tj  ||¡|fSdS)Ns %s.([0-9]+)rUr…) r´rµrnÚlistdirr™r*r'rÅÚgroupr™) rµZ directoryr}ÚnamesZnamereZmaxindexZmaxnamerr,rZr0r0r3Ú lastsavenamen s  rwcCs,t|ƒ\}}|durd}|d|d}|S)Nrs.%drU)rw)rµr rZÚnewpathr0r0r3Úsavename€ s  ryrUsapply on top of local changesr,s-apply the target patch to its recorded parentslist patch name in commit textóaóallsapply all patchesómerges%merge from another queue (DEPRECATED)smerge queue name (DEPRECATED)ómoves-reorder patch series and apply only the patchs0hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]c KsÜ|j}d}t |¡}t||ƒ}| d¡r| d¡rF|j | d¡¡}nt|jƒ\}}|sj|  t dƒ¡dSt ||j |j|ƒ}|  t dƒ|j¡|j ||| d¡| d¡|| d ¡| d ¡| d ¡| d ¡| d ¡d }|S)a,push the next patch onto the stack By default, abort if the working directory contains uncommitted changes. With --keep-changes, abort only if the uncommitted files overlap with patched files. With -f/--force, backup and patch over uncommitted changes. Return 0 on success. Nr|r>s%no saved queues found, please use -n rUsmerging with queue at: %s r+rnr{r}r,rkr-)r4rÏr;rÍrÎrÏrÐrY)r3rr±r0ror!r™rwrµrÉrr©rºrÕ) rŸr@rr5r4r;rxrgr?r0r0r3rÕˆ s4*    ö rÕsqpopspop all patchessqueue name to pop (DEPRECATED)s)forget any local changes to patched filess!hg qpop [-a] [-f] [PATCH | INDEX]c Ksžt |¡}t||ƒ}d}| d¡r\t||j|j|j | d¡¡ƒ}|  t dƒ|j¡d}n|j }|j ||| d¡|| d¡| d¡| d¡d }|  ¡|S) aØpop the current patch off the stack Without argument, pops off the top of the patch stack. If given a patch name, keeps popping off patches until the named patch is at the top of the stack. By default, abort if the working directory contains uncommitted changes. With --keep-changes, abort only if the uncommitted files overlap with patched files. With -f/--force, backup and discard changes made to such files. Return 0 on success. Tr>susing patch queue: %s Fr+r{rkr-)r4r2rÍrÐrY)rr±r0ror©rºrµr!r™rÉrr3rär)rŸr@rr5Z localupdater4r?r0r0r3räÐ s&    ù räs qrename|qmvshg qrename PATCH1 [PATCH2]c Ksä|j}|s|}d}|r"| |¡}n"|js:| tdƒ¡dS| d¡}| |¡}tj |¡r~t tj |tj  |¡¡ƒ}| |¡}|  |¡|  tdƒ||f¡|  |¡}|j |j|¡}|d dd„|Dƒ¡|j|<| ¡d|_| |¡} | rt| d |ƒ|j| d <d|_tj |¡} tj | ¡s8t | ¡t | |¡|¡| ¡} | rØ|| jvrØ| d} |  ¡R| j |¡jr | j |¡| j  |¡n|  !||¡|  "|g¡Wdƒn1sÎ0Y| #¡dS) z˜rename a patch With one argument, renames the current patch to PATCH1. With two arguments, renames PATCH1 to PATCH2. Returns 0 on success.NrÖr¿rr:cSsg|] }d|‘qSrür0rýr0r0r3rÿ(r:zrename..TrUr)$r3rMrÓr rr™r´rµr•r!r$r–r!rírïrðrÔrÕr¼rNrEr»ÚdirnameÚmakedirsr r$rrErZr³r½Z set_untrackedZ set_trackedrårtr) rŸr@rrHr5r4Zabsdestrgr÷rQZdestdirrwrBr0r0r3r$sN              ,r$sqrestoreódeletesdelete save entrysupdatesupdate queue working directoryshg qrestore [-d] [-u] REVcKs:| |¡}|j}|j||| d¡| d¡d| ¡dS)zsrestore the queue state saved by a revision (DEPRECATED) This command is deprecated, use :hg:`rebase` instead.r„r2)r„rr)rMr3rror)rŸr@r=r5r4r0r0r3rCs rsqsaveócopyscopy patch directoryscopy directory nameóemptysclear queue status files force copys5hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]cKs|j}t |¡}t ||¡}|j||d}|r2|S| ¡| d¡rÜ|j}| d¡r²t j  |j | d¡¡}t j  |¡rºt j  |¡s”t tdƒ|¡‚| d¡sºt tdƒ|¡‚nt|ƒ}| tdƒ||f¡t ||¡| d¡r|jd d …=d |_| ¡d S) z`save current queue state (DEPRECATED) This command is deprecated, use :hg:`rebase` instead.rsrr>s,destination %s exists and is not a directoryr+s&destination %s exists, use -f to forcescopy %s to %s r‚NTr)r3rr±r rfrrrorµr´r™r³rr•rrßrryrÉr Z copyfilesrÓr»)rŸr@r5r4r…r?rµrxr0r0r3rWs<      ÿÿ  ÿ   rsqselectsdisable all guardsr®slist all guards in series fileópops)pop to before first guarded applied patchóreapplyspop, then reapply patchess!hg qselect [OPTION]... [GUARD]...cs|j‰t |¡}ˆ ¡}‡fdd„‰|s4| d¡r"ˆ |¡}‡fdd„t tˆjƒ¡Dƒ}ˆ  |¡ˆ  ¡|s€|  t dƒ¡| d¡s2| d¡s2ˆ |¡}‡fd d„t tˆjƒ¡Dƒ}t|ƒt|ƒkrî|  t d ƒt|ƒt|ƒf¡t|ƒt|ƒkr2|  t d ƒt|ƒt|ƒf¡n| d ¡röi}d } ˆj D]<} | sN| d7} | D]"} | | d ¡|| d7<qRq<|jrŠ| |d<t| ¡ƒ}|jdd„d|ræ| t dƒ¡|D]$\} } | d| ¡| | d¡q¾n| t dƒ¡n<|r$| t dƒ¡|D]} | | d¡qn| t dƒ¡| d¡oPˆjoPˆjdj}d}| d¡sn| d¡rÚt tˆjƒ¡D]Z}ˆ|ƒs~|  t dƒ¡d}|d kr¸ˆj|ddnˆ |ˆj|dj¡qÚq~|rz,|r|  t dƒ¡ˆ ||¡Wˆ  ¡n ˆ  ¡0dS)auset or print guarded patches to push Use the :hg:`qguard` command to set or print guards on patch, then use qselect to tell mq which guards to use. A patch will be pushed if it has no guards or any positive guards match the currently selected guard, but will not be pushed if any negative guards match the current guard. For example:: qguard foo.patch -- -stable (negative guard) qguard bar.patch +stable (positive guard) qselect stable This activates the "stable" guard. mq will skip foo.patch (because it has a negative match) but push bar.patch (because it has a positive match). With no arguments, prints the currently active guards. With one argument, sets the active guard. Use -n/--none to deactivate guards (no other arguments needed). When no guards are active, patches with positive guards are skipped and patches with negative guards are pushed. qselect can change the guards on applied patches. It does not pop guarded patches by default. Use --pop to pop back to the last applied patch that is not guarded. Use --reapply (which implies --pop) to push back to the current patch afterwards, but skip guarded patches. Use -s/--series to print a list of all guards in the series file (no other arguments needed). Use -v for more information. Returns 0 on success.csˆ ˆj|j¡dS)Nr)r rÓrH)rg©r4r0r3Ú¸r:zselect..rocsg|]}ˆ|ƒs|‘qSr0r0©r€rg©r r0r3rÿ»szselect..sguards deactivated rƒr„csg|]}ˆ|ƒs|‘qSr0r0r‡rˆr0r3rÿÄssAnumber of unguarded, unapplied patches has changed from %d to %d s=number of guarded, applied patches has changed from %d to %d r®rrUsNONEcSs|ddd…S©NrrUr0)rDr0r0r3r†ãr:)Úkeysguards in series file: s%2d r˜sno guards in series file sactive guards: sno active guards rrFspopping guarded patches T)rÍsreapplying unguarded patches N)r3rr±rûrorùršr\rÓrùrrgrr×rër rÏrrur!r rHrärÕ)rŸr@r¥r5r÷Z old_unappliedZ old_guardedrùZguardedZnoguardsZgsrþròÚcountZreapplyZpoppedrgr0)r r4r3Úselect‡s–.    ÿ   ÿÿüÿÿüÿ         rŒrrsfinish all applied changesetsshg qfinish [-a] [REV]...cOsÄ| d¡s|st tdƒ¡‚n| d¡r0d|}|j}|jsN| tdƒ¡dSt ||¡}|d  ¡|vr„|d  ¡r„|  tdƒ¡|  ¡$|  ||¡| ¡Wdƒn1s¶0YdS) ahmove applied patches into repository history Finishes the specified revisions (corresponding to applied patches) by moving them out of mq control into regular repository history. Accepts a revision range or the -a/--applied option. If --applied is specified, all applied mq revisions are removed from mq control. Otherwise, the given revisions must be at the base of the stack of applied patches. This can be especially useful if your changes have been applied to an upstream repository, or if you are about to push your changes to upstream. Returns 0 on success. rÓsno revisions specified)s qbase::qtiprÖrreNs6warning: uncommitted changes in the working directory )rorrßrr3rÓrgrrƒr=r%rÉrr€r)rŸr@rƒr5r4r|r0r0r3r€s    &r€sqqueueslist all available queuesóactivesprint name of active queueócreatescreate new queueórenamesrename active queuesdelete reference to queueópurges"delete queue, and remove patch dirs[OPTION] [QUEUE]c s*ˆj‰d‰d‰d‰‡fdd„‰‡‡fdd„}‡‡‡‡fdd „}‡‡fd d „}‡‡fd d „‰‡‡fdd„}‡fdd„}dd„} ‡‡‡‡fdd„} t |¡}|r²| d¡s²| d¡r"ˆƒ} | d¡rÖ| d| f¡dS|ƒD]@} | d| f¡| | kr|js| tdƒ¡qÜ| d¡qÜdS| |ƒs:t tdƒ¡‚ˆ  ¡Ð|ƒ‰| d¡r˜|ˆvrtt tdƒ|¡‚|ƒr„|ˆƒ||ƒ||ƒnn| d ¡rˆƒ} || krÆt td!ƒ|¡‚|ˆvrât tdƒ|¡‚|| ƒ} ||ƒ}t j   |¡rt td"ƒ|¡‚ˆ  d#d$¡}ˆD]L} | | kr\| d|f¡t j   | ¡rlt | |¡n| d| f¡q"| ¡ˆj  d#ˆ¡ˆ|ƒnv| d%¡r¦| |ƒn`| d&¡ræ|ˆvrÄ| |ƒ||ƒ}t j   |¡rt |¡n |ˆvrþt td'ƒ¡‚||ƒWdƒn1s0YdS)(a6manage multiple patch queues Supports switching between different patch queues, as well as creating new patch queues and deleting existing ones. Omitting a queue name or specifying -l/--list will show you the registered queues - by default the "normal" patches queue is registered. The currently active queue will be marked with "(active)". Specifying --active will print only the name of the active queue. To create a new queue, use -c/--create. The queue is automatically made active, except in the case where there are applied patches from the currently active queue in the repository. Then the queue will only be created and switching will fail. To delete an existing queue, use --delete. You cannot delete the currently active queue. Returns 0 on success. r¬spatches.queuesrªcs(tj ˆj¡}| d¡r$|dd…}|S)Nr­é)r´rµr$r^)rÈr…r0r3Ú _getcurrent\s  zqqueue.._getcurrentcs2zˆ ˆd¡}| ¡Wnty,YdS0dS)NräTF)r!rær·)rÇ©Ú _allqueuesr@r0r3Ú _noqueuesbs    zqqueue.._noqueuescs`ˆƒ}z8ˆ ˆd¡}dd„|Dƒ}| ¡||vr<| |¡WntyVˆg}Yn0t|ƒS)NräcSsg|]}| ¡r| ¡‘qSr0rv)r€r©r0r0r3rÿpr:z.qqueue.._getqueues..)r!rær?r·r<)ÚcurrentrÇZqueues)r”Ú _defaultqueuer’r@r0r3Ú _getqueuesks   zqqueue.._getqueuescs ˆjrt tdƒ¡‚ˆ|ƒdS)Ns@new queue created, but cannot make active as patches are applied)rÓrrßrr)Ú_setactivenocheckr4r0r3Ú _setactiveysÿÿzqqueue.._setactivecs*ˆ ˆd¡}|dkr| |¡| ¡dS)Nr6r¬©r!r ræ©rHrÇ)Ú _activequeuer@r0r3r™ƒs  z!qqueue.._setactivenocheckcs(ˆ ˆd¡}| d|f¡| ¡dS)Nrzrr›rœr“r0r3Ú _addqueue‰s zqqueue.._addqueuecs(|dkrˆj d¡Sˆj d|¡SdS)Nr¬r­)r!r™r©r@r0r3Ú _queuedirŽs zqqueue.._queuedircSs|D]}|dvrdSqdS)Ns:\/.FTr0)rHrÌr0r0r3Ú _validname”szqqueue.._validnamecs||ˆvrt tdƒ¡‚ˆƒ}||kr2t tdƒ¡‚ˆ dd¡}ˆD]}||krPqB| d|f¡qB| ¡ˆj dˆ¡dS)Ns'cannot delete queue that does not exists$cannot delete currently active queueópatches.queues.newr6r)rrßrr!r rær$)rHr–rÇr©)r”r’r%r@r0r3Ú_deletešs zqqueue.._deleternrrNs%ss (active) r˜s9invalid queue name, may not contain the characters ":\/."rŽsqueue "%s" already existsrs%can't rename "%s" to its current names'non-queue directory "%s" already existsr¢r6r€rs"use --create to create a new queue)r3rr±ror ÚquietrrrßrZr´rµrr!r r$ræÚshutilÚrmtree)rŸr@rHr5r•r˜ršržr r¡r£r–r©ZolddirZnewdirrÇZqdirr0)rr”r—r’r™r%r4r@r3Úqqueue5s’"         ÿ       ÿ  ÿ         r§cCsL|jjrH|j dd¡rtj}ntj}||jjdj}|| | ¡¡|S)zEcallback used to set mq changeset as secret when no phase data existsr'r-r) r3rÓrŸr rr¡ZdraftrGr)r@ÚrootsZmqphaserWr0r0r3Úmqphasedefaultsòsr©cs4G‡fdd„d|jƒ‰| ¡r0ˆ|_|j t¡dS)NcsbeZdZejdd„ƒZ‡‡fdd„Zddd„Zd‡‡fd d „ Z‡‡fd d „Z ‡‡fdd„Z ‡Z S)zreposetup..mqrepocSst|j|j|jƒSr/)r©rŸrºrµrKr0r0r3r3szreposetup..mqrepo.mqcs,tˆ|ƒ ¡t |d¡r(t| ¡dƒdS)Nr3)ÚsuperÚ invalidateallrZhasunfilteredcacher ržrK©Ú __class__Úmqrepor0r3r«s z'reposetup..mqrepo.invalidateallFcsT|jjrP|jjrP|sP|j ¡}dd„|jjDƒ‰t‡fdd„|DƒƒrPt |¡‚dS)NcSsg|] }|j‘qSr0rB)r€rCr0r0r3rÿ r:z@reposetup..mqrepo.abortifwdirpatched..c3s|]}|ˆvVqdSr/r0r©rçr0r3r‚r:z?reposetup..mqrepo.abortifwdirpatched..)r3rÓrÅrErFrrrß)r1Úerrmsgr4rFr0r¯r3Úabortifwdirpatched s  z,reposetup..mqrepo.abortifwdirpatchedr:Nc s8|dur i}| tdƒ|¡tˆ|ƒ |||||||¡S)Ns&cannot commit over an applied mq patch)r±rrªr£)r1r(r‡rˆr'r4r¯Zextrar¬r0r3r£s ÿ ÿz reposetup..mqrepo.commitcsš|jjr†|jjr†|js†dd„|jjDƒ}|jr\t|jƒ}t|ƒD]}||vrRq\q@| ¡q@|D]$}|| ¡t j kr`t   t dƒ¡‚q`tˆ|ƒ |¡dS)NcSsg|] }|j‘qSr0rB)r€rÒr0r0r3rÿ'r:z7reposetup..mqrepo.checkpush..ssource has mq patches applied)r3rÓrÅr4r|rörßrär¤rr¡rrßrrªÚ checkpush)r1ZpushopZ outappliedrÑrGr¬r0r3r²%s   z#reposetup..mqrepo.checkpushc sDtˆ|ƒ ¡}|j}|js|Sdd„|jDƒ}z| ¡j |dd¡Wn8tjy‚|j   t dƒt |ddƒ¡|YS0|jj ‰‡fdd„|Dƒ}|s¦|S| |dddf¡| |dddf¡| |j |dd¡dd f¡|d}|D]>}|d |vr,|j   t d ƒ|d ¡n|d||d <q|S) z,augment tags from base class with patch tagscSsg|]}|j|jf‘qSr0rF)r€rr0r0r3rÿAr:z7reposetup..mqrepo._findtags..rrrs)mq status file refers to unknown node %s csg|]}ˆ|dƒr|‘qS)rr0)r€Zmqt©Zincludedr0r3rÿOr:r¿rÀsqparentrUs+tag %s overrides mq patch of the same name )rªÚ _findtagsr3rÓržrHr=rrÚrŸrÉrr Zhasnoder?rF)r1Úresultr4ZmqtagsÚtagsrr¬r³r3r´9s>ÿÿ "ÿÿz#reposetup..mqrepo._findtags)F)r:NNNFFN) r7r8r9rZunfilteredpropertycacher3r«r±r£r²r´Ú __classcell__r0©r®)r­r3r®ÿs  ør®)r­rOZ_phasedefaultsr?r©)rŸr@r0r¸r3Ú reposetupþscr¹cOsFt |d¡r.| dd¡s.| tdƒ| d¡¡|||g|¢Ri|¤ŽS)NsabortifwdirpatchedZ no_commitFs#cannot import over an applied patchr4)r Z safehasattrror±r)ÚorigrŸr@r¥r¦r0r0r3Úmqimporthsÿÿr»cOs„| dd¡}|s&||g|¢Ri|¤ŽS|rL|d}t |¡slt tdƒ¡‚n t t  ¡¡}|slt tdƒ¡‚t  ||¡}t ||dƒS)Nr3rs0only a local queue repository may be initializeds5there is no Mercurial repository here (.hg not found)T) rärr#rrßrr ZfindreporÚgetcwdrrC)rºrŸr¥r¦r3Zrepopathr@r0r0r3Úmqinitrs   ÿÿ r½cOsb| dd¡}|s(|||g|¢Ri|¤ŽS|j}| ¡}|sHt tdƒ¡‚||j|g|¢Ri|¤ŽS)z>Add --mq option to operate on patch repository instead of mainr3NrY)rär3rrrßrrŸ)rºrŸr@r¥r¦r3r4rwr0r0r3Ú mqcommandˆs r¾cCs|j}g}t|jƒt| |¡ƒ}}|rB| | tdƒd¡|¡|r`| | tdƒd¡|¡|r~| tdƒd |¡¡n|  tdƒ¡dS)Ns %d appliedóqseries.applieds %d unappliedóqseries.unapplieds mq: %s s, smq: (empty queue) ) r3r\rÓrùr?rûrr r™r!)rŸr@r4r,rÙÚur0r0r3Ú summaryhook˜srÂsmq()csBt |ddtdƒ¡‡fdd„ˆjjDƒ‰t ‡fdd„|Dƒ¡S)zChangesets managed by MQ.rsmq takes no argumentscsh|]}ˆ|j ¡’qSr0)rGr=©r€rwrŸr0r3r¯r:zrevsetmq..csg|]}|ˆvr|‘qSr0r0rÃ)rÓr0r3rÿ°r:zrevsetmq..)rZgetargsrr3rÓrZbaseset)r@ZsubsetrDr0)rÓr@r3Úrevsetmq«srÄcsœdddtdƒfg‰t tjdt¡tj dt ¡t tjdt ¡}|d  ˆ¡‡fdd„}|tjƒt j d }t ¡D] \}}||krv|t|d iƒƒqvdS) Nr:r'soperate on patch repositorysimportsinitrUcsRt |¡D]B\}}t |¡d}|d}|jr0q t ||t¡}|d ˆ¡q dSr‰) rrìr Z parsealiasesrKrÚ wrapcommandr¾r´)ÚcmdtableÚcmdrËÚfunc©Zmqoptr0r3ÚdotableÂszextsetup..dotablezhgext.mqrÆ)rrrÅrÚtabler»r Z summaryhooksrrÂr½r´ÚsysÚmodulesr )rŸrËrÊZ thismoduleZextnameZ extmoduler0rÉr3Úextsetup·s  rÎsredsyellowsgreensblue bold underlines black boldsred bold)rqrprrr¿sqseries.guardedsqseries.missingrÀ)N)N)N)N)N)N)N)N)N)€Ú__doc__Z __future__rrrÐr´r™r¥rÌZmercurial.i18nrZmercurial.noderrrr Zmercurial.pycompatr r r Z mercurialr rrrrrrrrrîrrrÝrrrrrrrrr r!r¸Zmercurial.utilsr"r#r$r]Z seriesoptsrÆZcommandZ testedwithZ configtableZ configitemrîÚKeyErrorÚobjectr.ÚloadrDÚnormpathr!rEr[rlrjrprqr§rßr¨r©r0ZCATEGORY_CHANGE_ORGANIZATIONr„rÓrùZCATEGORY_IMPORT_EXPORTr)rCZCATEGORY_REPO_CREATIONr÷Z remoteoptsrQrËZCATEGORY_COMMITTINGr£rÖr†r\r^rbZwalkoptsZ commitoptsr½rŽrãZ diffopts2ZCATEGORY_FILE_CONTENTSr¸ZCATEGORY_CHANGE_MANAGEMENTrjrlròrcrwryrÕrär$rrrŒr€r§r©r¹r»r½r¾rÂZrevsetpredicaterÄZ i18nfunctionsrÎZ colortabler0r0r0r3Úsp9 \  ýýýý   ý+&5% ûþ ó ÿû üûôï 7û üüûòêå` û ÿýù ü ü ü ù ÷ ö ð #üüûüûä$Ü%Û&Õ- ú þüø Füø ó þù Küüüüèâ (üö ð$ü7þù üúö $ü÷ uü(úõ 1 j    ù