From 289b43183e98bdec9e8bc45be1eb462876cccebc Mon Sep 17 00:00:00 2001 From: Aaron Gable Date: Wed, 13 Sep 2017 14:06:16 -0700 Subject: [PATCH] git-cl: Parse new change urls containing project paths Bug: 764848 Change-Id: I639451ad54eb50a405fe44b9a83b00d84ec76578 Reviewed-on: https://chromium-review.googlesource.com/665998 Reviewed-by: Sergey Berezin Commit-Queue: Aaron Gable --- git_cl.py | 2 +- tests/git_cl_test.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/git_cl.py b/git_cl.py index 3ae313ee9..f65f7b216 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3087,7 +3087,7 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): change_desc) if options.squash: - regex = re.compile(r'remote:\s+https?://[\w\-\.\/]*/(\d+)\s.*') + regex = re.compile(r'remote:\s+https?://[\w\-\.\+\/#]*/(\d+)\s.*') change_numbers = [m.group(1) for m in map(regex.match, push_stdout.splitlines()) if m] diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 7ed3b2887..15e5cff50 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -1594,7 +1594,8 @@ class TestGitCl(TestCase): 'remote: Processing changes: new: 1, done\n' 'remote:\n' 'remote: New Changes:\n' - 'remote: https://chromium-review.googlesource.com/123456 XXX.\n' + 'remote: https://chromium-review.googlesource.com/#/c/foo/+/123456 ' + 'XXX\n' 'remote:\n' 'To https://chromium.googlesource.com/yyy/zzz\n' ' * [new branch] hhhh -> refs/for/refs/heads/master\n')),