def do(self): log_msg = 'Tagging: "%s" as "%s"' % (self._revision, self._name) opts = {} if self._message: opts['F'] = utils.tmp_filename('tag-message') utils.write(opts['F'], self._message) if self._sign: log_msg += ', GPG-signed' opts['s'] = True status, output = self.model.git.tag(self._name, self._revision, with_status=True, with_stderr=True, **opts) else: opts['a'] = bool(self._message) status, output = self.model.git.tag(self._name, self._revision, with_status=True, with_stderr=True, **opts) if 'F' in opts: os.unlink(opts['F']) if output: log_msg += '\nOutput:\n%s' % output _notifier.broadcast(signals.log_cmd, status, log_msg) if status == 0: self.model.update_status()
def do(self): tmpfile = utils.tmp_filename('commit-message') status, output = self.model.commit_with_msg(self.msg, tmpfile, amend=self.amend) if status == 0: ResetMode.do(self) self.model.set_commitmsg(self.new_commitmsg) title = 'Commit: ' else: title = 'Commit failed: ' _notifier.broadcast(signals.log_cmd, status, title+output)