From d60367ba30630ce4091baed2a6dae4bd55e15b5e Mon Sep 17 00:00:00 2001 From: tandrii Date: Wed, 22 Jun 2016 05:25:12 -0700 Subject: [PATCH] Gerrit git cl land: add warning if Commit-Queue label exists. BUG=612727 R=agable@chromium.org Review-Url: https://codereview.chromium.org/2089683002 --- git_cl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 5d91536dc..415e36259 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2263,6 +2263,14 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): def CMDLand(self, force, bypass_hooks, verbose): if git_common.is_dirty_git_tree('land'): return 1 + detail = self._GetChangeDetail(['CURRENT_REVISION', 'LABELS']) + if u'Commit-Queue' in detail.get('labels', {}): + if not force: + ask_for_data('\nIt seems this repository has a Commit Queue, ' + 'which can test and land changes for you. ' + 'Are you sure you wish to bypass it?\n' + 'Press Enter to continue, Ctrl+C to abort.') + differs = True last_upload = RunGit(['config', 'branch.%s.gerritsquashhash' % self.GetBranch()], @@ -2271,7 +2279,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): if not last_upload or RunGit(['diff', last_upload]).strip(): print('WARNING: some changes from local branch haven\'t been uploaded') else: - detail = self._GetChangeDetail(['CURRENT_REVISION']) if detail['current_revision'] == last_upload: differs = False else: