-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/hgext/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/hgext/hgcia.pyc

ó
Ì\,Tc@sdZddlmZddlmZmZddlmZmZm	Z	m
Z
mZddlZ
ddlZddlZddlmZdZdZe
jed	ƒr¶ejeƒnd
ZdZdefd
„ƒYZdefd„ƒYZddd„ZdS(s:hooks for integrating with the CIA.vc notification service

This is meant to be run as a changegroup or incoming hook. To
configure it, set the following options in your hgrc::

  [cia]
  # your registered CIA user name
  user = foo
  # the name of the project in CIA
  project = foo
  # the module (subproject) (optional)
  #module = foo
  # Append a diffstat to the log message (optional)
  #diffstat = False
  # Template to use for log messages (optional)
  #template = {desc}\n{baseurl}{webroot}/rev/{node}-- {diffstat}
  # Style to use (optional)
  #style = foo
  # The URL of the CIA notification service (optional)
  # You can use mailto: URLs to send by email, e.g.
  # mailto:cia@cia.vc
  # Make sure to set email.from if you do this.
  #url = http://cia.vc/
  # print message instead of sending it (optional)
  #test = False
  # number of slashes to strip for url paths
  #strip = 0

  [hooks]
  # one of these:
  changegroup.cia = python:hgcia.hook
  #incoming.cia = python:hgcia.hook

  [web]
  # If you want hyperlinks (optional)
  baseurl = http://server/path/to/repo
iÿÿÿÿ(t_(tbintshort(tcmdutiltpatcht	templatertutiltmailN(tsaxutilstinternalitsetdefaulttimeouts0.1s$http://hg.kublai.com/mercurial/hgciatciamsgcBsSeZdZd„Zd„Zd„Zddd„Zd„Zd„Z	d„Z
RS(	s A CIA message cCsF||_||_|jj|_|jrB|j|jj7_ndS(N(tciatctxturltroot(tselfRR
((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyt__init__As
			cCs?|rdtj|ƒ}nd|tj|ƒtj|ƒfS(Ns uri=%ss<file%s action=%s>%s</file>(Rt	quoteattrtescape(Rtpathturitaction((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pytfileelemHscCsL|jjƒ}|jjj|jjƒjƒ|ƒ}|jpBd}|rh|ddkrh|d }ng}xM|dD]A}d|t|ƒ|f}|j|j	||o°|dƒƒqyWxM|dD]A}d|t|ƒ|f}|j|j	||o|d	ƒƒqÉWx.|d
D]"}|j|j	|ddƒƒqWdj
|ƒS(
Ntiÿÿÿÿt/is
%s/diff/%s/%stmodifyis
%s/file/%s/%stadditremoves
(R
tnodeRtrepotstatustp1RRtappendRtjoin(RtntfRtelemsRR((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyt	fileelemsNs'
&& cCsyddtj|ƒg}|r<|jdtj|ƒƒn|r_|jdtj|ƒƒn|jdƒdj|ƒS(Ns<source>s<project>%s</project>s<module>%s</module>s<branch>%s</branch>s	</source>s
(RRR!R"(Rtprojecttmoduletbranchtmsg((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyt
sourceelemas
cCscdtfd„ƒY}|jjƒ}|ƒ}tj|jj|gd|ƒtj|j	ƒpbdS(NtpatchbufcBs#eZd„Zd„Zd„ZRS(cSsg|_d|_dS(NR(tlinestname(R((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyRms	cSs|j|jtƒ7_dS(N(R-t
splitlinestTrue(Rtdata((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pytwriteqscSsdS(N((R((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pytclosess(t__name__t
__module__RR2R3(((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyR,ls		tfpR(
tobjectR
RRtexportRRRtdiffstatR-(RR,R#tpbuf((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyR9ks

	cCs–|jjr|jƒpd}|jjjƒ|jjj|jd|jjƒd|jjjddƒd|j	d|d|jj
ƒ|jjjƒS(NRtchangestbaseurltwebRR9twebroot(RR9tuit
pushbufferRtshowR
t	changesettconfigRRt	popbuffer(RR9((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pytlogmsg{s$
c
Cs?t|jjƒƒ}|j|jjd|jjd|jjƒƒ}|jjƒ}|d}t	j
|jjƒƒ}d|jjƒ|f}t	j
|j
ƒƒ}|j}|rÐ|ddkrÐ|d }n|rïdt	j
|ƒ|fpòd}d	tt	j
tƒt	j
|jjƒ||||||jƒ|f
}	|	S(
NR(R)is%d:%siÿÿÿÿRs<url>%s/rev/%s</url>RsP
<message>
  <generator>
    <name>Mercurial (hgcia)</name>
    <version>%s</version>
    <url>%s</url>
    <user>%s</user>
  </generator>
  %s
  <body>
    <commit>
      <author>%s</author>
      <version>%s</version>
      <log>%s</log>
      %s
      <files>%s</files>
    </commit>
  </body>
  <timestamp>%d</timestamp>
</message>
(RR
RR+RR'R(R)tdateRRtusertrevRERt
HGCIA_VERSIONt	HGCIA_URLR&(
RR#tsrctdtt	timestamptauthorRHtlogRR*((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pytxml„s"
	
%!N(R4R5t__doc__RRR&tNoneR+R9RERP(((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyR?s			
			thgciacBs>eZdZdZdZd„Zd„Zd„Zd„ZRS(s CIA notification class s{desc}s{desc}
-- 
{diffstat}cCs¥||_||_|jjdddƒ|_|jjddƒ|_|jjddƒ|_|jjddƒ|_|jjddƒ|_|jjdd	ƒ|_	|jjdd
ƒ|_
|jjddƒ|_t|jjdd
dƒƒ|_
|j|jjƒ|_|jjddƒ}|jjddƒ}|s\|jrP|jpV|j}ntj|dtƒ}tj|j|jtd||tƒ}||_dS(NRRs
http://cia.vcRGR'R(R9temailtfromttestR=R<tstripiÿÿÿÿtstylettemplatetquoted(R?RRCtciaurlRGR'R(t
configboolR9t	emailfromtdryrunRtintt
stripcountRWRt
dstemplatetdeftemplateRtparsestringtFalseRtchangeset_templaterRR(RR?RRXRYtt((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyR·s(		!cCsvtj|ƒ}|j}|dkr(dSxG|dkrq|jdƒ}|dkrVPn||d}|d8}q+W|S(s?strip leading slashes from local path, turn into web-safe path.iRRiÿÿÿÿi(RtpconvertR`tfind(RRtcounttc((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyRWÐs	cCsetj|jƒ}|jj|ƒ}|tk	ra|dkratjtdƒ|j|fƒ‚ndS(Nsqueued.s%s returned an error: %s(	t	xmlrpclibtServerR[thubtdeliverR0RtAbortR(RR*tsrvtres((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pytsendrpcßs
cCs±tjjƒ}|j|ƒ}tjddƒ|d<||d<|j|d<d|d<d|d	<|jƒ}|jjt	d
ƒ|ƒt
j|jtj|jƒ|g|ƒdS(Ntformats%a, %d %b %Y %H:%M:%S %1%2tDatetTotFromt
DeliverXMLtSubjectstext/xmlsContent-typeshgcia: sending update to %s
(RTtParsertparsestrRtdatestrR]t	as_stringR?RRRtsendmail(RtaddressR1tpR*tmsgtext((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyt	sendemailæs



(	R4R5RQRbRaRRWRrR(((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyRS±s			c
sö‡fd†}t|ƒ}tˆ|ƒ}|jsDˆjdƒdS|js^ˆjdƒdS|dkrÖ|jj|ƒ}	t|jƒ}
xdt|	|
ƒD]4}|jj	|ƒ}|j
|ƒ}|||ƒq›Wn|j
|ƒ}|||ƒdS(s send CIA notification csŒt||ƒjƒ}|jr.ˆj|ƒnZ|jjdƒr{|jsatjt	dƒƒ‚n|j
|jd|ƒn
|j|ƒdS(Nsmailto:s0email.from must be defined when sending by emaili(RRPR^R2R[t
startswithR]RRoRRRr(RR
R*(R?(s//usr/lib/python2.7/dist-packages/hgext/hgcia.pytsendmsg÷s		scia: no user specifiedNscia: no project specifiedtchangegroup(RRSRGtdebugR't	changelogRHtlentxrangeRt	changectx(
R?RthooktypeRRtkwargsRƒR#RtstarttendRHR
((R?s//usr/lib/python2.7/dist-packages/hgext/hgcia.pythookõs$	
	
(RQtmercurial.i18nRtmercurial.nodeRRt	mercurialRRRRRtemail.ParserRTtsocketRktxml.saxRt
testedwithtsocket_timeouttsafehasattrR
RIRJR7RRSRRRŽ(((s//usr/lib/python2.7/dist-packages/hgext/hgcia.pyt<module>*s(rD

Copyright © 2017 || Recoded By Mr.Bumblebee