Gerrit git cl upload: record issue id for a branch.

BUG=

Review URL: https://codereview.chromium.org/1777603002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299312 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index b276b0a..b034480 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -82,6 +82,7 @@
     self.mock(subprocess2, 'check_call', self._mocked_call)
     self.mock(subprocess2, 'check_output', self._mocked_call)
     self.mock(subprocess2, 'communicate', self._mocked_call)
+    self.mock(git_cl.gclient_utils, 'CheckCallAndFilter', self._mocked_call)
     self.mock(git_common, 'is_dirty_git_tree', lambda x: False)
     self.mock(git_common, 'get_or_create_merge_base',
               lambda *a: (
@@ -320,6 +321,7 @@
          'diff', '--name-status', '--no-renames', '-r', 'fake_ancestor_sha...',
          '.'],),
         'M\tPRESUBMIT.py'),
+      ((['git', 'config', 'gerrit.host'],), ''),
       ((['git',
          'config', 'branch.working.rietveldissue'],), '12345'),
       ((['git',
@@ -333,6 +335,7 @@
   @classmethod
   def _dcommit_calls_bypassed(cls):
     return [
+      ((['git', 'config', 'gerrit.host'],), ''),
       ((['git',
          'config', 'branch.working.rietveldissue'],), '12345'),
       ((['git', 'config', 'branch.working.rietveldserver'],),
@@ -567,7 +570,7 @@
            'diff', '--name-status', '--no-renames', '-r',
            'fake_ancestor_sha...', '.'],),
          'M\t.gitignore\n'),
-        ((['git', 'config', 'branch.master.rietveldissue'],), ''),
+        ((['git', 'config', 'branch.master.gerritissue'],), ''),
         ((['git',
            'config', 'branch.master.rietveldpatchset'],), ''),
         ((['git',
@@ -593,7 +596,6 @@
          description)
         ]
     if not git_footers.get_footer_change_id(description) and not squash:
-      # TODOOOOO
       calls += [
           # DownloadGerritHook(False)
           ((False, ),
@@ -645,10 +647,23 @@
         ((['git',
            'push', receive_pack, 'origin',
            ref_to_push + ':refs/for/refs/heads/master'],),
-         '')
+         ('remote:\n'
+         'remote: Processing changes: (\)\n'
+         'remote: Processing changes: (|)\n'
+         'remote: Processing changes: (/)\n'
+         'remote: Processing changes: (-)\n'
+         'remote: Processing changes: new: 1 (/)\n'
+         'remote: Processing changes: new: 1, done\n'
+         'remote:\n'
+         'remote: New Changes:\n'
+         'remote:   https://chromium-review.googlesource.com/123456 XXX.\n'
+         'remote:\n'
+         'To https://chromium.googlesource.com/yyy/zzz\n'
+         ' * [new branch]      hhhh -> refs/for/refs/heads/master\n')),
         ]
     if squash:
       calls += [
+          ((['git', 'config', 'branch.master.gerritissue', '123456'],), ''),
           ((['git', 'rev-parse', 'HEAD'],), 'abcdef0123456789'),
           ((['git', 'update-ref', '-m', 'Uploaded abcdef0123456789',
             'refs/heads/git_cl_uploads/master', 'abcdef0123456789'],),