##// END OF EJS Templates
notify: add debug output. do not fail if no config file....
Vadim Gelfer -
r2329:90368f89 default
parent child Browse files
Show More
@@ -99,7 +99,9 b' class notifier(object):'
99
99
100 def __init__(self, ui, repo, hooktype):
100 def __init__(self, ui, repo, hooktype):
101 self.ui = ui
101 self.ui = ui
102 self.ui.readconfig(self.ui.config('notify', 'config'))
102 cfg = self.ui.config('notify', 'config')
103 if cfg:
104 self.ui.readconfig(cfg)
103 self.repo = repo
105 self.repo = repo
104 self.stripcount = int(self.ui.config('notify', 'strip', 0))
106 self.stripcount = int(self.ui.config('notify', 'strip', 0))
105 self.root = self.strip(self.repo.root)
107 self.root = self.strip(self.repo.root)
@@ -225,6 +227,8 b' class notifier(object):'
225 if not msgtext.endswith('\n'):
227 if not msgtext.endswith('\n'):
226 self.ui.write('\n')
228 self.ui.write('\n')
227 else:
229 else:
230 self.ui.status(_('notify: sending %d subscribers %d changes\n') %
231 (len(self.subs), count))
228 mail = self.ui.sendmail()
232 mail = self.ui.sendmail()
229 mail.sendmail(templater.email(msg['From']), self.subs, msgtext)
233 mail.sendmail(templater.email(msg['From']), self.subs, msgtext)
230
234
@@ -250,7 +254,12 b' def hook(ui, repo, hooktype, node=None, '
250 if used as changegroup hook, send one email for all changesets in
254 if used as changegroup hook, send one email for all changesets in
251 changegroup. else send one email per changeset.'''
255 changegroup. else send one email per changeset.'''
252 n = notifier(ui, repo, hooktype)
256 n = notifier(ui, repo, hooktype)
253 if not n.subs or n.skipsource(source):
257 if not n.subs:
258 ui.debug(_('notify: no subscribers to this repo\n'))
259 return
260 if n.skipsource(source):
261 ui.debug(_('notify: changes have source "%s" - skipping\n') %
262 source)
254 return
263 return
255 node = bin(node)
264 node = bin(node)
256 if hooktype == 'changegroup':
265 if hooktype == 'changegroup':
General Comments 0
You need to be logged in to leave comments. Login now