qbackout: only match on bugs that are preceded by 'bug' (
bug 1375781) r?gps
qbackout currently matches on servo's "Merge #12345", incorrectly treating
12345 as a bug number. switch to requiring "
bug 12345".
MozReview-Commit-ID: LIlFI0EtAn3
--- a/hgext/qbackout/__init__.py
+++ b/hgext/qbackout/__init__.py
@@ -13,17 +13,17 @@ from hgext import mq
import StringIO
import os
import re
OUR_DIR = os.path.dirname(__file__)
execfile(os.path.join(OUR_DIR, '..', 'bootstrap.py'))
-from mozautomation.commitparser import BUG_RE
+from mozautomation.commitparser import BUG_CONSERVATIVE_RE
# mercurial version portability
import sys
if not getattr(cmdutil, 'bailifchanged', None):
cmdutil.bailifchanged = cmdutil.bail_if_changed
if 'mercurial.scmutil' not in sys.modules:
import mercurial.cmdutil as scmutil
testedwith = '3.8 3.9 4.0 4.1 4.2'
@@ -159,17 +159,17 @@ def do_backout(ui, repo, rev, handle_cha
return ''
elif len(bugs) == 1:
return ' (bug ' + list(bugs)[0] + ')'
else:
return ' (' + ', '.join(map(lambda b: 'bug %s' % b, bugs)) + ')'
def parse_bugs(msg):
bugs = set()
- m = BUG_RE.search(msg)
+ m = BUG_CONSERVATIVE_RE.search(msg)
if m:
bugs.add(m.group(2))
return bugs
def apply_change(node, reverse, push_patch=True, name=None):
p1, p2 = repo.changelog.parents(node)
if p2 != nullid:
raise util.Abort('cannot %s a merge changeset' % desc['action'])