^c;dZddlZddlZddlZddlZddlmZddlmZm Z m Z m Z ddl m Z mZmZddlmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z(ddl)m*Z*m+Z+m,Z,ej-Z-dd ded fgZ.iZ/e j0e/Z0d Z1iZ2e j3e2Z3e3d d de3d dde3d dde3d dd ej4dn2#e5$r*GddZ6ej7e6ddYnwxYwe$j$Z$d dZ8e&j9Z:GddZ;gdZd Z?Gd!d"Z@d#ZAGd$d%ejBZCGd&d'ZDd(ZEe0d)d*d+ded,fd-d.ged/ed0fged1e0jF2d3ZGe0d4d5d6ded7fge.zed8e0jF2d d9ZHe0d:d5d;ded<fge.zed=e0jF2d d>ZIe0d?d@dAdedBfdCdDdedEedFfdGdHdedIfd-d.gedJed0fdKd dedLfdMdNdedOfgedPe0jJ2dQZKdRZLe0dSdTdUdedVfgedWe0jMdXYdZZNe0d[dd\ded]fd^d_ded`fddadedbfdcdddedeedffgejOzedge0jMdXhd diZPe0djejQdkdedle0jRdXmdnZSe0dodpdqdedrfge.zedse0jF2dtZTe0due.edve0jF2dwZUe0dxe.edye0jF2dzZVe0d{e.ed|e0jF2d}ZWd~ZXe0dd@ddedfdGdHdedfdKd dedLfd^ddedfdddededfdddedfdddededfgejYzejZzede0jRdXdXdZ[e0dd@ddedfdKd dedLfdddedfd^ddedfdddededfdddedfdddededfgejYzejZzede0jRdXdXdZ\e0dej]ej^zejYzede0j_dXdXdZ`e0dd@ddedfd*d+dedfgejZzede0ja2dZbe0ddddedfdGdHdedfdddedfgede0jF2dZce0ddddedfdCddedfgede0jF2dZde0dgede0jF2d dZedZfdZge0ddddedfdGdHdedfd@ddedfdddedfdddedfdpddedfdCdDded¦edFfdddedĦfdddedfg edŦe0jFdXYd dƄZhe0ddddedȦfdCdDdedɦedFfdddedfdGdHdedʦfdddedfged˦e0jFdXYd d̄Zie0dgedΦe0jF2d dτZje0ddddedҦfdddedԦfgedզe0jF2dքZke0ddTdded٦fdCdDdedڦedFfd@ddedܦfdGdHdedݦfgejZzedަe0jF2d߄Zle0ddCddedfdddedfdddedfdddedfgede0jF2dZme0ddddedfgede0jF2dZne0ddddedfdddedfdTddedfdddedfdddedfdddedfgede0jF2d dZodZpdZqdZrdZsdZtdZue jvZvevddZwewgZxdZyddddd d d d ZzdS( a 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. N_)binhexnullrevshort)delattrgetattropen)cmdutilcommands dirstateguardencodingerror extensionshg localrepolock logcmdutilpatchphasespycompat registrar revsetlangscmutilsmartsetstrip subrepoutilutilvfs)dateutil stringutilurlutilssummarys print first line of patch headersships-with-hg-coremqgitauto)default keepchangesFplainsecretsstripceZdZdZdZdS)dummyuicdSN)selfmsgs */usr/lib/python3/dist-packages/hgext/mq.pydebugz dummyui.debug DcdSr0r1)r2eventmsgfmtmsgargsoptss r4logz dummyui.logr6r7N)__name__ __module__ __qualname__r5r=r1r7r4r.r.s2        r7r.r7c`g}|d}|r ||}n|}t|jD]o}||d||jvs'||r||p|S)zrreturn list of subrepos at a different revision than substate. Abort if any subrepos have uncommitted changes.NT)p1sortedsubstatesub bailifchangeddirtyappend)repobaserevinclsubswctxbctxss r4 checksubstaterOsH :DG}wwyy DM " "  !!$''' DM ! !TXXa[[%6%6%8%8 ! OOA    Or7cZeZdZdZdZejeZejeZdS) statusentryc$||c|_|_dSr0nodename)r2rTrUs r4__init__zstatusentry.__init__s#T 4999r7c@t|jdz|jzS)N:)rrTrUr2s r4 __bytes__zstatusentry.__bytes__s49~~$ty00r7N) r>r?r@rVrZr strmethod__str____repr__r1r7r4rQrQsR***111!h ++G!x!),,HHHr7rQ)# User # Date s# # Branch # Node ID # Parent )sfromdatessubjectc|ddz}t|}t|}t|t|D]}||}|dst ||}n\t tD]F\}} || r,||kr||z||<|ccS||krt ||}nG||||z|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 patchrc# )index HGHEADERSlenrange startswithmin enumerateinsert) linesheadervaluestartnewindexbestposiline lineindexhs r4inserthgheaderr{s. KK/ 0 01 4Ev&&H%jjG 5#e** % %  Qxu%% '1ooG E%i00  LIqq!! ((%~E!H LLLLLx''!'1ooG   LL&5.))) Lr7c t|}t|}t|D]\}}d|vr|ddd}t||dz}||krd||fz||<|cS||kr||kr|}|r||d||kr|}||d||fz|S)aFor 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'] rXrcr%s: %sr7) PLAINHEADERSlowerrkrosplitrgetrp) rqrrrsnewpriorvrwrxlheaderlprios r4insertplainheaderrs"6<<>>*G%jjGU##4 4<<jjq))!,2244::<.eatdiff)s "ILL++||I..||N33 b E     r7cR|r$|ds|d=ndS|"dSdS)Nrr)rqs r4eatemptyz&patchheader.__init__..eatempty5sL Ry((b E      r7rsrb diff --gits+++ rds--- rcshgpatchr^r_s # Parent r`ra rhrgstagdones Subject: subject: stagFrom: sfrom: Date: sdate: r7c3jK|].}|dp|dV/dS)rrNr).0cs r4 z'patchheader.__init__..sS Y''B1<< +B+Br7)r rstriprmlstriprHrk diffstartlinerpmessagecommentsuserdateparentnodeidbranchhaspatchany plainmode)r2pfrrrrrrrrformatsubjectrr diffstartrxs r4rVzpatchheader.__init__(s$       UOO2 "2 "D;;==D}--  "oog66  Iw'') % :%%??:.. "8DD__Z00 "8DD__\22"!!""X__..FF__\22"!!""XFF__]33"!"##YFF//"D"NN4(((!F000#:%% --&151N1N&qrr(:%% **&.2ooi.H.H&ABBx:%% **&.2ooi.H.H&ABBx6!!dckk$ %D %t$$$ OOD ! ! ! !!]]  'f''// 'G ' NN1g & & &        !A   &dm; r7c t|jd|nD#t$r7|jrt |jd|ndd|zg}||jz|_YnwxYw||_dS)Nr^sFromrg)r{r ValueErrorrrr)r2rtmps r4setuserzpatchheader.setuser 4 4=*d ; ; ; ; 4 4 4~ 4!$-$????. T0AB #dm 3  4  >AAc t|jd|nD#t$r7|jrt |jd|ndd|zg}||jz|_YnwxYw||_dS)Nr_sDaterg)r{rrrrr)r2rrs r4setdatezpatchheader.setdaterrc t|jd|n-#t$r |jsdd|zg}||jz|_YnwxYw||_dS)Nrbrg)r{rrrr)r2rrs r4 setparentzpatchheader.setparentso 4 4=- @ @ @ @ 4 4 4> 4. 0FG #dm 3  4 s'AAc|jr||g|_|rQ|jr.|jr'|jdr|jd|j|dSdS)Nrr7)r_delmsgrrrH)r2rs r4 setmessagezpatchheader.setmessages =  LLNNNy  *~ *$- *DM"4E * $$S))) M  ) ) ) ) ) * *r7cld|j}|sdS|dzS)N r7s )joinrr)r2rNs r4rZzpatchheader.__bytes__s8 JJt} % % , , . . 37{r7c|jrd|jdz}tt|jD]C}||j|kr|j|=|jdd|_nDd}|jD]1}||j|kr|dz }||j|k|j|=2dS)zRemove existing message, keeping the rest of the comments fields. If comments contains 'subject: ', message will prepend the field and a blank line.rrrdNrc)rrrlrkr)r2subjrwcimis r4rzpatchheader._delmsgs < $,q/"7"7"9"99D3t}--..  4=+113333 a(#'<#3DLE4, " "B b)))a b))) b!! " "r7NF) r>r?r@rVrrrrrZrr[r\rr1r7r4rr'so o o o b      *** !h ++G"""""r7rcN|}|'|jddr tj}ddi}|||d<|j|d5|jddd|j|i|cdddS#1swxYwYdS) zhelper 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,)uiallowemptycommitT)sphasess new-commitrr) unfilteredui configboolrsecretconfigoverride setconfigcommit)rIphaseargskwargs overridess r4 newcommitrs ??  D } 7  eY / / "ME-t4I 05 ,-    5 1 1,, %!4d;;;t{D+F++,,,,,,,,,,,,,,,,,,s$)BB!BceZdZdS)AbortNoCleanupN)r>r?r@r1r7r4rrsDr7rcteZdZd?dZejdZejdZejdZejdZ dZ d@d Z d Z d Z d Zejd ZdZdZdZdZdZdZdAdZdZdZdAdZ dBdZdZd?dZdZdZ dCdZ! dCdZ"dAd Z#d!Z$d"Z%d#Z&d$Z'd%Z(dDd&Z)d'Z*d(Z+dAd)Z,d*Z-d+Z.d,Z/d-Z0dAd.Z1 dEd/Z2 dFd0Z3d1Z4d?d2Z5dAd3Z6d?d4Z7 dGd6Z8d7Z9dAd8Z:dHd9Z;d?d:Zd=Z? dId>Z@dS)JqueueNc||_ ttj|dd5}|}dddn #1swxYwY|s!tj|d}n#tj|d|z}n0#t$r#tj|d}YnwxYw|p||_tj |j|_ ||_ ||_ d|_ d|_g|_d|_d|_d|_d|_d|_|d d }t/j|} | | rd }nd }||_|d d |_d|_dS)N patches.queuerbpatchespatches-Fseriesstatusguardsr&r'yesnor+T)basepathr ospathrreadrIOErrorvfsmodr openerrbaseui applieddirty seriesdirtyadded seriespath statuspath guardspath activeguards guardsdirtyconfigrr" parseboolgitmoderr checkapplied) r2rrrpatchdirfhcurcurpathrboolmodes r4rVzqueue.__init__s  5bgll4)9::DAA )Rggii&&(( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) @',,tZ88',,t[3->?? 5 5 5gll444GGG 5' j++  !  ###  ))E6**0022'00     uh77 s5.B<'A* B<*A..B<1A.2A B<<*C)(C)cfd} jj}t ||S#t $rgcYSwxYw)Nc3RK|D]}|dd}t|dkr%|\}}tt||VP|r<jtdtj |zdS)NrXrcsmalformated mq status line: %s ) rrkrQrrrwarnrr"pprint)rqrentrynrUr2s r4 parselinesz!queue.applied..parseliness  a((u::>>#GAt%c!ffd333333WWYYGLL=>>$+E223  r7)rrr splitlineslistFileNotFoundError)r2rrqs` r4appliedz queue.applieds      K$$T_55@@BBE 5))** *    III sAA A A c |j|jS#t$rgcYSwxYwr0)rrrrrrYs r4 fullserieszqueue.fullseries,sO ;##DO44??AA A    III s03 AAc8||jSr0) parseseriesseriesrYs r4rz queue.series3s {r7c8||jSr0)r seriesguardsrYs r4r zqueue.seriesguards8s   r7cdD]}||jvrt||d|_d|_d|_d|_dS)Nz&applied fullseries series seriesguardsF)r__dict__r rrrr)r2as r4 invalidatezqueue.invalidate=sa9??AA ! !ADM!!a   !   r7Fc:tj|j|d| | }|jdkrd|_nO|jdkrnC|jdvr|jdk|_n)t jtd|jz|r| ||}|S)zReturn diff options tweaked for this mq use, possibly upgrading to git format, and possibly plain and without lossy options.T)git whitespaceformatchangingr(keep)rrrs,mq.git option can be auto/keep/yes/no got %s) patchmoddifffeatureoptsrrupgraderrAbortr patchopts)r2r<patchfnplaindiffoptss r4rzqueue.diffoptsFs+ G  y$9     <7 " "#H   \W $ $  \_ , ,<61HLL+ABB,   9~~h88Hr7c|}|jsX|jdkrM|D]J}||d}t d|D|_|K|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. rrc3@K|]}|dVdS)rNr)rrxs r4rz"queue.patchopts..hs?##7;DOOM22######r7)copyrrrrclose)r2rpatchesrpatchfs r4rzqueue.patchopts_s==??|   7 7"  Wd33"##?E###    r7c:tjj|jg|RSr0)rrr)r2ps r4rz queue.joinnsw|DI*****r7cdfd}t|jD]\}}||r|cSdS)Ncl|ddd}|kS)N#rcr)rr)rrs r4 matchpatchz$queue.findseries..matchpatchrs.a  #A7799% %r7)ror)r2rr(rirs ` r4 findserieszqueue.findseriesqs^ & & & & &"$/22  HE1z!}}   tr7s'\s?#([-+][^-+# \t\r\n\f][^# \t\r\n\f]*)cg|_g|_|jD]}|d}|dkr|}d}n|dkr)|d|}||d}|}|r||jvr>t jtd|||j fz|j ||j |j |dS)Nr'rr7rs%s appears more than once in %s) rr rfindrrrrrrrHguard_refindall)r2rrzrcomments r4rzqueue.parseseries}s  I IAt ABwwa"1"ABB%KKMME IDK''+<== $))DO"<"<=> ""5)))!(()>)>w)G)GHHH% I Ir7c|stdSd}|d}|dvrtd||fzS|D]}||vrtd||fzcSdS)Nsguard cannot be an empty strings# r-+s*guard %r starts with invalid character: %rs!invalid character in guard %r: %rr)r2guard bad_charsfirstrs r4 checkguardzqueue.checkguards 9788 8! a E>>BCCG  L LAEzz=>>%KKKK L Lr7c|D]-}||}|rtj|.tt |}|jdd|z||_d|_ dS)Nsactive guards: %s  T) r4rrrCsetrr5rrr)r2guardsr1bads r4 setactivezqueue.setactives ' 'E//%((C 'k#&&& 'F $$  ,tyy/@/@@AAA"r7c|jg|_ |j|j}n#t $rg}YnwxYwt |D]r\}}||}|r<|j d| |j|dz|fzX|j |s|jS)Ns %s:%d: %s rc) rrrrrrror4rrrrH)r2r8rwr1r9s r4activez queue.actives   $ "D  ))$/::@@BB$    %f-- 4 45ooe,,4GLL&99T_55q1ucBC %,,U3333  s1A AAc|D]}t|dkr$tjtd|z|ddvr$tjtd|z||dd}|rtj||jd|j|}|dd|Dz|j|<| d |_ dS) Nrdsguard %r too shortrr0s!guard %r starts with invalid charrcr7cg|]}d|zSs #r1rgs r4 z#queue.setguards..s/J/J/Ja /J/J/Jr7T) rkrrrr4r,rErrrr)r2idxr8rAr9drops r4 setguardszqueue.setguardss  ' 'A1vvzzk!$9":":Q">???t5  k!$H"I"IA"MNNN//!ABB%((C 'k#&&& '}  doc&:;;#chh/J/J6/J/J/J&K&KK r7ct|tr|j|}|j|}|sdS|fd|D}|rdt j|dfSd|D}fd|D}|r?|rdt j|dfSddd |DfSd S) N)TNcVg|]%}|dr|ddv#|&S)-rcNrrrAr8s r4rBz"queue.pushable..sA   all4&8&8 =>qrrUf__A___r7Frc<g|]}|d|S)+rr@s r4rBz"queue.pushable..s)<<.s&666!aevooAooor7Tr6c6g|]}tj|Sr1)r"rrr$s r4rBz"queue.pushable..s#$G$G$GaZ%6q%9%9$G$G$Gr7)Tr7) isinstancebytesrrir r<r"rr)r2rC patchguardsexactnegposexactposr8s @r4pushablezqueue.pushables c5 ! ! )+##C((C',  :    "     9*+HQK888 8<<+<<<6666s666  I <Z.x{;;;;$))$G$G3$G$G$GHHH Hyr7c|r |jj}n |jj}|s |jjrt |t r|j|}||\}}|r||rz|'|td|j|znQ|s'|td|j|zn(|td|j||fz|sV|r*|td|j||fzdS|td|j|zdSdSdS)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 ) rwriterverboserPrQrrirVr)r2rC all_patchesrXrVwhys r4explainpushablezqueue.explainpushables  !GMEEGLE  $'/ #u%% -k'',, MM#..MHc x ;E@AA+c*+  LMM"k#./ >??#{3/56  E:;;;s+S12 E?@@+c*+9  *  r7cfd}jr0|ttjjd_jr|jjd_jr|j j d_j rK r,d fdj Dg_ dSdS)Nc|d}|D]}|d|z|dS)Nswb%s )rrXr )itemsrfprwr2s r4 writelistz"queue.savedirty..writelistsOT5))B & &1%%%% HHJJJJJr7Fc30K|]}|dv |VdSr0r1)rfqrepos r4rz"queue.savedirty..s1NNa%+9M9M9M9M9M9MNNr7)rmaprQrrrrrrrrrreadd)r2rbres` @r4 savedirtyzqueue.savedirtys        & Ic%.. @ @ @ %D    % Idot 7 7 7$D    % Id' 9 9 9$D  : JJLLE Od NNNN4:NNNNNNDJJJ   r7cD|d}tj|sdS tj|dS#t $rG}|jtdtj |zYd}~dSd}~wwxYw)Nsundoserror removing undo: %s ) sjoinrrexistsunlinkOSErrorrrrr" forcebytestr)r2rIundoinsts r4 removeundozqueue.removeundoszz'""w~~d##  F  IdOOOOO    GLL.//*2I$2O2OO          sA B> =>>"'//'2234 /M$0000Kg... / /r7c |i}|d} tj||||} tj|j||||||| || | dS)Nsstat)rrmatchrdiffordiffstatr) r2rIrnode1node2rzrachangesr<statms r4 printdiffzqueue.printdiff8sz <Dxx   M$u+ud 3 3! G   K K    r7cx|||gdd|\}}|dkr||fS|$tjtd|z|jtd|zt j||t|j||gdd||} t j | d} | r$tjtd | zt|d| | d }|!tjtd  t|||j} n2#t $r%tjtd |zwxYw|||}||d } t'| } | r| | |||||| | ||d|fS)NFT) update_statusstrictmergersapply failed for patch %ss"patch didn't work out, merging %s updater})remindsupdate returned %dforcerepo commit failedsunable to read %sw)ra)applyrrrrrrcleanrrr descriptionrrrr ExceptionrrrQrXrr rq)r2rImergeqheadrrevrerrrctxretphr"rs r4mergeonezqueue.mergeoneSs.:: 5't3  a !888O 9+a <==EFF F  Q=>>FGGG t dgtaSu====3ihs5)))  >+a 566<== = dD#//"3"3SXXZZt L L L 9+a 56677 7 ?V[[//@@BB ? ? ?+a 455=>> > ?>>(E22UD))99  # LL " " " tXtQ6:::  1v s (E11/F c |D|j\}}||jkr|S|jsdS|jdjS|j|\}}||jkr|d|jDvr|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. Nrcg|] }|j Sr1rTrxs r4rBz"queue.qparents..s'E'E'E1'E'E'Er7)dirstateparentsnullidrrT changelog)r2rIrrBp2s r4qparentszqueue.qparents{s ;},,..HRT[   < t<#( ('',,B   'E'E 'E'E'E!E!EI r7c ^|jsYd}t|ddd}|||jt ||d|_||}|D]}||d}|s-|j td|zdS| |\} } | s| |d{| |} | s-|j td |zdS| d } |||||| |\} }|r/|jt ||d|_| r| |fcS|d |fS) Ns.hg.patches.merge.markers[mq]: merge markerTrrspatch %s does not exist rMrZspatch %s is not applied rcr)rrrqrHrQrrlookuprrrrVr\ isappliedrrh)r2rIrrrpnamerrrrVreasoninforrs r4 mergepatchzqueue.mergepatchs| %0E$&;4HHHA OOD ! ! ! L   Au 5 5 6 6 6 $D }}T"" # #EMM%M55E ! Q;<yD$u++t, , / / / GLL066> ? ? ?7? P QMNNOOO G     4;;. . . . . . .  /s0A C" B CC"C"Tc dx} x} } |} |} |d} |||||||||| |  }| ||t | | | ||S#t$r*| | | | n#| wxYwxYw#t | | | ||wxYw)Nqpush all_filestobackup keepchanges) wlockr transaction_applyr rhreleaserqrabortr)r2rIrrrrrrrrrrrtrrs r4rz queue.applysq!  r "JJLLE99;;D!!(++B kk!'% +"       Be $ $ $ OOD ! ! ! !"        &HHJJJOO%%%%DOO%%%% Be $ $ $ OOD ! ! ! !s6=D0AB554D-*D>D-D))D--D00(Ec J|s|j}d} d} |D]} || \}}|s|| d5|jt d| zt j|| } t|| |j }n>#t$r1|j t d| zd} Yn.wxYw|j }|sd| z}n/|r| d | zd |}|jr| rytj|j||}t#|| z}|r-| r+t%t d t d  |||d| |z } |||\}}}|||| }n0|j t d| zdgd}}}|r|r|j5|D]}|j|d|j}|||dddn #1swxYwY|rEd|vrA|d}|d}d}t7j|||||}||z }t=j||pg}|j !}tE|d||j#|j$|d} |j !|kr!tKj&t d| !tKj&t d|r(|j' tQ| | |r+|j t dd} n1|r-|r+|j t dd} n| | fS)zreturns (error, hash) error = 1 for unable to read, 2 for patch failed, 3 for patch fuzz. tobackup is None or a set of files to backup before they are modified by a patch. rNTrs applying %s sunable to read %s rcsimported patch %s s imported patch %srsconflicting local changes foundsdid you forget to qrefresh?hint)rspatch %s is empty  p1_tracked .hgsubstate.F)rrs(qpush exactly duplicates child changesetsrepository commit faileds0patch failed, rejects left in working directory rds)fuzz found when applying patch, stopping ))rrVr\rstatusrrrrrrrrrHrr changedfilesr7rr}rrr parentchangeupdate_file_p1rB setparentsrsubmergekeysr matchfilesrtiprrrrrrrQ)r2rIrrrrrrrrrrr patchnamerVrrrrtouchedpatcherrrzrrdrBrLpctx overwritemergedsubstateroldtips r4rz queue._applys( !yH V V I#}}Y77 Hf $$YD$AAA GNN1-..: ; ; ;h 22B  9!5!5t~FF    Q566BCCC  jG .09<GNN#9I#EFFF**W--{ 1 2&3DGT2FFG!'llX5G;,@AA!"#A!B!BKKgDK999''1H*.**T2*>*>'5$($$U+++'< Q566BCCC()2q% / /]//11//"II 44Q44HHHH))++BOOB... ///////////////  /^y88DzDz! !,!5$dI"",,...&tU[b99E^''))FdGRWbgU$A~!!##v--kABByk!$?"@"@AAA ? ##K9$=$=>>>  JKK   QLMMNNNQxs%(B996C43C49AJJ J c |sn|}|r|d||D]:} tj||+#t $rY7wxYwg}|r |jd|}|jd|=d|_g}g}|D]H}||} | | d|f1| | |fI| d|D])\} }| dkr |j | =| |*|r|rSd|D} |D]C}td |j  t| ||fzDnBtd t!jd fd|D|d|_d |DS) NTrreversec(i|]}|j|jSr1)rUrTrrs r4 z"queue._cleanup..sEEE%uz5:EEEr7s*revision %s refers to unknown patches: %s sunknown patches: %s r7c3"K|] }|zV dSr0r1)rr$r3s r4rz!queue._cleanup..s'*D*Dq37*D*D*D*D*D*Dr7cg|] }|j Sr1rrs r4rBz"queue._cleanup..s222u 222r7)reforgetrrlrrrrr)rHsortrrrrrrrrr) r2r!numrevskeeprr$ qfinishedunknown sortedseriesrCrwrr3s @r4_cleanupzqueue._cleanuphsW  A ($w'''  Idiill++++(D  % XgX.I XgX& $D   . .A//!$$C{##RG,,,,##S!H----$'''" " "FQBwwOA&&q!!!!  F FEE9EEE ;;AJKKCGLLc!f q'9!9::::;011k#((*D*D*D*DG*D*D*D"D"DEEE 22 2222s'A"" A/.A/cv||jdj}g}t|D]\}}||kr$t jt d|z||}|j|j}||kr&t d} t j| |z|j|j} dD]K} || | zkr.t d} |j | | znL| | |S)Nrsrevision %d is not manageds/cannot delete revision %d above applied patches)[mq]: %ssimported patch %ss-patch %s finalized without changeset message ) rrTrrorrrrUrrrrH) r2rIrevsfirstrevr!rwrrbaser3rfmts r4 _revpatcheszqueue._revpatchess4 Q,-1133oo " "FAsX~~k!$A"B"BS"HIIIs)C<?'DxxzzT!!JKKk#),,,LO(E:  ??$$e 33MNNCGNN3;///E4 NN5 ! ! ! !r7cF|j||t|}||t |}|r|jddr||d}tj|j}| |kru| |krM| d5}tj ||||ddddS#1swxYwYdSdSdSdSdS)Nr&r,rqfinish) _phasecacherrCrrkrrrnewcommitphaserrBradvanceboundary)r2rIrr!roldqbasetphasers r4finishz queue.finishs| ""466MM'3w<<88  H++E9== HIaL)H*4733F~~&((X[[]]-@-@-B-Bf-L-L%%j11HR*4VYGGGHHHHHHHHHHHHHHHHHH  H H H H)(-L-Ls)DDDcR|s6|ds!tjtdg}|D]}||d}||}|r$tjtd|z||jvr$tjtd|z||vr||d}|dr|js!tjtdtj ||d}| | ||} || z }t| }||||d dS) Nrevs4qdelete requires at least one revision or patch nameTrscannot delete applied patch %sspatch %s not in series filerno patches appliedr)rrrrrrrrHrrrevrangerrrkr) r2rIr!r< realpatchesrrrr revpatchess r4deletez queue.deletes txx// +IJJ   * *EKKdK33E>>%((D Pk!$E"F"F"NOOODK''k!$B"C"Ce"KLLLK''""5))) 88F   &< <k!$9":":;;;&tTXXf-=-=>>D IIKKK))$55J : %K*ooG k7DHHW,=,=>>>>>r7c|jrf|jdj}|jdj}|j|kr!t jtd||fSdS)z'check that working directory is at qtiprs&working directory revision is not qtipNN)rrTrUrrBrrr)r2rItoprs r4 checktoppatchzqueue.checktoppatchsk < ,r"'CL$)E}!!S((k!$M"N"NOOO: zr7cxt|tr |dd}n|j|j|jf}t d|DrdS|js|js|dddS|jr|dddS|dddS)Nrc3K|]}d|vV dS)rNr1)rrzs r4rz,queue.putsubstate2changes..s'99E%'999999r7rcrrdr)rPrmodifiedrremovedr any_trackedrH)r2 substatestatermars r4putsubstate2changeszqueue.putsubstate2changess gt $ $ E"1"+CC#W]GODC 99S999 : :  F   *m&? * FMM. ) ) ) ) )  " * FMM. ) ) ) ) ) FMM. ) ) ) ) )r7cd}|r d}tdtd|}|stj||js|js|js|jr3tdtj td|zt|r3tdtj td|zntj|d|S) Nr7s, qrefresh first#local changes found, qrefresh firsts,local changed subrepos found, qrefresh firstslocal changes foundslocal changed subrepos foundT) skipmerge) rrr checkunfinishedrrr deletedrrrO)r2rIrrefresh excsuffixrNs r4checklocalchangeszqueue.checklocalchangess  ?+I 4 5 5 5 = > > > KKMM :  #D ) ) )z IQW I  IQY I()))k!$:Y$F"G"GHHHT"" 1222k5 ABB   #DD 9 9 9 9r7)rrrrs..c||jvr$tjtd|z||kr!tjtddD];}||r$tjtd|z ! !+?@@4G  4::<<  +CDD '  Fv&& k:;;fD ,  ADyykABB&q))*  r7c|||stj||r|tj||r$t jtd|zt jtd|zdSdS)Ns""%s" already exists as a directoryspatch "%s" already exists) rrrrkrisdirrrr)r2rUrs r4checkpatchnamezqueue.checkpatchname#s t$$$ J $88 Jw}}TYYt__-- Jk;<}|r|d?|gn#|@xYwnt#t$rg|,|} tjC|n:#t$r-|jEFt1d!|zYnwxYwwxYw|G|ddddS#1swxYwYdS)"zToptions: msg: a string or a no-argument function returning a string msgediteditformsmq.qnewuserrer'Trs checknamersincludesexcludecD|dkrtjd||fzdS)Nrr})rr)rdr3s r4badfnzqueue.new..badfn^s.&&+i1c(&:;;;'&r7N)r1rrrcscannot manage merge changesetsrscannot write patch "%s": %sreditformc4|r|SSr0)r)desc defaultmsgs r4 finishdesczqueue.new..finishdesc}s;;==.#'K#--r7+Leave message empty to use default message.r8extramsgr4rreditorr%d %dr7)rrrr<serror unlinking %s )Hr byteskwargsrr! parsedaterrrOr get_entryrrrrrextendrrr rrkrrrrr fullseriesendrrrr strtolocalstrerrorr getcommiteditorrrrrHrQrrrrrrrrrrrBrTrrrrXrQrr rdiffr rergrollbackrrrlrmrrrq)!r2rIrpatsr<r3editr4rrrrKr r1rr commitfilesrpr$er=r8r; commitmsgrnctxrrchunkschunkr patchpathr7s! @r4newz queue.newJs#D))hhvxx  88K44xx  xx    ,%d++D==&$((6*:*:!;4=HH 88L$ ' ' )    ( ( ( &&  D M33NCCM 88J   ?488J#7#7 ?4 ? < < <M$t*dDFFFEkkk..GG,,T,>>G8nn 7+,,,7=)))7?+++"455 tDz!!## $ $q ( (+a ABBCC C 4   ##%% ZZ\\X "X " KK..   k455 3AJ ? ?@A  N (72  0(CCC2..... !!OPPH$4#-!)!)F !$II # 1zI!   9+a(=&>&>???%6=YDOF6M2L'' Aw(?(?@@@$$&&&'+D$(,D%7D$TYYw%7%7HHB) 4(((4 8d?333LLTWWYY^^%5%5!6!6777**,,2244Cj..0000!MM#&&&GGE"II&&&" +!%tQ!7!7#M 44]GLLL!) "("#$+!) """&,++EGGENNNNGGIII A/$ WI...MMOOO    IIg.. IIi((((IIIGLL#:!;!;i!GHHHHHI   OOD ! ! !qX "X "X "X "X "X "X "X "X "X "X "X "X "X "X "X "X "X "sYJ'&Y' K31=K..K33Y7BV:HVV:V66V:9Y:X+W/.X+/4X&#X+%X&&X++YYYcrt|jD]!\}}|j|kr||j|jfcS"dS)zreturns (index, rev, patch)N)rorrUrT)r2rrwr s r4rzqueue.isappliedsKdl++ + +DAqv1616****tr7cNfd}|jvr|Stj|s t |}t j |cxkrt jkrnn%j|Sn#ttf$rYnwxYw|sQ||}|r|S| d}|dkr}||d|}|rhj |} t ||dzdpd}||z dkrj||z Sn#ttf$rYnwxYw| d} | dkr||d| }|rzj |} t || dzdpd}||zt jkrj||zSn#ttf$rYnwxYwtj td|z)NcjvrSfdjD}t|dkrNjt dz|D]}jd|z dS|r|dSjrCjr<dkr#jddz Sdkr jdSdS) Ncg|]}|v| Sr1r1)rrrNs r4rBz5queue.lookup..partialname..s888Qaqr7rcspatch name "%s" is ambiguous: s %s rqtipTqbase)rrkrrrr seriesend)rNmatchesrr2s` r4 partialnamez!queue.lookup..partialnamesDK8888$+888G7||a QABBQFGGG 00AGLLQ////t "qz!{ *t| *<<;t~~d';';a'?@@==;q>)4r7rHrrcrKspatch %s not in series)rrrisfilerintrkr OverflowErrorrfindrirrr) r2rrr[snoresminusrwoffpluss ` r4rz queue.lookups     $ DK  Lw~~dii..//$ < ,%jj $$$>>>>c$+.>.>>>>>>;s++? .      <!k%((J D))A::%+eFUFm44C< K--c22<"%eEAIKK&8&=A">">C !3w!||'+{1s7'; ; ,!+M:!!! D! {{4((199%+eETEl33C< K--c22<"%eD1HJJ&7&<1"="=C !3wT[)9)999'+{1s7'; ; :!+M:!!! D! k!566>???s6BB,+B, EEE$G,,H?Hc || ||} |5g} |D]} | | | s|jg} |j| vr)|s'|j td|j s5|j td ddddS|rR||}||}|rY|dt!|jdz kr8|j td|z ddddS||\}}|rU|j ||kr$t+jtd|zn|rtd|z}ntd}|j td ||fz ddddS|rW|j d }||r5|j td  ddddS|}|t!|j kr5|j td  ddddS|s| s|||j |r| r!t+jtd|r!t+jtd|jr!t+jtd|j |}t1|||jj}|s$t+jtd|z|||dkst9j|||r"|s!t+jtdt=|jD]7\}}|j !|dd|j |krn8t=|j|dD],\}}|j !|dd|krn-||z}|t!|jksJ|j|}|j|=|j"|||#d|_$d|_%|dkr|&||s|j |}|dz}n|j ||dz}tO}| s|s| rn||d}| r3||j(|j)z|j*z|j+zn"||j(|j)z|j ||}tO} |r|,|||| }n|-|||||| }n#t\$r|j tdt_j0|j ||dd|D]'}||jvr|j12|d(|j tdxYw|js|dcdddS|jd j3} |dr9|ddkr-td}!|j 4|!| zn*|j 4td| z|dcdddS#1swxYwYdS)Ns"(working directory not at a head) sno patches in series rrcs qpush: %s is already at the top s#cannot push to a previous patch: %ss guarded by %ssno matching guardsscannot push '%s' - %s rs"all patches are currently applied s#patch series already fully applied )rs.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 recordedrs please specify the patch to moveTrrs!cleaning up working directory... ) no_backup ignoremissingsdone s0errors during apply, please fix and qrefresh %s now at: %s )5r)rr branchmap iterheadsrBrrrBrrrrrrrrkrrVrirYrrrrrrrrrrorr,rrprrrrr7rrr rrrrr revertwvfs unlinkpathrUrX)"r2rIrrrrallmoveexactnobackuprrheadshsrrVrrtroottarget fullstartrpnrwri fullpatchendrrrNrrrdrr3s" r4pushz queue.pushs  k5111==?? ZZ\\b b Enn&&0022 ! ! R     & }!!..u.q!GHHIII;  Q899:::b b b b b b b b "  E**~~e,,DGs4<'8'81'<<<GLL>??%G1b b b b b b b b 4$(==#7#7 & {((//$..2B2BBB#kDEEMC :!"#3!4!4v!=!"#8!9!9GLL455GQb b b b b b b b R  B>>%((GLL#I!J!JKKK[b b b b b b b b hNN$$EDK(((( QFGGHHHob b b b b b b b p C C&&tT\&BBB ,+KLL+CDD<+EFF{5)$TYYt__dnEEL+?@@4GF|tDz11IdF+++ (N+a(K&L&LMMM&/&@&@NIs}**32215U9KKKL' (CDDFAs}**32215>>?!A s4?333333 OE2 OE*&&y)<<<  """#' $D qyy""4((( : E*aik''u559uuH D D; D//D/AADOO ,' .)!.)OOFOfl$BCCC E#I&AI  //$8DDCC**"+!)$/ %C"     QDEEFFFGJ" #DDA -- ,,Qd,CCC Qy\\***< 1vwb b b b b b b b x,r"'C1v 8#a&1**LMM cCi(((( a0036777q6Eb b b b b b b b b b b b b b b b b b sUB>_ A;_C_A _8A_L0_ 6Z_B(\))_B___c F ||||5|rg||}|s||}||}|s$t jt d|z|js6|j t d| cdddS|rd} n%|r |ddz} nt|jdz } | t|jkr8|j t d|z ddddS|s]|j d|jD} D]/} | | vr)|j t dd}0nLd |d Dtfd |j| dD}t} |rt|||p| } |r%|s"| | j| jzn4|r2| | j| jz| jz| jzd|_t|j}|j| j} |j|}nF#tj$r4t5|}t jt d |zwxYw||jd jgkr!t jt d||jd js0t jt dt d|r|||}||}||d}|j|j|j|jf\}}}}|r!t jt dt||z|z| z} |r#| r!t jt d||| |j 5|D];}|j !|d|j "|dd<||zD]b}||}|#||$|%|j "|ddc|&||j'dddn #1swxYwYtQ|j| |D]1}|jt d|j)z2|j| |=tU|j||gdd|dj+,D]3\} }|d-| .|4|jr;|j/t d|jd j)zn'|j/t dddddS#1swxYwYdS)Nspatch %s is not appliedno patches applied rrcsqpop: %s is already at the top cg|] }|j Sr1rrs r4rBzqueue.pop..s333af333r7sqpop: forcing dirstate update Tc6g|]}|Sr1rrOs r4rBzqueue.pop..s BBB16688BBBr7c3*K|] }|jvVdSr0r)rrrs r4rzqueue.pop..s;.3EJ')r7rstrying to pop unknown node %srs?popping would remove a revision not managed by this patch queues&popping would remove a public revision see 'hg help phases' for detailsrrs!deletions found between repo revsrrgFr wc_trackeds popping %s rrispatch queue now empty )0r)rrrrrrrrrrkrrrr7rrrrr rrrTrrs LookupErrorrmutablerrr}rrmrn update_filewwritedataflagsrrreversedrUrrDr`rErrX)r2rIrrrrorrrrrtrrr$rrNrzrrsrTqprstrr rdrdfctxstaters @r4popz queue.pops k5111 ZZ\\n =n = M~~e,,/ KK..E~~e,,M+a(B&C&Ce&KLLL<  Q677888wn =n =n =n =n =n =n =n =  . .Q! DL))A-DL)))) QBCCeKLLL3n =n =n =n =n =n =n =n =6 -//1133dl333 &&ABww Q'I%J%JKKK!%& CBT$Z-?-?-A-ABBB7;|EFF7KuuH **4u7K *LL#>  QW(<=== OO QW,qy819D!%D dl##C,u%*C N,,S11$ N N NSzzk!$D"E"E"LMMM Nb).///k7  R(-.6688 k?@@>?? 5]]4--2h[[T**["(BJ J 1aO+a(L&M&MNNNq1uqy>>H4Q8Q+a(N&O&OPPP D(+++]//11 5 5 ,,Qd,CCC 11%E2U"1v Atyy{{DJJLLAAA 11$42OOB 444 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5"$,uSy"9:: @ @q11EJ>???? U3Y' $'4#uU C C C C J/5577 - -5T q!!%%e,,,,| = a004<3C3HHIIII a :;;<<<]n =n =n =n =n =n =n =n =n =n =n =n =n =n =n =n =n =n =s`BZA-Z EZ*KZALE:ZCU ZU ZU D1ZZZcV||\}}|s)|jtddS|||}|drd|}}n|d}}|||} ||| ||||dS)Nr}sreverse)rzr<)rrrXrrrrr) r2rIrIr<rrrrrrs r4rGz queue.diffAs''-- U  GMM!344 5 5 5 F ]]4 % % 88J   $5EEt5E==u-- tXue4dKKKKKr7c L<=>?tj|}|js)|jt ddS|dd}|d}|dd}|d}|d }|rd tj |z}| } | ||jd j |jd j } } |j| | gkr!t!jt d || s0t!jt d t d|j| } ||| } t+|| }|r|jd}t1|| |j?|d|di| d}|r?||r?|?t?| | | dd}|!| | }|j"|j#|j$}}}|| }|dd}tKj&|d||}|drMtKj'|||z|z|(z}tKj&|d|}ntKj)|}|!|}|j"|j#|j$|j*f\}}}}tW|}tW|}tW|}|D]}||vr|,||D]F}||vr+|-||,|1|,|Gg} ||zD][}||vr+|-|| .|1|/||,|\ta|}ta|}ta|}|!| |}|j"|j#|j$|j*f\}!}"}#}$tW|!|"z|#z|$z<D]}-|j=d|-|D]}-|j?|-dg}tt|dz d d D]1}.|||.s|.||.||.=2|D]}-|j?|-d|D]}-|j?|-d| D]}-|j?|-d?jBp|B}/|| C}0|jD| |jEd|_Ft|j|| gdd|(Ht|(n#t|(wxYw dddn #1swxYwY d| z=tjK| }1|rI=?fd!}2t d"}3tjK|2|3|#}1|pd$?jL}4n>|s%?jLs=}4n2d$?jL}4n|}4?M|dx}5}6 |N}5|Od%}6t||0|4|/?jQ|d|1&>d'|%D}7|r|R||7tjT|| |7|(}8t?}9|9r||9|8D]}:||:|H|jV};|;W||6>fd)|'D|6H|j.t>| tjI|6|5n#tjI|6|5wxYwn#|| d*}|jZ| |[|\|j]t d+xYw | I|^|dS#| I|^|wxYw),Nr}rcr+r7r,r-s mq.qrefreshr.rer>rs(cannot qrefresh a revision with childrenscannot qrefresh public revisionrrrr'Tr/r) atomictempshortr<r2c:g|]}|Sr1) intersection)rr allmatchess r4rBz!queue.refresh..s%OOOQannZ88OOOr7s mq.refreshFrrrrr3c^|r||SSr0)rr)r6r7rs r4r8z!queue.refresh..finishdescs0;;==(MM$///#'K))r7r9r:rr&r<c,g|]}t|Sr1)rrs r4rBz!queue.refresh..:s999Qa999r7)rr<cg|]}|fSr1r1)rbmrs r4rBz!queue.refresh..Hs1K1K1Kb2q'1K1K1Kr7rsNqrefresh interrupted while patch was popped! (revert --all, qpush to recover) )_rr?rrrXrrrr!r@rrrTrUrrsrrrrrrOrrArrrrrrrrrrrrr rrrrzmatchallrr7rgremoverHdiscardrr bookmarksrrrrcopied setdefaultr copysourcerBr`rcopiesrrlrkrrrrrrr rr rFrrrrrrr rrGrQ _bookmarks applychangesrQlockmodrebuildmanifestrhrrq)@r2rIrIr<r3rJr4newusernewdaterrrcparents patchparentrKr rr"rmmaaddraaamatch1rstbrr rrrrcmcacrcdrefreshchangesrzbmlistdsguardrdstsrcdstsrdrwroldphaser=r8r;rrrrrOrrPmarksrr7rrs@ @@@@r4rz queue.refreshNs #D))|  GMM!344 5 5 51hhvs##**,,xx  88K88((7##((7##  =!3G!?? ~--c22H--c22K$T;77H H $ 7 7 G G TYYw//@@B}}&))*G4%H $ 7### $ 7### LL[)) * * *[[$4[@@F[#..Bbh BBs)CQQQ%C]4:tT::Fxx!! / *4b2 1NOO tDz===(..++E+**Csy#+s{JJAq!QRBRBRB   B;;FF1III  77IIaLLLFF1IIIIFF1IIIIFU  77IIaLLLMM!$$$JJqMMMq RARARA[77B["(BJ JNBBR"Wr\B.//JOOOO2r2,OOONMME#   Q&tU33E#Y((**F++--B %B %?%+9$ NNG|!8x'7!8!##$C"&-"6"6s";";C #3$-3G3G & 1 1#r : : A A# F F F M55 #$6$' 0 0C"%c("5"5"7"7C"< & 1 1#r : : A A$*JJsB$7$7!"!"!"$'!88$*3K$6$6s$;$;$;"f}}$*3K)/==IC'+== $ 2 23 < < < <==$%C M55 #$6"&dm&:&:&<& . MMOOO OOD ! ! ! ! ! MMOOO OOD ! ! ! !s}4So8d L!c=-d=dd o8d""o8%d"&o8*B'l>D;l# l>#l::l>=o8>B o  o88+p#c |sEtj|jr!tjt d tj|jn#t$r|sYnwxYw|r|dSdS)Ns$patch queue directory already existsTcreate) rrrrrrmkdirFileExistsErrorre)r2rIrs r4initz queue.init]s J"'-- 22 J+a GHHII I  HTY             +::T:** * + +s A## A32A3c|r-||jvr$tjtd|z|s|}n|j|dz}g}t |t|jD]S}||\}}|r"| ||j|f| |T|S)Npatch %s is not in series filerc) rrrrrYrirlrkrVrHr\)r2rIrrt unappliedrwrVrs r4rzqueue.unappliedhs  LU$+--+a ABBUJKK K 1NN$$EEK%%e,,q0E uc$+..// $ $A#}}Q// Hf 6  !T[^!4555   # # # #r7rcvfd}djD}|tj|z }|sjjrtd||zdz z} t |||zD]l} j| } | |vrd\} } n&| drd\} } nd\} } d }jjr d | | | fz}n |r|| kr_||| | mdSg}tjj D]\}}}|tj dzd}|D]k}tj ||}|jvr@|j j j fvr*|d s||lt!|D]}jjrd pd }|||d  dS)Nc|rj|r t|j}|jr|jd}nd}jrZjt|z t|z dz }|dkrtj ||}nd}j|d|zjdj|d|znj|d|zjddS) Nrr7rdsqseries.labels: sqseries.message.r) rrXrrrr formatted termwidthrkr"ellipsis)pfxrrrr3widthr2summarys r4 displaynamez"queue.qseries..displaynamesP # c""" D 9!5!5t~FF:*Q-CCC7$$&&" G--//#c((:S^^KaOEqyy(1#u==! i{U/B CCC e$$$ c)z queue.qseries..s000a16000r7%drc)Aappliedr)U unapplied)Gguardedr7s%*d %s rsD missing)rrkrrrYrlrVrwalkrrrrrrmrHrC)r2rImissingrtlengthrrrridxwidthrwrcharrr msng_listrudirsrzrrdflrs` ` r4qseriesz queue.qseriesws[ ! ! ! ! ! !.104<000 >%%-F$ 0w =u(:;<<5%&.11 / / AG##"2KD%%]]1%%a(3"4KD%%"2KD%7?$!T'::CC$ C.... / /I%'WTY%7%7 - -!dETY!+--. - -Aa++B$+-- O O O  !# d 3 3 "((,,, -I&& 0 0go/%63 CJ//// 0 0r7c |jdkrdSdS)N.hg.patches.save.lineTr)r2rs r4 issavelinezqueue.issavelines 6- - -4 . -r7c|j}|jjrz|jss|jj|_|dd|jddd|dd|jddd|s2t j| drtj ||j|SdS)Nrs formattedsmqpagers interactiver)rr) rrr pageractiverrrrrrr repository)r2rrs r4rez queue.qrepos [     7  r~ !W0BN LLul33     LLun55      DRW]]499V#4#455 D=$)FCCC C D Dr7c||}|}d}g}g} d} t|D]\} } | dkr| dz}| dr>| } | ddd} d| D} d|u| } | dd\}}|r1| tt|||| |)|j tddS|j td |d z||_ | |_|d |_d |_|j}|r||vr(|j td ns|j td t)|z|j}||vrd }nd}t|j ||g|d| r|j tdt)| d t)| dfz|r|j td|}|s)|j tddSt3j|| d dSdSdS)Ns Patch Data:rcs Dirstate:rr6c,g|]}t|Sr1)rrs r4rBz!queue.restore..s)))!s1vv)))r7rXsno saved patch data found srestoring status: %s rTs*save entry has children, leaving it alone sremoving save entry %s Frs&saved queue repository parents: %s %s supdating queue directory s unable to load queue repository )rrrrormrrrHrQrrrrrrrrrrrsrrrrrerr)r2rIrrqupdater6rq datastartrrqpprwrxrrrUrspprrs r4restorez queue.restores=Cy$$&&,,..!!  '' % %GAt~%%E .. %KKMMbccFLL&&))q)))&KKMM''$**4%NN;s1vvt#<#<====MM!$$$   GLL9:: ; ; ;1  Q011E!H<===    $$&&  I% QMNNOOOO Q:;;eCjjHIII]**,,"99!FF"FdgtcU6%HHHH  $ GLL<==Q==%A--01    $q!>??@@@JJLLGLL#G!H!HIII1CF##### $ $  $ $r7c|js)|jtddS||jdr)|jtddS|std}nd|dz}|}|rI|j}|dt|d t|dfzz }|d z }|d d |jDz }|d d |j Dz }| |d}|s)|jtddS|j t|dd|_||dS)Ns"save: no patches applied, exiting rcrsstatus is already saved shg patches saved states hg patches: s s Dirstate: %s %srs Patch Data: r7c3 K|] }d|zV dS)r_Nr1rs r4rzqueue.save..! s&::! ::::::r7c3 K|] }d|zV dS)s:%s Nr1rs r4rzqueue.save.." s&>>1 >>>>>>r7Trsrepo commit failed r)rrrrrrrerrrrrrrHrQrrq)r2rIr3rrrs r4savez queue.save s|  GLLABB C C C1 ??4<+ , ,  GLL788 9 9 91 8-..CC!CJJw$7$77C JJLL  C##%%B '3r!u::s2a5zz*BB BC ## sxx::T\:::::: sxx>>do>>>>>> KK4K ( (  GLL233 4 4 41 K+CDDEEE  r7c|jrB|jdj}||}|t|jS|dzSdS)Nrrcr)rrUr)rkr)r2r$rzs r4rCzqueue.fullseriesend+ sO <  R %A//!$$C{4?+++7Nqr7cd}fd}jrMjdj} j|}n#t$rYdSwxYw||dzS||S)zIf 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|tjkr|St|tjD]5}|\}}|r|cS|6tjSr0)rkrrlrVr\)rtrwr$rrZr2s r4 nextpatchz"queue.seriesend..nextpatch; s es4;'7'777 5#dk"2"233 ( ( MM!,, 6HHH$$Q''''t{## #r7rrc)rrUrrir)r2rZrzrr$s`` r4rYzqueue.seriesend4 s  $ $ $ $ $ $ < & R %A k''**   qq 9S1W%% %y~~sA A Ac|j|j}|jjs|}n#d|j|zdz|z}|S)Nrr6)rrUrrYrri)r2rirr$s r4 appliednamezqueue.appliednameN sN U#(w BAA**5111T9EAAr7c fd}|rO|r!tjtdtj||}|dn#|s!tjtdt |dkst |dkr#|r!tjtdg} |r|j|j | } t | dkr6tjtd| zj r |j | } | d j Dvr6tjtd | z| j d j gkr6tjtd | z|j j d j } |j| d } ni| |j | gkr6tjtd| zd} d|i} |d5}|D]s}||s3tjtd|ztd|j|\}}|j |}|t$kr$tjtd|z| r,| |kr&tjtd|| fz|} |sK||ddd d|z}||||jd ||d5}t5j||g|| dddn #1swxYwYt9||}j d |j|| |d}|r=|j ddr"tCj"||tBj#|g$d_%d_&u dddn #1swxYwYtO|D]U\}}|r;|dkr!tjtdtQ|})|tUj+|,rX-|}t\j/0|s$tjtd|z|rl||j1td||fztej3|-|ne|}na|dkr#|s!tjtd |s?tQt\j/4|5d!}|| |dkrjj67}nBtqj9j|}|7}|:n9#tvtxf$r%tjtd"|zwxYw|d}|1||:|s |||j=vr$>|z}|gj||<$d_&j?td#|zj|| |d}W@|| S)$Ncb|jvr$tjtd|zdS)Ns&patch %s is already in the series file)rrrr)rr2s r4 checkseriesz"queue.qimport..checkseries` s=DK''k?@@9L('r7s*option "-r" not valid when importing filesTrsno files or revisions specifiedrcs5option "-n" not valid when importing multiple patchess/revision %d is the root of more than one branchcg|] }|j Sr1r)rrs r4rBz!queue.qimport.. s999qAF999r7srevision %d is already managedrs*revision %d is not the parent of the queuers"revision %d has unmanaged childrenr'qimportsrevision %d is not mutablerrscannot import merge revision %ds#revision %d is not the parent of %drs%d.diffrrr&r,rHs%-e is incompatible with import from -spatch %s does not existrenaming %s to %s s$need --name to import a patch from -/sunable to read file %ssadding %s to series file )ArrrrrrrkrrsrTr3lastrr parentrevsrrrrr'rrrrrprr exportfilerQrrHrrrretractboundaryrrrrronormnamerr#urlislocalrrrr\rXrrybasenamerfinrropenpathr rmrrrCrrq)r2rIrzrrexistingrrrimportedrsr lastparentrrrrBrrraserwfilename originpathtextr"ris` r4qimportz queue.qimportV st        E kCDD%dC00C HHTH " " " " E+a BCCDD D JJNNc#hhll l+JKK  J ,N(()<)??!^66t<>>+?@@399;;N" }}fc]33H!!*--+ ,*,*,A7??,,#k;<>*55#k899HD)'' 5999GMM011Xy4IIK DIIi,@,@AAAA (IIt##I#+ABB# ((()>)>??!!I##Iu555O4''#w{//11[(;;!wwyy )OOO+a(A&B&BX&MNNNOY55 T"""  ' I&&& ++**,,q009{e ,      #D  GLL899IE F F F J  i ( ( ( OOI & & &II sEFVR." V.R2 2V5R2 6CVV  V $A'_  6`r0)NNFr)NNNNN)FTFNNNNF)FT) NFFNFFFFF)NFTFFF)NrNNFr)NNNNF)Ar>r?r@rVr propertycacherrrr rrrrr)r#compiler,rr4r:r<rErVr\rhrqr}rrrrrrrrrrrrr rrrrr'r)rRrrr{rrGrrrrrrerrrCrYrrr1r7r4rrs#!#!#!#!J (    !!!!!!2   +++rzEFFHIII. L L L   !!!$    (%%%%N,   ////*      6&&&P*%%%N///(."."."."hoooob.3.3.3.3`0 H H H???: * * *.?I,JJJJ2PPP}"}"}"~;@;@;@;@@   qqqql y=y=y=y=v L L LM"M"M"M"^ + + + +    $G0G0G0G0RDDDD*5$5$5$5$n64  ffffffr7rc|ddr*|ds|dr|St|}d|d<|S)Nr&r*forceexactT keep_changes)rrdictrr<s r4fixkeepchangesoptsr! sc MM% 0 0 88H   88H    ::D D Kr7sqdelete|qremove|qrmkrskeep patch filerrs%stop managing a revision (DEPRECATED)sREVshg qdelete [-k] [PATCH]...) helpcategoryc|j}|||tj||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)mqrrr?rh)rrIr!r<qs r4rr s>0 AHHT7H066777KKMMM 1r7sqapplied1lasts%show only the preceding applied patchshg qapplied [-1] [-s] [PATCH]c |j}tj|}|rK||jvr$t jt d|z|j|dz}n|d}| dr&|s$| t ddS| dr*|dkr$| t ddS| dr|dz }d}nd}| |||d | d  d S) zhg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... [FILE]...c ztj|}|5|j} ||||d|d|d|d|d}|n#|wxYw dddn #1swxYwY|rF|dr1|ds|||d Sd S) aimport 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. r2r0rrr')rrrrrNr6rr)rr?rr%rrrhr{)rrIrr<r&rs r4rru s_j   % %D    G yy((7+++..hhx((HHV$$HHV$$!H KKMMMMAKKMMMMM               *DHHW%%*dhhv.>.>*vvdHRL))) 1s)C(A;C-C(CC((C,/C,c|j}|||}||rQtj|ds|dd}|d|d|d|d|d| tj|ds(|dd |d  ddgtj ||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 .hgignorers^\.hg s^\.mq s syntax: glob sstatus sguards rNr) r%rrhrrrkrsrmrXr rgr )rrIrr&rras r4qinitr9 sD A tVAKKMMM w~~aggl3344  d++B HH[ ! ! ! HH[ ! ! ! HH& ' ' ' HH[ ! ! ! HH[ ! ! ! HHJJJw~~aggi0011 , FF9d # # ) ) + + + $ \9-... R 1r7sqinitcs create-reposcreate queue repositorys hg qinit [-c]T)r# helpbasicc Lt|||dS)ainit 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. create_repor)r9rrrIr<s r4rr s%$ T$((="9"9 : : ::r7sqclonepulls"use pull protocol to copy metadatarnoupdates)do not update the new working directories uncompresseds)use uncompressed transfer (fast over LAN)prs#location of source patch repositorysREPOs#hg qclone [OPTION]... SOURCE [DEST])r#norepoc \tj|}d}|tj|}t j||\}}}tj|||}|dr-t j||d\}}}n ||} tj|||n4#tj $r"tj tdwxYwd\} } | r| } | j jr| | t jkr| j jdj} tj|st)| } t-| | | } | | j| dnA|dr, |d} n#tj $rYnwxYw|td tj|||||d | d |d  \}} |tdtj|||dp |||| |d |d |d | r| } | r7|tdtA|| | gd d|dsR|tdtj!| | j"dSdSdS)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. cr|}|dr |dd}|dzS)z+compute a patch repo url from a repo objectrNrs /.hg/patches)r endswith)rIr s r4rzclone..patchdir s;hhjj <<   crc(C_$$r7Nrs4versioned patch repository not found (see init --mq)rrslookuprXscloning main repository r?FrA)pullrrstreamscloning patch repository r@)rGrrHs6stripping applied patches from destination repository rs updating destination repository )#rr?r defaultdestr#get_clone_pathpeerrr RepoErrorrrlocalr%rrrrrTr r7rsr differencerHrrcapablerrvcloner rrr)rsourcedestr<r__ source_pathsr patchespathqbasedestrevrIrsdrs r4rPrP s\   % %D%%% |~f%%!0V<<B R T; ' 'B xx #%4R*9M9MNNKhrll   D+&&&& ?   k E F F     NE7 xxzz xxzz 7? AtE{0022fmCCGOA&+E:d## ADJJLL))u// 50A0ABBCCt~55e<s r4rr~ sG GOO dhhy))488I3F3F 1r7sqtops hg qtop [-s]c |j}|jr|d}nd}|r2|||dz dd|ddS|t ddS) z>print the name of the current patch Returns 0 on success.Trrcrrr.r}N)r%rrYrrrXr)rrIr<r&ts r4rr s Ay KK     a%HHY''       *++,,,qr7sqnexts hg qnext [-s]c |j}|}|t|jkr$|t ddS|||d|ddS)zDprint the name of the next pushable patch Returns 0 on success.r-rcr)rtrrN)r%rYrkrrXrrr)rrIr<r&rzs r4nextrb sw A ++--C c!(mm +,,---qIId#a)1D1DIEEEEEr7sqprevs hg qprev [-s]c |j}t|j}|dkr$|t ddS|s$|t ddS|j|jdj}|||dd| ddS) zHprint the name of the preceding applied patch Returns 0 on success.rcr*r}rrr.N) r%rkrrXrrrirUrr)rrIr<r&rrCs r4prevre s A AIAAvv .//000q  *++,,,q (..2+ , ,CII C$8K8Kr7c|ds,|dr||d<|ds0|drdtjz|d<dSdSdS)Nr. currentuserre currentdater>)rusernamer!makedater s r4setupheaderoptsrk s 88G  &.!9!9& W 88G  7.!9!97 8#4#6#66W 7777r7sqnewr,s invoke editor on commit messagess'import uncommitted changes (DEPRECATED)rgs#add "From: " to patchur.sadd "From: " to patchsUSERDrhs#add "Date: " to patchdresadd "Date: " to patchsDATEs0hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...)r#r;rZctj|}tj||}|j}||d<t |||j||g|Ritj||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. r+r) rr?r logmessager%rkrR strkwargsrh)rrIrrr<r3r&s r4rRrR sV   % %D  R & &C ADLB AE$9999 24 8 8999KKMMM 1r7sqrefreshrs;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]...cPtj|}|j}tj||}t |||5|j||fd|itj|}| |cdddS#1swxYwYdS)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. r3N) rr?r%r rprkrrrqrh)rrIrIr<r&rrs r4rr sD   % %D A T**GB aidLLL83Ed3K3KLL s9BB"Bqdiffshg qdiff [OPTION]... [FILE]...c|d|j||tj|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. rsr)pagerr%rGrr?)rrIrIr<s r4rGrG` s>.HHXGLLtX1$77888 1r7sqfoldskeep folded patch filess/hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH...c >tj|}|j}|s!tjt d||ds!tjt d||tj ||}| d}g}g}|D]} | | } | |vs| |kr%| t d| z| | r$tjt d| z| | |D]} |sIt|| |j} | jr| | j|| } ||| \} }}| s$tjt d| z|swt|||j} | j}|D]0}|r,|r| d||1d |}|j|g|R}|5||||j|d d |||||d d d d S#1swxYwYd 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 namerrrWs!skipping already folded patch %s s*qfold cannot fold already applied patch %sserror folding patch %ss* * *rr,smq.qfold)r3rrJr4N)rr?r%rrrrrr rprrrrHrrrrrrBrrrrrrrrh)rrIrzr<r&rrr!messagesrdr$rr patchsuccessrr3rs r4foldry| sf0   % %D A Hk!EFFGGG ??4  #4k!122333 T**G XXg  FGH  HHQKK <<1;; GGA;<> +?@@1D  q @@ ,QVVAYY 44Bz , +++ VVAYY&'ggdB&7&7#ud @+a 9::Q>?? ? @ &  5 5* $ $C $-NN8,,,s###**W%%q{1::<<2'222H     '""     w%%%                   s'ALLLsqgotos keep-changess&tolerate non-conflicting local changessoverwrite any local changess no-backups"do not save backup copies of filesshg qgoto [OPTION]... PATCHc tj|}t||}|j}||}|d}|d}||r.||||d||}n-||||d||}| |S)zSpush or pop patches until named patch is at top of stack Returns 0 on success. no_backuprr)rrrr) rr?r!r%rrrrr{rh)rrIrr<r&rrrrs r4gotor| s&   % %D b$ ' 'D A HHUOOExx %%H((?++K{{5 ee  ((8$$#   ff  ((8$$#   KKMMM Jr7sqguardllistslist all patches and guardsnonesdrop all guardss8hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]c  fd}|j d jDd}t|}|dri|s|dr!t jt dtt j D] }||dS|r|dddd vr: js!t jt d  jd j }|'|dddd vr| d}|!t jt d |s|drg |}|$t jt d |z || dS| j  |dS)aset 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. cj|pdg}j|vrd}n |drd}nd}d||fz}dj||zt |D]\}}|dr|d nD|d r|d n|d |t|dz krdddS)Ns unguardedrrrrs!qguard.patch qguard.%s qseries.%ss%s: rKqguard.positiverrHqguard.negativeqguard.unguardedrcr6r)r rrVrXrrormrk) rCr8rrrwr1rr&rs r4rzguard..status sT$6 8C=G # #EE ZZ__Q   EEE4u~E 288AHSM5999:::!&))  HAu%% ;&89999!!$'' ;&89999&9:::CKK!O## r7ch|] }|j Sr1rrOs r4rzguard..0 s)))!qv)))r7Nrnones.cannot mix -l/--list with options or argumentsrrcr0rrsno patch to work withsno patch named %s)r%rrrrrrrlrkrrUrr)rErhrir) rrIrr<rrrwrCrr&s ` @@r4r1r1 s@, A))qy)))G E ::D xx  488F## +CDD s18}}%%  A F1IIII #471Q3<5((y 8+a 56677 7 " " }a1U22  }k!455666 0txx0ll5!! ;+a 455=>> > C qx~~ahhuoo../////r7sqheadershg qheader [PATCH]ct|j}|r||}n@|js$|t ddS|d}t |||j}|d|jdzdS)zMprint the header of the topmost or specified patch Returns 0 on success.r}rcrWrN) r%rrrXrrrrr)rrIrr&rs r4rrrrM s A "y  HHQ.// 0 0 01!! QVVE]]AK 0 0BHHUZZ # #e +,,,,,r7ctj|\}}tj|}t jd|z}d}d}|D]G}||}|r.t|d} || |kr| }|}H|r"tj |||fSdS)Ns %s.([0-9]+)rcr) rrrlistdirr#rrr]groupr) r directoryrnamesnameremaxindexmaxnamerdrris r4 lastsavenamere s d++Y Jy ! !E Z- . .FHG  LLOO   OOE58#3#3 < Y00(;; .s&A&A&AQuqy&A&A&Ar7Trcr)$r%rrrXrrrrrr rrrvr)r,r-rrrrrQrdirnamemakedirsrryrerrrAr set_untracked set_trackedrrrh) rrIrrUr<r&absdestrwr8rdestdirrrLs r4ryry s A  "y  HHQ.// 0 0 0 F!!ffTllG w}}W T27+;+;E+B+BCCDD&&,,TGGA$ % % 5666 UA Z   Q 0 0FSXX&A&A&&A&A&ABBBALOMMOOOAM ;;u  D 8(a$77 $q'ANgoog&&G 7== ! ! GKu w'''  A%Uaj w WWYY % %z##E**0 % ((/// &&t,,,, %&&& UG$$$  % % % % % % % % % % % % % % %KKMMMMMs+BL88L<?L<sqrestoredeletesdelete save entrysupdatesupdate queue working directoryshg qrestore [-d] [-u] REVc ||}|j}||||d|d|dS)zsrestore the queue state saved by a revision (DEPRECATED) This command is deprecated, use :hg:`rebase` instead.rr)rrr)rr%rrrh)rrIrr<r&s r4rr:s` ++c  C AIIdC 2 2DHHX|td|D]} || dn"|td|dojojdj}d}|ds|drt tjD]z}|sm| tdd}|d kr|dn)|j|d z jn{|rj |r8| td|| dS# wxYwdS)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.cZj|jdS)Nr)rVrrU)rwr&s r4zselect..s!AIaL$566q9r7rc*g|]}| |Sr1r1rrwrVs r4rBzselect..&KKKQxx{{KqKKKr7sguards deactivated rrc*g|]}| |Sr1r1rs r4rBzselect..rr7sAnumber of unguarded, unapplied patches has changed from %d to %d s=number of guarded, applied patches has changed from %d to %d rrrcsNONEc"|dddSNrrcr1)rs r4rzselect..s!A$qrr(r7)keysguards in series file: s%2d rsno guards in series file sactive guards: sno active guards rFspopping guarded patches T)rosreapplying unguarded patches N)r%rr?r<rrrlrkrr:rhrrr rrYrr`rrvrXrUrr{)rrIrr<r8 old_unapplied old_guardedrguardednoguardsgsrAr1countreapplypoppedrwrVr&s @@r4selectr~s \ A   % %D XXZZF9999H 4/txx  4/ D)) KKKK%AI"7"7KKK  D  2 IIa/00 1 1 1xx (<(<  D))IKKKK%AI"7"7KKKG9~~]!3!333 3=))3y>>: ;7||s;//// +;''W6 7 )  /.  B A   !!!Q'''q Q   : '&F7Ofllnn%% ** +++  6 GGA122 3 3 3 & ' ' u5()))&&&& ' GGA344 5 5 5 5  / GGA)** + + + # #E"""" # HHQ,-- . . .hhz""GqyGQYr]5GG F xx 488J// s19~~&&  A8A;;  !899:::66EE$DE))))EE$ !a% 0 5666   & !=>>???tW%%% KKMMMMMAKKMMMM s :SS)rrsfinish all applied changesetsshg qfinish [-a] [REV]...c|ds#|s!tjtd|drd|z}|j}|js$|tddStj||}|d |vr<|d r"| td| 5| |||dddn #1swxYwYdS) 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. rsno revisions specified)s qbase::qtipr}rrNs6warning: uncommitted changes in the working directory )rrrrr%rrrrrrzrrrrh)rrIrr<r&rs r4rrso0 88I  0x0k!566777 )  0$x/ A 9 !+,,---q  tX . .D Dz~~4DJ$4$4$6$6 LMMNNN  t  1s+D==EEsqqueueslist all available queuesactivesprint name of active queuecreatescreate new queuerenamesrename active queuesdelete reference to queuepurges"delete queue, and remove patch dirs[OPTION] [QUEUE]c jdddfdfd}fd}fd}fdfd }fd }d } fd } tj|}|r*|d s|dr} |dr|d| fzdS|D]`} |d| fz| | kr*|js#|t dK|dadS| |s!tjt d 5||drU|vr$tjt d|z|r |||||nB|drx} || kr$tjt d|z|vr$tjt d|z|| } ||}tj |r$tjt d|z dd}D]o} | | krN|d|fztj | rtj| |V|d| fzp|j d|n|dr | |n|drN|vr | |||}tj |rt#j|n0|vr!tjt d||ddddS#1swxYwYdS)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. rspatches.queuesrctjj}|dr |dd}|S)Nr)rrrrm)rr&s r4 _getcurrentzqqueue.._getcurrentOs@gqv&& >>+ & & abb'C r7c d}|n#t$rYdSwxYwdS)NrTF)r r r)r _allqueuesrIs r4 _noqueueszqqueue.._noqueuesUsS *d++B HHJJJJ   44 us *. <<c} d}d|D}|||vr||n#t$rg}YnwxYwt |S)Nrc^g|]*}||+Sr1r)rrs r4rBz.qqueue.._getqueues..cs-EEEu{{}}EekkmmEEEr7)r r rHrrC)currentrqueuesr _defaultqueuerrIs r4 _getqueueszqqueue.._getqueues^s+-- %*d++BEEEEEF HHJJJf$$ g&&& % % %#_FFF %f~~sAA A-,A-cnjr!tjtd|dS)Ns@new queue created, but cannot make active as patches are applied)rrrr)rU_setactivenocheckr&s r4 _setactivezqqueue.._setactivelsL 9 +.  $r7cd}|dkr|||dS)Nrrr rXr )rUr _activequeuerIs r4rz!qqueue.._setactivenocheckvsA XXlD ) ) :   HHTNNN  r7cd}|d|fz|dS)Nrr_r)rUrrrIs r4 _addqueuezqqueue.._addqueue|s@ XXj$ ' ' D7"###  r7c~|dkrjdSjd|zS)Nrr)r r)rUrIs r4 _queuedirzqqueue.._queuedirs; :  8==,, ,8==t!344 4r7c|D] }|dvrdS dS)Ns:\/.FTr1)rUrs r4 _validnamezqqueue.._validnames+  AH}}uutr7c|vr!tjtd}||kr!tjtddd}D]"}||kr |d|fz#|jddS)Ns'cannot delete queue that does not exists$cannot delete currently active queuepatches.queues.newrr_)rrrr rXr ry)rUrrrrrrrIs r4_deletezqqueue.._deletes x  +a JKKLL L+-- 7??+a GHHII I XX+T 2 2 ) )E}} HHWx' ( ( ( (   -z:::::r7r~rr_Ns%ss (active) rs9invalid queue name, may not contain the characters ":\/."rsqueue "%s" already existsrs%can't rename "%s" to its current names'non-queue directory "%s" already existsrrrrs"use --create to create a new queue)r%rr?rrXquietrrrrrrrkr rryr shutilrmtree)rrIrUr<rrrrrrrrrolddirnewdirrqdirrrrrrrr&s ` @@@@@@@r4qqueuer(sD AM"J#L                 55555  ;;;;;;;;"   % %D  488G$$ (;(; +-- 88I    HHWz) * * * FZ\\  E HHUeX% & & &>**++++ :d   k K L L    11:<< 88I  . xk!$@"A"AD"HIIIy{{ ) -((( IdOOO Jt     XXi ' !kmmGwk?@@4Gxk!$@"A"AD"HIIIYw''FYt__Fw~~f%% k@AAFJ/66B! 1 1G##HHWw.///w~~f--4 FF333HHWx/0000 HHJJJ HOO1: > > >  d # # # # XXi  GDMMMM XXh   x 9T??Dw~~d## $ d###8##k!$I"J"JKKK Jt   c111111111111111111s2J7P66P:=P:c|jjr~|jddr tj}n tj}||jjdj}||||S)zEcallback used to set mq changeset as secret when no phase data existsr&r,r) r%rrrrrdraftrTrg)rIrootsmqphaserWs r4mqphasedefaultsrss w) 7  eY / / #mGGlGTW_Q',- g5::<<((( Lr7cGfdd|j|r(|_|jtdSdS)Nc~eZdZejdZfdZd dZ d fd ZfdZ fd Z xZ S) reposetup..mqrepocBt|j|j|jSr0)rrrrrYs r4r%zreposetup..mqrepo.mqs$+ty99 9r7ct|tj|dr$t |ddSdS)Nr%)super invalidateallrhasunfilteredcacher r)r2 __class__mqrepos r4rz'reposetup..mqrepo.invalidatealls^ &$   - - / / /+D$77 1))400000 1 1r7Fc|jjrl|jjrb|sb|j}d|jjDt fd|Drt j|dSdSdSdS)Ncg|] }|j Sr1r)rrNs r4rBz@reposetup..mqrepo.abortifwdirpatched..s;;;a16;;;r7c3 K|]}|vV dSr0r1)rr$r!s r4rz?reposetup..mqrepo.abortifwdirpatched..s'55qG|555555r7)r%rrrrrrr)r2errmsgrrr!s @r4abortifwdirpatchedz,reposetup..mqrepo.abortifwdirpatchedsw .47#7 . .-//11;;47?;;;5555W55555.+f---  . . . . . ...r7r7Nc |i}|td|t ||||||||S)Ns&cannot commit over an applied mq patch)rrrr) r2rrrrrr=extrarrs r4rz reposetup..mqrepo.commitsh}  # #;<.mqrepo.checkpush..s>>>af>>>r7ssource has mq patches applied)r%rrrrr7rrrrrrrrr checkpush)r2pushop outappliedrsrTrrs r4rz#reposetup..mqrepo.checkpushsw O47#7 O  O>>dgo>>> ; -  ,,E ( 4 4--5==!E&NN,,,,&OODDz''))FM99#k!,L*M*MNNN: &$   ) )& 1 1 1 1 1r7ct|}|j}|js|Sd|jD} |j|ddnZ#tj$rH|j tdt|ddz|cYSwxYw|jj fd|D}|s|S||dddf||dddf||j|ddddf|d}|D]N}|d |vr1|j td |d z=|d||d <O|S) z,augment tags from base class with patch tagsc*g|]}|j|jfSr1rS)rrs r4rBz7reposetup..mqrepo._findtags..4s!FFF5uz5:.FFFr7rrs)mq status file refers to unknown node %s c6g|]}|d|S)rr1)rmqtincludeds r4rBz7reposetup..mqrepo._findtags..Bs,@@@cxxA/?/?@c@@@r7rWrXsqparentrcs+tag %s overrides mq patch of the same name )r _findtagsr%rrrrrrrrrrhasnoderHr) r2resultr&mqtagstagsrrrrs @r4rz#reposetup..mqrepo._findtags,s64((2244FA9  FFAIFFFF !!+//r 1 >>>>$    CDDF2JqM**+  ~-H@@@@V@@@F  MM6":a='2 3 3 3 MM6!9Q<2 3 3 3 MM4>11&)A,??BJO P P P!9D . .8t##GLLIJJ(# &+1XDqNNMs8BACCr)r7NNNFFN) r>r?r@runfilteredpropertycacher%rrrrr __classcell__)rrs@r4rrs  * : : + * : 1 1 1 1 1 1  . . . .       ( 2 2 2 2 2 2(' ' ' ' ' ' ' ' ' ' r7r)rrM_phasedefaultsrHr)rrIrs @r4 reposetuprsaaaaaaaaaaF zz||4 ""?3333344r7ctj|drL|dds6|t d|d|||g|Ri|S)Nsabortifwdirpatched no_commitFs#cannot import over an applied patchr)r safehasattrrrr)origrrIrrs r4mqimportr[s 344 VZZU>>   4 5 5vzz'7J7J    4D *4 * * *6 * **r7c|dd}|s ||g|Ri|S|r>|d}tj|s!tjt dnHt jtj }|s!tjt dtj ||}t||dS)Nr%rs0only a local queue repository may be initializeds5there is no Mercurial repository here (.hg not found)T) rrr rrrr findreporgetcwdrr9)rrrrr%repopathrIs r4mqinitres D$  B )tB((((((( 7z(## +EFF   #HO$5$566 +JKK  =X & &D T4  r7c|dd}|s |||g|Ri|S|j}|}|s!tjt d||j|g|Ri|S)z>Add --mq option to operate on patch repository instead of mainr%Nr\)rr%rerrrr)rrrIrrr%r&rs r4 mqcommandr{s D$  B /tB.t...v... A  A 5k!233444 4a )$ ) ) )& ) ))r7c,|j}g}t|jt||}}|r9||t dd|z|r9||t dd|z|r:|t dd|zdS| t ddS)Ns %d appliedqseries.applieds %d unappliedqseries.unapplieds mq: %s s, smq: (empty queue) ) r%rkrrrHrrrXrrv)rrIr&rr us r4 summaryhookrs A A qy>>3q{{40011qAE !M**,>??!CDDDI !O,,.BCCaGHHH/ ?##ejjmm344444 ,--.....r7smq()ctj|ddtdfdjjDt jfd|DS)zChangesets managed by MQ.rsmq takes no argumentscNh|]!}|j"Sr1)rTr)rrrIs r4rzrevsetmq..s+;;;atAF|!!;;;r7cg|]}|v| Sr1r1)rrrs r4rBzrevsetmq..s???1!w,,Q,,,r7)rgetargsrr%rrbaseset)rIsubsetrrs` @r4revsetmqr&siq!Q": ; ;<<<;;;;47?;;;G  ??????? @ @@r7cdddtdfgtjtjdt t jdttjtjdt}|d fd}|tjtj d}tjD]%\}}||kr|t|d i&dS) Nr7r&soperate on patch repositorysimportsinitrcc|D]e\}}tj|d}|d}|jr/t j||t }|dfdSr)r`r parsealiasesrCr wrapcommandrrB)cmdtablecmdrfuncmqopts r4dotablezextsetup..dotables"..** # #JC&s++A.C8D{ *8S)DDE !HOOE " " " "  # #r7zhgext.mqr+)rrr*r tablerr summaryhooksrgrrrBsysmodulesr )rrr/ thismoduleextname extmoduler.s @r4extsetupr7s5$"@ A A B CE8>9h??? UK000  "8>7F C CE !HOOE##### GHNZ(J(35588  " " GGIz266 7 7 788r7sredsyellowsgreensblue bold underlines black boldsred bold)rrrrsqseries.guardedsqseries.missingrr0){__doc__rr#rr2mercurial.i18nrmercurial.noderrrrmercurial.pycompatr r r mercurialr r rrrrrrrrrrrrrrrrrrrrr rmercurial.utilsr!r"r#r seriesoptsr+command testedwith configtable configitemr+KeyErrorr.loadrOnormpathr rQrjr~r{rrrrrrr!CATEGORY_CHANGE_ORGANIZATIONrrrCATEGORY_IMPORT_EXPORTrr9CATEGORY_REPO_CREATIONr remoteoptsrPr0CATEGORY_COMMITTINGrrrrbrerkwalkopts commitoptsrRrr diffopts2CATEGORY_FILE_CONTENTSrGCATEGORY_CHANGE_MANAGEMENTryr|r1rrrrr{rryrrrrrrrrrrrrevsetpredicater& i18nfunctionsr7 colortabler1r7r4rSs/77t   . /Zqq)L'M'MN O  ) H % % #  !Y !+ . .                .JOH . . .JOGGIIx----- .      $ =--------      (((V###Lq"q"q"q"q"q"q"q"h,,,$     U[   K K K K K K K K \@     waa 2334    A6 7 7 AfII   A#$$5       GT11EFFGHA&''5 @  HdAA:;;<= JA())5    >  {D!!$E"F"FG wQQ455qqzzB xqq!<==>    A: ; ; AfII   vtQQ>??@ waa 899: AGHH/#&4 4 '&4 n   6   ND!!$>"?"?@AA/  ; ; ;  gtQQDEEF    A: ; ;      A: ; ;      A4 5 5 AgJJ  ,-.A,--/ 7:]2]2]2;:]2@  N< #A)**, ,,,  z4#A!B!BCA5     Ao5    .  A5  F F  F  A5    $777  waa CDDE xqq!KLLM vtQQ>??@ ~tQQ'M%N%NO wQQ=>>' K ~tQQ'M%N%NO wQQ=>>' K  A9::,!$   %$  F  waa CDDE vtQQ>??@    AL M M      AC D D      AA B B AgJJ      AA B B      A? @ @ AgJJ  9#HI$JK%LAFGG,W,,,Z[,,Z>   w((7+;;A'((/    (  waa CDDE waa :;;<  A8993   CC  CL      A7 8 8  xqq!?@@A lD!!$I"J"JK A#$$5<  waa >??@ waa 2334AABB5H0H0H0V A5  ---  -$$      A7 8 8  xqq!ABBC    A> ? ?  waa ABBC vtQQ3445 xqq!IJJK wQQ?@@!!G**M    A> ? ?  lD!!$I"J"JK14A9::5=@%%%A@%P  vtQQ1223 wQQ@AA11W::N    A7 8 8  xqq!MNNO lD!!$I"J"JK A*++5!$!!!%$!H A#$$5  444  4n  y$"6 7 78 y$"C D DEA"##5     waa 7889 wQQ566' C xqq!;<<= xqq//0   A>??5   ! !   ! H  waa 5667 y$"C D DE fdAAJKKL j$"> ? ?@  A*++5   nn  nb  Jaa @AABCA!""5  % %  % P  wqq!=>>? i"? @ @A y%#6!7!78 i"8 9 9: i"> ? ?@ hqq!FGGH A5   mmm  m`   g4g4g4T+++!!!, * * * / / / ,)+--AAA 888:!!.%#' sC..,DD