From d0e1d9d9c5e60567b1b83e5d24a608e6a342006c Mon Sep 17 00:00:00 2001 From: Andrii Shyshkalov Date: Tue, 24 Jan 2017 17:10:51 +0100 Subject: [PATCH] git cl status: re-use existing ChangeList object. This way we avoid extra RPC to codereview site. R=sergiyb@chromium.org BUG=681704 Change-Id: I81f9ac1b8fe4cfaa95458a5669735168185c47e5 Reviewed-on: https://chromium-review.googlesource.com/430639 Commit-Queue: Andrii Shyshkalov Reviewed-by: Sergiy Byelozyorov --- git_cl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/git_cl.py b/git_cl.py index b6ec63f36..4ca54e2ff 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3821,10 +3821,13 @@ def CMDstatus(parser, args): alignment, ShortBranchName(branch), color, url, status_str, reset)) - cl = Changelist(auth_config=auth_config) + + branch = GetCurrentBranch() print() - print('Current branch:',) - print(cl.GetBranch()) + print('Current branch: %s' % branch) + for cl in changes: + if cl.GetBranch() == branch: + break if not cl.GetIssue(): print('No issue assigned.') return 0