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 <sergeyberezin@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 3ae313e..f65f7b2 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -3087,7 +3087,7 @@
                    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 7ed3b28..15e5cff 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1594,7 +1594,8 @@
          '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')),