Beispiel #1
0
 def checkexit(self, status, output=''):
     if status:
         if output:
             self.ui.warn(_('%s error:\n') % self.command)
             self.ui.warn(output)
         msg = procutil.explainexit(status)
         raise error.Abort('%s %s' % (self.command, msg))
Beispiel #2
0
 def notify(self, bugs, committer):
     '''tell bugzilla to send mail.'''
     self.ui.status(_('telling bugzilla to send mail:\n'))
     (user, userid) = self.get_bugzilla_user(committer)
     for id in bugs.keys():
         self.ui.status(_('  bug %s\n') % id)
         cmdfmt = self.ui.config('bugzilla', 'notify', self.default_notify)
         bzdir = self.ui.config('bugzilla', 'bzdir')
         try:
             # Backwards-compatible with old notify string, which
             # took one string. This will throw with a new format
             # string.
             cmd = cmdfmt % id
         except TypeError:
             cmd = cmdfmt % {'bzdir': bzdir, 'id': id, 'user': user}
         self.ui.note(_('running notify command %s\n') % cmd)
         fp = procutil.popen('(%s) 2>&1' % cmd, 'rb')
         out = util.fromnativeeol(fp.read())
         ret = fp.close()
         if ret:
             self.ui.warn(out)
             raise error.Abort(
                 _('bugzilla notify command %s') %
                 procutil.explainexit(ret))
     self.ui.status(_('done\n'))