hgext/notify.py
changeset 45942 89a2afe31e82
parent 44627 947e6df4ff77
child 48717 ae27a0684e75
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
   188 
   188 
   189 configtable = {}
   189 configtable = {}
   190 configitem = registrar.configitem(configtable)
   190 configitem = registrar.configitem(configtable)
   191 
   191 
   192 configitem(
   192 configitem(
   193     b'notify', b'changegroup', default=None,
   193     b'notify',
   194 )
   194     b'changegroup',
   195 configitem(
   195     default=None,
   196     b'notify', b'config', default=None,
   196 )
   197 )
   197 configitem(
   198 configitem(
   198     b'notify',
   199     b'notify', b'diffstat', default=True,
   199     b'config',
   200 )
   200     default=None,
   201 configitem(
   201 )
   202     b'notify', b'domain', default=None,
   202 configitem(
   203 )
   203     b'notify',
   204 configitem(
   204     b'diffstat',
   205     b'notify', b'messageidseed', default=None,
   205     default=True,
   206 )
   206 )
   207 configitem(
   207 configitem(
   208     b'notify', b'fromauthor', default=None,
   208     b'notify',
   209 )
   209     b'domain',
   210 configitem(
   210     default=None,
   211     b'notify', b'incoming', default=None,
   211 )
   212 )
   212 configitem(
   213 configitem(
   213     b'notify',
   214     b'notify', b'maxdiff', default=300,
   214     b'messageidseed',
   215 )
   215     default=None,
   216 configitem(
   216 )
   217     b'notify', b'maxdiffstat', default=-1,
   217 configitem(
   218 )
   218     b'notify',
   219 configitem(
   219     b'fromauthor',
   220     b'notify', b'maxsubject', default=67,
   220     default=None,
   221 )
   221 )
   222 configitem(
   222 configitem(
   223     b'notify', b'mbox', default=None,
   223     b'notify',
   224 )
   224     b'incoming',
   225 configitem(
   225     default=None,
   226     b'notify', b'merge', default=True,
   226 )
   227 )
   227 configitem(
   228 configitem(
   228     b'notify',
   229     b'notify', b'outgoing', default=None,
   229     b'maxdiff',
   230 )
   230     default=300,
   231 configitem(
   231 )
   232     b'notify', b'reply-to-predecessor', default=False,
   232 configitem(
   233 )
   233     b'notify',
   234 configitem(
   234     b'maxdiffstat',
   235     b'notify', b'sources', default=b'serve',
   235     default=-1,
   236 )
   236 )
   237 configitem(
   237 configitem(
   238     b'notify', b'showfunc', default=None,
   238     b'notify',
   239 )
   239     b'maxsubject',
   240 configitem(
   240     default=67,
   241     b'notify', b'strip', default=0,
   241 )
   242 )
   242 configitem(
   243 configitem(
   243     b'notify',
   244     b'notify', b'style', default=None,
   244     b'mbox',
   245 )
   245     default=None,
   246 configitem(
   246 )
   247     b'notify', b'template', default=None,
   247 configitem(
   248 )
   248     b'notify',
   249 configitem(
   249     b'merge',
   250     b'notify', b'test', default=True,
   250     default=True,
       
   251 )
       
   252 configitem(
       
   253     b'notify',
       
   254     b'outgoing',
       
   255     default=None,
       
   256 )
       
   257 configitem(
       
   258     b'notify',
       
   259     b'reply-to-predecessor',
       
   260     default=False,
       
   261 )
       
   262 configitem(
       
   263     b'notify',
       
   264     b'sources',
       
   265     default=b'serve',
       
   266 )
       
   267 configitem(
       
   268     b'notify',
       
   269     b'showfunc',
       
   270     default=None,
       
   271 )
       
   272 configitem(
       
   273     b'notify',
       
   274     b'strip',
       
   275     default=0,
       
   276 )
       
   277 configitem(
       
   278     b'notify',
       
   279     b'style',
       
   280     default=None,
       
   281 )
       
   282 configitem(
       
   283     b'notify',
       
   284     b'template',
       
   285     default=None,
       
   286 )
       
   287 configitem(
       
   288     b'notify',
       
   289     b'test',
       
   290     default=True,
   251 )
   291 )
   252 
   292 
   253 # template for single changeset can include email headers.
   293 # template for single changeset can include email headers.
   254 single_template = b'''
   294 single_template = b'''
   255 Subject: changeset in {webroot}: {desc|firstline|strip}
   295 Subject: changeset in {webroot}: {desc|firstline|strip}
   537 
   577 
   538         self.ui.write(b"\n".join(difflines))
   578         self.ui.write(b"\n".join(difflines))
   539 
   579 
   540 
   580 
   541 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
   581 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
   542     '''send email notifications to interested subscribers.
   582     """send email notifications to interested subscribers.
   543 
   583 
   544     if used as changegroup hook, send one email for all changesets in
   584     if used as changegroup hook, send one email for all changesets in
   545     changegroup. else send one email per changeset.'''
   585     changegroup. else send one email per changeset."""
   546 
   586 
   547     n = notifier(ui, repo, hooktype)
   587     n = notifier(ui, repo, hooktype)
   548     ctx = repo.unfiltered()[node]
   588     ctx = repo.unfiltered()[node]
   549 
   589 
   550     if not n.subs:
   590     if not n.subs: