pull bug number from patch name too
authorSteve Fink <sfink@mozilla.com>
Tue, 24 Jan 2012 00:29:11 -0800
changeset 63 307cb61da481e42dc8d5bb292fdb71779423f55a
parent 62 b1a0a58c332baefd7bf95bcd3cd1928064c871cb
child 64 e618fed044fa2758bb5870535f0829db7232035f
push id33
push usersfink@mozilla.com
push dateWed, 01 Feb 2012 20:22:14 +0000
pull bug number from patch name too
bzexport.py
--- a/bzexport.py
+++ b/bzexport.py
@@ -740,16 +740,22 @@ def infer_arguments(ui, repo, args, opts
         if (m or a or r or d):
             raise util.Abort(_("Local changes found; refresh first!"))
 
     if rev in ["tip", "qtip"]:
         # Look for a nicer name in the MQ.
         if hasattr(repo, 'mq') and repo.mq.applied:
             rev = repo.mq.applied[-1].name
 
+    # Check for bug number in the patch filename
+    if bug is None:
+        m = re.match(r'bug[_\-]?(\d+)', rev)
+        if m:
+            bug = m.group(1)
+
     return (rev, bug)
 
 def choose_prodcomponent(ui, c, orig_product, orig_component, finalize = False):
     def canon(v):
         if not v or v == '<choose-from-menu>':
             return None
         return v