\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddljZddljZddl j j Z ddl j jZddljZddlZddlZddlZddlmZddlmZmZmZmZmZmZmZm Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)e'j*Z*iZ+e$j,e+Z,iZ-e$j.e-Z.e.ddd e/e.dd d e/e.dd d e/e.dd d e0e.dd d e/e.ddd e/e.ddd de.ddd e/e.ddd e/e.ddd e/e#j1rej2Z3n ej4Z3dZ5dZ6dZ7dZ8e/ddZ9dZ:dZ;dZ<e/dZ=dZ>dZ?d Z@d!ZAd"ZBe/d#ZCd$ZDd%ZEd&d'e/ed(fd)d*e/ed+fd,d-e/ed.fd&d ged/ed0fd1d ged2ed0fd&d e/ed3fd4d5e/ed6fd&d7d&ed8ed9fd&d:d&ed;ed<fd=dd&ed>ed0fd?d@e/edAfdBdCd&edDed<fd&dgedEed0fdFdGd&edHedIfd&dJd&edKedLfd&dMgedNedOfdPdgedQed0fgZFe,dRdSdTe/edUfd&dVe/edWfdXdYe/edZfd[d\e/ed]fd^d_d&ed`edafd&dbd\edceddfdedfgedgedhfd&die/edjfd&dkgedledhfd&de/edmfg eFejGedndoe,jHdpZIdS(qss command to send changesets as (a series of) patch emails The series is started off with a "[PATCH 0 of N]" introduction, which describes the series as a whole. Each patch email has a Subject line of "[PATCH M of N] ...", using the first line of the changeset description as the subject text. The message contains two or three body parts: - The changeset description. - [Optional] The result of running diffstat on the patch. - The patch itself, as generated by :hg:`export`. Each message refers to the first in the series using the In-Reply-To and References headers, so they will show up as a sequence in threaded mail and news readers, and in mail archives. To configure other defaults, add a section like this to your configuration file:: [email] from = My Name to = recipient1, recipient2, ... cc = cc1, cc2, ... bcc = bcc1, bcc2, ... reply-to = address1, address2, ... Use ``[patchbomb]`` as configuration section name if you need to override global ``[email]`` address settings. Then you can use the :hg:`email` command to mail a series of changesets as a patchbomb. You can also either configure the method option in the email section to be a sendmail compatible mailer or fill out the [smtp] section so that the patchbomb extension can automatically send patchbombs directly from the commandline. See the [email] and [smtp] sections in hgrc(5) for details. By default, :hg:`email` will prompt for a ``To`` or ``CC`` header if you do not supply one via configuration or the command line. You can override this to never prompt by configuring an empty value:: [email] cc = You can control the default inclusion of an introduction message with the ``patchbomb.intro`` configuration option. The configuration is always overwritten by command line flags like --intro and --desc:: [patchbomb] intro=auto # include introduction message if more than 1 patch (default) intro=never # never include an introduction message intro=always # always include an introduction message You can specify a template for flags to be added in subject prefixes. Flags specified by --flag option are exported as ``{flags}`` keyword:: [patchbomb] flagtemplate = "{separate(' ', ifeq(branch, 'default', '', branch|upper), flags)}" You can set patchbomb to always ask for confirmation by setting ``patchbomb.confirm`` to true. i(tabsolute_importN(t_(tcmdutiltcommandstencodingterrort formatterthgtmailtnodetpatchtpycompatt registrartscmutilt templatertutil(tdateutilt patchbombt bundletypetdefaulttbcctcctconfirmt flagtemplatetfromtintrotautot publicurlsreply-tottosships-with-hg-corecC@s<|j}|jjdd}|r8d|||fSdS(sKAdd a header pointing to a public URL where the changeset is available RRs/Available At %s # hg pull %s -r %sN(trepotuitconfigtNone(tseqtctxRR((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt_addpullheaders  cC@s!tjjdttjdttmpltoutR7tfm((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt _formatflagss   (c C@s^t||||}|r(d|}n|s6d|Std|}d||||fSdS(sbuild prefix to patch subjectR;s [PATCH%s]s%ds[PATCH %0*d of %d%s]N(RNtlen( RRRJR>tidxttotaltnumberedR@ttlen((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt _formatprefixs c C@sAg} d} d} xt|D]l} | jdrV| jdr| jd} qqn| jdst| jdrxPn| j| qW| r| rtn|jdr|jd rd j| d jpd } | d 7} n|jd rkx*|r&|djdr&|jdqW|r=|jdnx+|rg|dj rg|jdq@Wnt j |}|jdr| |d7} n|jdp|jd}| s|jdr| d j|7} n|rIt j }| r'|j tj|| ||jdntjd j|d|jd}tj| }| sg|j|D]*}|jds|jdrs|^qs}|r|d} q|d krtj|| dd|d|} qtj|| d} nd}|jdrd}n|dtj| |d<|j |ntj| d|jd}t||||jd|||}| djjd }|sd!j||jd"p|g}nd!j||g}tj||||jd|d#<| |d$s   cK@s|j}|jdr6t|jdj}n]|jtd|j||d|jdd}|jdd}|j||j |S(sobtain the body of the introduction message and return it This is also used for the body of email with an attached bundle. The body can be obtained either from the command line option or entered by the user through the editor. R0s7 Write the introductory message for the patch series. trepopathtactiont patchbombbodyslast-email.txttwb( RR3topentreadRGRteditRtvfstclose(Rt defaultbodytsenderR7RRXtmsgfile((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt_getdescriptionVs    c K@s.|j}tj|}|jdp6t|dd}t|d||}tj}|r|jtj ||||jdnt j dd} | j |d|jd d } | j d d d tj| tj| |j| tj||||jd|d<||dfgS(sGet the full email for sending a given bundle This function returns a list of "email" tuples (subject, content, None). The list is always one message long in that case. R`sSubject:sA bundle for your repositoryRUR\t applicationsx-mercurial-bundles%s.hgt bundlenameRsContent-DispositionR^tfilenameRaN(RRRtR3R.RRgRhRWRit emimebasetMIMEBaset set_payloadt add_headerRRpt emailencoderst encode_base64RrR ( RRRR7RRtRRXRytdatapartR((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt_getbundlemsgsls"  +   %c K@s8|j}tj|}t|||j|jddt|dt}|jdput|dd|dd}|sdS|d |}d} |jd rt j t |g} d | } nd} t || ||} tj|| ||jd } tj||||jd | d <| || fS(smake an introduction email, asking the user for content if needed email is returned as (subject, body, cumulative-diffstat)R@iRRR`s(optional) Subject: R/RRUR;RZs R\RaN(RRRtRTtlastR3ROR4R.R R RZtsumRRiRr( RRRtpatchesR7RRtRRRXRZRy((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt _makeintros&  !c K@sltj|}|j}tj|}tt|||}g} |jtdt |t ||t |rt |||||} | r| j | qnt | t |dk} d} t |t |kstxztt||D]c\} \}}|r&|| } nt||||||| dt || | } | j | qW| S(sreturn a list of emails from a list of patches This involves introduction message creation if necessary. This function returns a list of "email" tuples (subject, content, None). s+this patch series consists of %d patches. iN(R t byteskwargsRRRttlistRRGRROR:RR&R tAssertionErrort enumeratetzipR(RRRt patchnamesR7t bytesoptsRRtRtmsgsRyRRR?tiRRz((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt _getpatchmsgss* ( cC@s|j}|j|pd|p!d}tj|d}|jtdtj|g|D]}|dkra|^qa}|s|jj g}n|j d|pd|}|s|jtdn|S(s4Return the revisions present locally but not in dests default-pushRiscomparing with %s soutgoing(%s) and ::%ldRUsno changes found ( Rt expandpathRtparseurltstatusRRt hidepasswordt changelogttiprevR(RRRRturlR((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt _getoutgoings  %cC@s;tjtj}tjjd|}d|||fS(Nt HGHOSTNAMEs <%s.%d@%s>(Rt strtolocaltsockettgetfqdntenvironR3(R t timestampthostname((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyt_msgidsRURXs-send patches as inline message text (default)taRWssend patches as attachmentsRR[s"send patches as inline attachmentss/email addresses of blind carbon copy recipientstEMAILtcs"email addresses of copy recipientss#ask for confirmation before sendingtdRZsadd diffstat output to messagestdates&use the given date as the sending datetDATER0s,use the given file as the series descriptiontFILEtfsemail address of sendertnR\s!print messages that would be senttmtmboxs3write messages to mbox file instead of sending thems)email addresses replies should be sent totsR`s0subject of first message (intro or single patch)tTEXTs in-reply-tosmessage identifier to reply totMSGIDR@s flags to add in subject prefixestFLAGR|semail addresses of recipientstemailtgRsuse git extended diff formatRYsomit hg patch headertotoutgoings/send changes not found in the target repositorytbRs-send changes not in target as a binary bundletBtbookmarks-send changes only reachable by given bookmarktBOOKMARKRs"name of the bundle attachment filetNAMERRJsa revision to sendtREVtforces?run even when remote repository is unrelated (with -b/--bundle)tbasesGa base changeset to specify instead of a destination (with -b/--bundle)s-send an introduction email for a single patchshg email [OPTION]... [DEST]...t helpcategoryc6@s8 tjtjjd}jd}jd}jd}jd}jd} jdp|stjn|p|p|p|p| stjtdn|r|rtjtd n|r| rtjtd n|s'|rst |d krQtjtd n|rd|d } ndR} g}n|r|rtjtdn|}nF| r| |j krtjtd| nt j || }nt j||}|rt|| |}n|r=g|D]} d| ^q ds-|(d>7}(q-nt1j2t3j4|d })tj5|jd}dR}*dR}+j6td?d@tdAdBt |},xt|D]v\}-\}%}&}'y5||%dC|%dD<|+s|%dD}+n|+|%dE|.t?rq |%|.=tj@|.}.t*}0nt>|/t?r tj@|/}/|0s |%|.=nt*}0n|0r1 |/|%|.ss'public "%s" is missing %s and %i othersspublic url %s is missing %sR;cs@s|]}d|VqdS(s-r %sN((RR((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pys ss heads(%ld)suse 'hg push %s %s'thintc@st|d tdS(Nii(Rtint(tid(t start_time(s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pytgenmsgidsRRtFromc@sY|j}|jddj}j|}|rxjd|dj|ftj|jdSjd|pjd|}|sjd|pjd|}| r|rt |d|}qn|r-jd||ftj|gjdS|rUtj|gjdSgS( Nt-Rs%s: %ss, R\RRR( tlowertreplaceR3R&RARtaddrlistencodeRt hasconfigR.(theadertaskRt configkeytopttaddrstaddrt specified(RtR7t showaddrsR(s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pytgetaddrss(   "tToRsno recipient addresses providedtCcRRUtBccsReply-ToRRZs Final summary: tlabelspatchbomb.finalsummarys From: %s spatchbomb.froms%s s patchbomb.tos Subject: %s spatchbomb.subjectspatchbomb.diffstatss s1are you sure you want to send (yn)?$$ &Yes $$ &Nospatchbomb canceledt in_reply_tottsendingtunittemailsRQsX-Mercurial-Nodes Message-IdsX-Mercurial-Series-Ids In-Reply-Tot ReferencessMercurial-patchbomb/%ss User-Agentt localtimetDates, s displaying s ... t mangle_from_ssending titemN(MR RRRtR3tvalidateconfigRtAbortRROR t _bookmarksR t bookmarkrevstrevrangeRRRtdebugRtpeert RepoErrorR6tcapableRRR&RJRAtsetRt parsedatetmakedateR.tusernamet strkwargsRtcopyRfRRR5R4t configbooltboolRGt promptchoiceRbRnteutilt parseaddrRRpt addressencodet makeprogresst TypeErrorRtversiont formatdatetispy3Rtitemst isinstancetbyteststrurlRtpagert_bytesgeneratortflattentIOErrorterrnotEPIPEtconnecttupdateRBRItcomplete(6RRRR7RRRRRJRRRRt publicpeerRLRtmissingRPRRyR"t missingrevstrevhintRRRtstroptst bundledatat bundleoptsRRRRRtreplytoRRRRRwtparentt sender_addrtsendmailt firstpatchtprogressRthdrtvaltchanget generatortinsttfptalldestsR((RtR7RRRs5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pyRsZh      $  $   !   (     !-"              "(Jt__doc__t __future__Rtemail.encoderstencodersRtemail.generatorRKtemailgentemail.mime.basetmimeRRtemail.mime.multipartt multipartRgt email.utilstutilsR&R6RRtmercurial.i18nRt mercurialRRRRRRRR RkR R R R RRtmercurial.utilsRRBtcmdtabletcommandt configtablet configitemR R5R-tBytesGeneratorR3t Generatort testedwithR#R(R,R.R:RNRTRRRRRRRRRt emailoptst remoteoptstCATEGORY_IMPORT_EXPORTR(((s5/usr/lib64/python2.7/site-packages/hgext/patchbomb.pytIs   ^                  O      %       $