diff options
author | W. Trevor King <wking@drexel.edu> | 2009-07-19 15:39:26 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-07-19 15:39:26 -0400 |
commit | 396b2ab5e79be869f66fad3833f107e54f6fa3ef (patch) | |
tree | d680735aa6b17b09606d6820be7853cc04508092 /interfaces/email/interactive | |
parent | 989af0349bf90914f968456612ed801ff5a58500 (diff) | |
download | bugseverywhere-396b2ab5e79be869f66fad3833f107e54f6fa3ef.tar.gz |
Adjusted final commit-handling in be-handle-mail.
Now the final commit will run whether or not the preceding commands
raise any exceptions.
Note that since we've added the "--allow-empty" to "be commit", we
don't need to worry about empty commits after read-only actions.
Diffstat (limited to 'interfaces/email/interactive')
-rwxr-xr-x | interfaces/email/interactive/be-handle-mail | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/interfaces/email/interactive/be-handle-mail b/interfaces/email/interactive/be-handle-mail index e5f9dcf..e532b1d 100755 --- a/interfaces/email/interactive/be-handle-mail +++ b/interfaces/email/interactive/be-handle-mail @@ -387,11 +387,11 @@ class Message (object): otherwise returns a list of suggested commands to run. """ self.validate_subject() - tag,subject = self._split_subject() tag_type,value = self._subject_tag_type() commands = [] if tag_type == u"new": command = u"new" + tag,subject = self._split_subject() summary = subject options = {u"Reporter": self.author_addr()} body,mime_type = list(self._get_bodies_and_mime_types())[0] @@ -440,17 +440,18 @@ class Message (object): raise InvalidEmail(self, u"No commands in control email.") else: raise Exception, u"Unrecognized tag type '%s'" % tag_type - if AUTOCOMMIT == True: - commands.append(Command(self, "commit", [subject])) return commands def run(self): self._begin_response() commands = self.parse() - if LOGFILE != None: - LOGFILE.write("Running:\n %s\n\n" % "\n ".join([str(c) for c in commands])) - for command in commands: - command.run() - self._add_response(command.response_msg()) + try: + for command in commands: + command.run() + self._add_response(command.response_msg()) + finally: + if AUTOCOMMIT == True: + tag,subject = self._split_subject() + command = Command(self, "commit", [self.subject]) def _begin_response(self): tag,subject = self._split_subject() response_header = [u"From: %s" % HANDLER_ADDRESS, |