Don't use Patch.commit_message before it's defined. email-r=robarnold
authorChris Jones <jones.chris.g@gmail.com>
Mon, 14 Jun 2010 22:12:37 -0500
changeset 62 3ba2221f3ca2
parent 61 6bb40df6000e
child 63 14e99b1f1ff9
push id44
push usercjones@mozilla.com
push dateTue, 15 Jun 2010 03:13:42 +0000
Don't use Patch.commit_message before it's defined. email-r=robarnold
bz.py
--- a/bz.py
+++ b/bz.py
@@ -134,25 +134,25 @@ class Patch(Attachment):
         who = ""
         break
       # Email domain may need to be retrieved/added manually...
       self.author = "%s <%s>" % (
         # Scrub the :cruft and any '[...]' or '(...)' too from the username.
         re.sub("\[.*?\]|\(.*?\)|:\S+", "", who).strip(),
         patchAttacherEmail)
 
+    self.commit_message = None
     # (Mercurial v1.4.3(-!?)) "No message" is extracted as '\n' :-/
     # Want to strip the message anyway.
     if message:
       try:
         # See previous self.data block about utf-8 handling.
         self.commit_message = message.decode('utf-8') \
                                      .strip()
       except UnicodeDecodeError:
-        self.commit_message = None
         bug.settings.ui.warn("Patch id=%s desc=\"%s\" message data were discarded too:\n" % (self.id, self.desc))
         sys.excepthook(sys.exc_info()[0], sys.exc_info()[1], None)
         message = None
     if not self.commit_message:
       self.commit_message = self.bug.settings.msg_format % self.metadata
 
   def __unicode__(self):
     return u"""# vim: se ft=diff :