From 02b5af35755b90057b87f48afe9d7faa1de5d97f Mon Sep 17 00:00:00 2001 From: Anthony Polito Date: Mon, 2 Dec 2019 19:49:47 +0000 Subject: [PATCH] fix hashtags: double colons are not hashtags Bug: 896110 Change-Id: Ibaf36df48d9ea25e8ee633ca505fa7f7c2063df4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1944639 Reviewed-by: Edward Lesmes Commit-Queue: Anthony Polito --- git_cl.py | 2 +- tests/git_cl_test.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 8fa7dd98b..505a3e87b 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2830,7 +2830,7 @@ class ChangeDescription(object): CHERRY_PICK_LINE = r'^\(cherry picked from commit [a-fA-F0-9]{40}\)$' STRIP_HASH_TAG_PREFIX = r'^(\s*(revert|reland)( "|:)?\s*)*' BRACKET_HASH_TAG = r'\s*\[([^\[\]]+)\]' - COLON_SEPARATED_HASH_TAG = r'^([a-zA-Z0-9_\- ]+):' + COLON_SEPARATED_HASH_TAG = r'^([a-zA-Z0-9_\- ]+):($|[^:])' BAD_HASH_TAG_CHUNK = r'[^a-zA-Z0-9]+' def __init__(self, description, bug=None, fixed=None): diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index d73dd8764..9ed8a1fca 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -1694,6 +1694,8 @@ class TestGitCl(TestCase): ('Revert "Reland: [a] feature"', ['a']), ('Foo: feature', ['foo']), ('Foo Bar: feature', ['foo-bar']), + ('Change Foo::Bar', []), + ('Foo: Change Foo::Bar', ['foo']), ('Revert "Foo bar: feature"', ['foo-bar']), ('Reland "Foo bar: feature"', ['foo-bar']), ]