Do not parse reviewers out of the patch header, because it's too hard to turn off. Instead, only do that if -r auto is given.
authorSteve Fink <sfink@mozilla.com>
Sun, 15 Jan 2012 23:57:00 -0800
changeset 53 3c6aedd092c2c5942fcbe295e32bd869f01a3ffb
parent 52 5de77696ef6ef9aad12337ff45e7bb48a7089c04
child 54 a2133cc1d5e06874be3acf684d77c1f491be633d
push id33
push usersfink@mozilla.com
push dateWed, 01 Feb 2012 20:22:14 +0000
Do not parse reviewers out of the patch header, because it's too hard to turn off. Instead, only do that if -r auto is given.
bzexport.py
--- a/bzexport.py
+++ b/bzexport.py
@@ -847,21 +847,25 @@ def bzexport(ui, repo, *args, **opts):
                 bug = bzexport.newbug
 
         # Next strip any remaining leading separator with whitespace,
         # if the original was something like "bug NNN - "
         desc = desc.lstrip()
         if desc[0] in ['-', ':', '.']:
             desc = desc[1:].lstrip()
 
-        # Next strip off review and approval annotations
+        # Next strip off review and approval annotations, grabbing the
+        # reviewers from the patch comments only if -r auto was given
         def grab_reviewer(m):
-            reviewers.append(m.group(1))
+            if opts['review'] == 'auto':
+                reviewers.append(m.group(1))
             return ''
         desc = review_re.sub(grab_reviewer, desc).rstrip()
+        if len(reviewers) > 0:
+            del opts['review']
 
         # Finally, just take the first line in case. If there is more than one
         # line, use it as a comment.
         m = re.match(r'([^\n]*)\n+(.*)', desc, re.DOTALL)
         if m:
             desc = m.group(1)
             patch_comment = m.group(2)
 
@@ -998,17 +1002,17 @@ def newbug(ui, repo, *args, **opts):
 cmdtable = {
     'bzexport':
         (bzexport,
          [('d', 'description', '', 'Bugzilla attachment description'),
           ('c', 'comment', '', 'Comment to add with the attachment'),
           ('e', 'edit', False,
            'Open a text editor to modify bug fields'),
           ('r', 'review', '',
-           'List of users to request review from (comma-separated search strings)'),
+           'List of users to request review from (comma-separated search strings), or "auto" to parse the reviewers out of the patch comment'),
           ('', 'new', False,
            'Create a new bug'),
           ('', 'title', '',
            'New bug title'),
           ('', 'product', '',
            'New bug product'),
           ('', 'component', '',
            'New bug component'),