From c4a7356a469b3b6267965d7bcc318cf35cdd3b62 Mon Sep 17 00:00:00 2001 From: Andrii Shyshkalov Date: Tue, 25 Sep 2018 18:40:17 +0000 Subject: [PATCH] git cl: cache also LABELS data on a change. This removes 1 RPC when tbr-ing second or later patchset. Since tests cover TBR only in first upload, there are no test changes. Since adding test is real PITA here, keep them as is. R=ehmaldonado Change-Id: I90801b06727ce2131a703d6cd6c24ffad798bc8a Reviewed-on: https://chromium-review.googlesource.com/1242212 Reviewed-by: Edward Lesmes Commit-Queue: Andrii Shyshkalov --- 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 5a66386e6..b9d8acf11 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2452,7 +2452,7 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): # Warm change details cache now to avoid RPCs later, reducing latency for # developers. self._GetChangeDetail( - ['DETAILED_ACCOUNTS', 'CURRENT_REVISION', 'CURRENT_COMMIT']) + ['DETAILED_ACCOUNTS', 'CURRENT_REVISION', 'CURRENT_COMMIT', 'LABELS']) status = self._GetChangeDetail()['status'] if status in ('MERGED', 'ABANDONED'): diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 452836819..a267e9549 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -1088,7 +1088,8 @@ class TestGitCl(TestCase): calls += [ (('GetChangeDetail', 'chromium-review.googlesource.com', 'my%2Frepo~123456', - ['DETAILED_ACCOUNTS', 'CURRENT_REVISION', 'CURRENT_COMMIT']), + ['DETAILED_ACCOUNTS', 'CURRENT_REVISION', 'CURRENT_COMMIT', 'LABELS'] + ), { 'owner': {'email': (other_cl_owner or 'owner@example.com')}, 'change_id': '123456789',