Bug 1137442 - Try to use a try email commit description of at least 3 characters
When iterating through the list of commits in a try push to extract a summary
for the email, reject titles that are less than 3 characters.
--- a/status/generators.py
+++ b/status/generators.py
@@ -48,12 +48,12 @@ def getSensibleCommitTitle(titles):
title = re.sub(r'^(imported patch|\[mq\]:) ', '', title)
# Remove review, feedback, etc. annotations.
title = re.sub(r'\b(r|sr|f|a)[=\?].*', '', title)
# Remove trailing punctuation and whitespace.
title = re.sub(r'[;,\-\. ]+$', '', title).strip()
- if title:
+ if len(title) > 2:
return title
return titles[0]
--- a/test/test_status.py
+++ b/test/test_status.py
@@ -4,16 +4,19 @@ from buildbot.changes import changes
from buildbotcustom.status.generators import getSensibleCommitTitle
SENSIBLE_TITLE_TESTCASES = [
['Bug 1', ['Bug 1']],
['Bug 1', ['Bug 1', 'Bug 2']],
['Bug 1', ['try: -b d -p all', 'Bug 1']],
['Bug 1', ['try: -b d -p all', 'try: -b d -p none', 'Bug 1']],
+ ['Bug 1', ['"try: -b d -p linux -u all -t none"', 'Bug 1']],
+
+ ['Bug 1', ['zz', 'Bug 1']],
['test.patch', ['[mq]: test.patch']],
['test.patch', ['imported patch test.patch']],
['test imported patch test.patch', ['test imported patch test.patch']],
['Bug 1 - Test', ['Bug 1 - Test; r=me']],
['Bug 1 - Test', ['Bug 1 - Test. r?me f=you']],