6hV BSrSSKJr SSKrSSKrSSKJr SSKJr SSK J r J r J r J r JrJrJr SSKJrJr 0r\R*"\5rSSKr\R."5 \R0"SS \S S 9 SSKJr \R8 SSS5 S rS \"S54S\"S54S\"S54S\"S54S\"S54/r\R@"S\RB5r"Sr#\"S5r$"SS5r%"SS5r&Sr'Sr(S r)S!r*S"r+S#r,S$r-S%r.S&r/S'r0S(r1S)r2\"S*S+S,S-\"S.5\"S/54S0S1S2\"S35\"S/54S4S5S2\"S65S4/\"S75\RfS89S>S9j5r4\"S:S;S<9S>S=j5r5g!,(df  GN=f!\a SrGNf=f)?a/generate release notes from commit messages (EXPERIMENTAL) It is common to maintain files detailing changes in a project between releases. Maintaining these files can be difficult and time consuming. The :hg:`releasenotes` command provided by this extension makes the process simpler by automating it. ) annotationsN)_)hex)cmdutilconfigerror logcmdutilminirst registrarutil)procutil stringutilignorez.*python-Levenshtein.*zfuzzywuzzy.fuzz)actionmessagecategorymodulesships-with-hg-coresfeatures New FeaturessbcsBackwards Compatibility Changesfixs Bug FixessperfsPerformance Improvementssapis API Changess#^\.\. ([a-zA-Z0-9_]+)::\s*([^$]+)?$s\bissue ?[0-9]{4,6}(?![0-9])\bs Other ChangescJ\rSrSrSrSrSrSrSrSr Sr S r S r S r g ) parsedreleasenotesNc0UlgNsectionsselfs 4/usr/lib/python3/dist-packages/hgext/releasenotes.py__init__parsedreleasenotes.__init__Os  cXR;$rrrsections r __contains__parsedreleasenotes.__contains__Rs--''r!c>[[UR55$r)itersortedrrs r__iter__parsedreleasenotes.__iter__UsF4==)**r!cURRU//45 URUSRX#45 g)z Add a titled release note entry.rNr setdefaultappend)rr$title paragraphss r addtitleditem parsedreleasenotes.addtitleditemXs9   2r(3 gq!((%)<=r!cURRU//45 URUSRU5 g)zKAdds a non-titled release note entry. Will be rendered as a bullet point. Nr-)rr$r1s raddnontitleditem#parsedreleasenotes.addnontitleditem]s8   2r(3 gq!((4r!cDURRU//45S$)zlReturns titled entries in a section. Returns a list of (title, paragraphs) tuples describing sub-sections. rrgetr#s rtitledforsection#parsedreleasenotes.titledforsectiones$ }}  2r(3A66r!cDURRU//45S$)z5Returns non-titled, bulleted paragraphs in a section.r5r9r#s rnontitledforsection&parsedreleasenotes.nontitledforsectionls"}}  2r(3A66r!cL^[U4SjURU555$)Nc32># UH oST:Hv M g7f)rN).0tr0s r 8parsedreleasenotes.hastitledinsection..qsI*HQQ45=*Hs)anyr;)rr$r0s `rhastitledinsection%parsedreleasenotes.hastitledinsectionpsI$*?*?*HIIIr!cF[(dUR[S55 UGHun[UR U55[ UR U55-nUR U5HupVURX55(a UR[S5XS4-5 M;[XV4/5SnUS:Xa%[U5nU(a[XU5(aMv[XU5(aMURX5U5 M UR U5HwnX`R U5;aM[ U/5SnUS:Xa%[U5nU(a[XU5(aMS[XU5(aMfURX65 My GMx g)zkMerge another instance into this one. This is used to combine multiple sources of release notes together. sKmodule 'fuzzywuzzy' not found, merging of similar releasenotes is disabled s*%s already exists in %s section; ignoring rrN)fuzzwarnr converttitledr;convertnontitledr>rHwrite getissuenum findissuesimilarr2r6) ruiotherr$ existingnotesr0r1 incoming_strissues rmergeparsedreleasenotes.mergess t GG2 G)%%g. !9!9'!BCDM&+%;%;G%D!**7::HHHI *+,u.A-BCAF f$' 5E$R>>$2l;;""7:>)&E,$77@ !9!9'!BB/ =a@ f$' 5E$R>>$2l;;%%g:A5r!rN)__name__ __module__ __qualname____firstlineno__rr%r*r2r6r;r>rHrX__static_attributes__rBr!rrrNs0(+> 577J5;r!rc0\rSrSrSSjrSrSrSrSrg) releasenotessectionsNcU(a\[R"[5n[U5nU(aUR U5 [ UR 55Ulg[ [5Ulgr)r sortdictDEFAULT_SECTIONSgetcustomadmonitionsupdatelistitems _sections)rrSreporcustom_sectionss rrreleasenotessections.__init__sM }}%56H248O0!(.."23DN!"23DNr!c,[UR5$r)r(rirs rr*releasenotessections.__iter__sDNN##r!cJURVs/sHoSPM sn$s snf)Nrri)rrDs rnamesreleasenotessections.namess "nn-n!n---s c@URHup#X1:XdM Us $ grrp)rr0namevalues rsectionfromtitle%releasenotessections.sectionfromtitles!>>KD~ *r!rpr) rZr[r\r]rr*rqrvr^rBr!rr`r`s4$.r!r`c/nUHAup#/nUHnURU5 M URSRU55 MC U$)z& Convert titled paragraphs to strings  extendr/join)titledparagraphs string_listr0r1linesparas rrMrMsPK-D LL 499U+, . r!c/nUH?n/nUHnURU5 M URSRU55 MA U$)z' Convert non-titled bullets to strings ryrz)nontitledparagraphsr~r1rrs rrNrNsMK) D LL 499U+, * r!c[R"[U[R5nU(aUR 5nU$)z< Returns issue number from the incoming string if it exists )researchRE_ISSUE IGNORECASEgroup)rVrWs rrPrPs- IIh bmm # UH nTU;v M g7frrB)rCsrWs rrEfindissue..s (x!5A:xss'"%s" already exists in notes; ignoring TF)rGrOr)rSexistingrWs `rrQrQs3 (x ((( >?%GHr!c[UR55S:a1[X!5nU(dUR[ S5U-5 ggg)z7 Returns true if similar note found in existing notes. s,"%s" already exists in notes file; ignoring TF)lensplitsimilaritycheckrOr)rSrrVrXs rrRrRsO <    2% 7 HHBC r!cv[(dgSnUH$n[R"X5nUS:dM!Sn U$ U$)zC Returns false when note fragment can be merged to existing notes. TKF)rKtoken_set_ratio)rVrUrXbulletscores rrrsF 4 E$$\: 2:E  L  Lr!c^^^^TSm[R"5mSUUUU4SjjmST;aT"S5 TRS5$)N.c>UT;a'TUR5nTRXXT5 g[R"[ S5TR U5-5e)Ns#.hgreleasenotes file '%s' not found)dataparserAbortrpathto)frremaprctxpreadrjs rr"getcustomadmonitions..readsP 8q6;;=D GGAXd 3++:;dkk!nL r!s.hgreleasenotesssections)NN)rrh)rjrrrs`@@@rreresC t*C AS   77; r!cj^ UGH&nXn[R"[UR55m T (dM:T R S5U;aMQUR [ S5T R S5UR5SS4-5 U 4SjnUVs/sHov"U5S:dMUPM nn[U5S:Xa"UR [ S5US-5 MU(dMS R[U55n UR [ S 5U -5 GM) gs snf) aD Checks the commit messages for admonitions and their validity. .. abcd:: First paragraph under this admonition For this commit message, using `hg releasenotes -r . --check` returns: Invalid admonition 'abcd' present in changeset 3ea92981e103 As admonition 'abcd' is neither present in default nor custom admonitions r5s0Invalid admonition '%s' present in changeset %s N cn>[R"STRS5U5R5$)Nr5)difflibSequenceMatcherrratio)x admonitions r"checkadmonitions..@s. 7 7***1-q!%'!r!g333333?s(did you mean %s?) rs, s(did you mean one of %s?) ) rr RE_DIRECTIVE descriptionrrOrrrr|r)) rSrj directivesrevsrevrsimrrRssrs @rcheckadmonitionsr(siYY|S__->? :"j0JK!''*CGGIcrN;<'1AjCFSL1jAw<1$HHQ67'!*DEWF7O4BHHQ=>CD)Bs D01D0cNUHnURSUSUS4-5 M! g)Ns%s: %s rr5)rO)rSrr$s r_getadmonitionlistrLs*  GAJ778r!c v[5nUGHnXn[R"UR5US9upg[ U5GHjupU SS:waMU Sn U S(aU SSR 5OSn US-[ U5:Xa#[R"[S5XZ4-5e/n [US-[ U55Hmn XmnUSS :XaMUSS:Xa OTUSS :wa(URR[S 5XZ4-5 US S:aU RUS5 Mm O U (d>URR[S 5[UR55-5 U (aUR!XU 5 GMYUR#X5 GMm GM U$)N) admonitionstypes admonitionsadmonitiontitlelinesrr5s6changeset %s: release notes directive %s lacks contentmargin paragraphs=changeset %s: unexpected block in release notes directive %s indents.error parsing releasenotes for revision: '%s' )rr rr enumeratestriprrrrrangerSrLr/rnoder2r6)rjrrnotesrrblocksprunediblock directiver0r1jpblocks rparsenotesfromrevisionsrQs  Ei  OO : "&)HAW~.01I27/E(OA&,,.tE1uF #kk)& 'J1q5#f+.'?i/'?m3'?l2GGLL4* +)$q(%%fX&67-/2 HI#((*o&##IjA&&y=i*z Lr!c|^ [5n[R"U5Sm S U 4SjjnSn[T 5HupVUSS:waMUSSnUSS:XaiUR U5nU(d"[ R "[S 5U-5eUnU"U5n U (aU Hn URXJ5 M MMUSS :XaKU[:Xa$U"U5n U Hn URXJ5 M MU"US 5n URXGU 5 M[ R "[S 5U-5e U$)z6Parse text content containing generated release notes.rc>/n[US-[T55GHPnTUnUSS:XaMUSS:Xa U$USS:XaUSS:wa[R"[ S55eU(a8US Vs/sHoUSSR 5PM nnUR U5 MUS Vs/sHoUSSR 5PM sn/nTUS-SH-nUSS ;a O#USS :XdMUR US 5 M/ UR U5 GMUSS :wa%[R"[ S 5US-5eU(dGM<UR US 5 GMS U$s snfs snf) Nr5rrsectionbulletrrs#indented bullet lists not supportedr)rrrs*unexpected block type in release notes: %s)rrrrrrr/)offsetr0 notefragmentrrlrrs rgatherparagraphsbullets6parsereleasenotesfile..gatherparagraphsbulletss vz3v;/A1IEW~*w:-43w9,#q(++a(N&OPP49(ODOqqrU[[]OED ''.5:8_E_ekkm_EFE!'A >-DD! >\9!LLx9 "1 !''.w</kkCDGn%u##E(O4=0@+EFs ;E33E8Nrrrs underline=s!unknown release notes section: %s-Tsunsupported section type for %s)F) rr rrrvrrrr6BULLET_SECTIONr2) rtextrrcurrentsectionrrr0rt bullet_pointsrr1rs @rparsereleasenotesfilersD  E ]]4  #F#JNf% >Z ' h"  $ &,,U3Dkk:;eC"N3A6M)D**>@*< D (& 7 : )D**>@*5Q= ##N:F++a BCeKL L=&@ Lr!c */nUGHXup4X1;aM URU5 URS[U5-5 URS5 URU5HupVURU5 URS[U5-5 URS5 [U5H^upxU(aURS5 UR [ R "SRU5SS9R55 M` URS5 M URU5n URU5(aNU (aGUR[5 URS[[5-5 URS5 U HnUR [ R "SRUS5SSS S 9R55 US S HWnURS5 UR [ R "SRU5SS S S 9R55 MY URS5 M GM[ U(aUS (aURS5 SRU5$)zSerialize release notes from parsed fragments and notes. This function essentially takes the output of ``parsenotesfromrevisions()`` and ``parserelnotesfile()`` and produces output combining the 2. rr!rryr)widthrs* s )r initindent hangindentr5N ) r/rr;rr{rwrapr| splitlinesr>r) rrr sectionname sectiontitler0r1rr nontitleds rserializenotesrs E%-!  #  \" TC --. S"'!7!7 !D E LL  LLE * + LL $Z0LL% OODIIdO2>IIK1 LL "E(--k:  ! !+ . .9 LL ( LLN 33 4 LL #J LLIIjm,$$  *,  #12 S! OO $ #(#(  !jl ' LL +$I&.v r S ::e r! releasenotesrsrevr!s&revisions to process for release notessREVcscheckFs+checks for validity of admonitions (if any)lslists/list the available admonitions with their titles"hg releasenotes [-r REV] [-c] FILE) helpcategoryc [X5n[R"USSS/5 URS5(a [ X5$URS5n[ R "X=(d S/5nURS5(a[XUR5U5$[XR5U5nUc+URS5 UR[XG55$[U[R"U55nUR%X5 [R&"U[XH55 g![ a [#5nNHf=f)a parse release notes from commit messages into an output file Given an output file and set of revisions, this command will parse commit messages for release notes then add them to the output file. Release notes are defined in commit messages as ReStructuredText directives. These have the form:: .. directive:: title content Each ``directive`` maps to an output section in a generated release notes file, which itself is ReStructuredText. For example, the ``.. feature::`` directive would map to a ``New Features`` section. Release note directives can be either short-form or long-form. In short- form, ``title`` is omitted and the release note is rendered as a bullet list. In long form, a sub-section with the title ``title`` is added to the section. The ``FILE`` argument controls the output file to write gathered release notes to. The format of the file is:: Section 1 ========= ... Section 2 ========= ... Only sections with defined release notes are emitted. If a section only has short-form notes, it will consist of bullet list:: Section ======= * Release note 1 * Release note 2 If a section has long-form notes, sub-sections will be emitted:: Section ======= Note 1 Title ------------ Description of the first long-form note. Note 2 Title ------------ Description of the second long-form note. If the ``FILE`` argument points to an existing file, that file will be parsed for release notes having the format that would be generated by this command. The notes from the processed commit messages will be *merged* into this parsed set. During release notes merging: * Duplicate items are automatically ignored * Items that are different are automatically ignored if the similarity is greater than a threshold. This means that the release notes file can be updated independently from this command and changes should not be lost when running this command on that file. A particular use case for this is to tweak the wording of a release note after it has been added to the release notes file. The -c/--check option checks the commit message for invalid admonitions. The -l/--list option, presents the user with a list of existing available admonitions along with their title. This also includes the custom admonitions (if any). rgrchecks not public()Nr)r`rcheck_incompatible_argumentsr:rr revrangerrqrpagerrOrrr readfileFileNotFoundErrorrrX writefile) rSrjfile_optsrrrincomingrs r releasenotesr,s^$B-H ((vw7GH xx!"// ((5/C   t&<_%= >D xx(..*:DAA&t^^-=tDH } !xxx:;;%%h e0DE KKNN5.9: %"$%s2 EEEsdebugparsereleasenotesT)norepoc US:Xa[RR5nO[R"U5n[ X5n[ XC5nUHnUR[S5U-5 URU5HWupxUR[S5U-5 UH/n UR[S5SRU 5-5 M1 MY URU5HRnUR[S55 UH/n UR[S5SRU 5-5 M1 MT M g)z6parse release notes and print resulting data structurers section: %s s subsection: %s s paragraph: %s rys bullet point: N) r stdinrr rr`rrOrr;r|r>) rSpathrjrrrr$r0r1rs rdebugparsereleasenotesrs  t|~~""$}}T"#B-H !( 1E #$w./!&!7!7!@ E HHQ,-5 6"12TYYt_DE#"A  33Grs/ #     H %  ", $   '  #$# ?#$ A0 12 Q|_ a+,- Q~  zzA2<<P -#$Z;Z;z2  $" $!EH9 @FL^FR     7 8 fI      < = fI      @ A   .+,3358l;98l;^ "40F1FY # " Ds0 F!&FF F FFFF