Bug %s patch
authorSteve Fink <sfink@mozilla.com>
Thu, 23 Feb 2012 23:06:09 -0800
changeset 81 e3f8c48de5221579eed18d2137ba0ef23e968306
parent 80 e748ee50e5eced77070c71d49461044c2206bd60
child 82 9ae61bd1745bde0178118c15c334b075ceeadf5b
push id36
push usersfink@mozilla.com
push dateFri, 24 Feb 2012 07:22:26 +0000
Bug %s patch
bzexport.py
--- a/bzexport.py
+++ b/bzexport.py
@@ -948,17 +948,20 @@ def update_patch(ui, repo, rev, bug, upd
         if newname != rev:
             mq.rename(ui, repo, rev, newname)
             rev = newname
 
     if update_patch:
         # Add "Bug nnnn - " to the beginning of the description
         ph = mq.patchheader(q.join(rev), q.plainmode)
         msg = ph.message
-        msg[0] = "Bug %s - %s" % (bug, msg[0])
+        if not msg:
+          msg = ["Bug %s patch"]
+        else:
+          msg[0] = "Bug %s - %s" % (bug, msg[0])
         opts = { 'git': True, 'message': '\n'.join(msg), 'include': ["re:."] }
         mq.refresh(ui, repo, *[rev], **opts)
 
 def bzexport(ui, repo, *args, **opts):
     """
     Export changesets to bugzilla attachments.
 
     The -e option may be used to bring up an editor that will allow editing all