From 16f10f7f4e192aacc096cf3a170d28c55f1004fc Mon Sep 17 00:00:00 2001 From: "jrobbins@chromium.org" Date: Tue, 24 Jun 2014 22:14:36 +0000 Subject: [PATCH] Show an error message when the user tries to set the commit flag or add trybots to a private issue. BUG=387088 Review URL: https://codereview.chromium.org/348933002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@279514 0039d316-1c4b-4281-b951-d872f2087c98 --- gcl.py | 6 ++++++ git_cl.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/gcl.py b/gcl.py index 82aa96a27..b020e74bb 100755 --- a/gcl.py +++ b/gcl.py @@ -1367,6 +1367,12 @@ def CMDtry(args): else: change_info = ChangeInfo.Load(args[0], GetRepositoryRoot(), True, True) + + props = change_info.RpcServer().get_issue_properties( + change_info.issue, False) + if props.get('private'): + ErrorExit('Cannot use trybots on a private issue') + if change_info.GetFiles(): args = args[1:] else: diff --git a/git_cl.py b/git_cl.py index 6a43b3d05..f86a78176 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2267,6 +2267,10 @@ def CMDtry(parser, args): if not cl.GetIssue(): parser.error('Need to upload first') + props = cl.GetIssueProperties() + if props.get('private'): + parser.error('Cannot use trybots with private issue') + if not options.name: options.name = cl.GetBranch() @@ -2412,6 +2416,9 @@ def CMDset_commit(parser, args): if args: parser.error('Unrecognized args: %s' % ' '.join(args)) cl = Changelist() + props = cl.GetIssueProperties() + if props.get('private'): + parser.error('Cannot set commit on private issue') cl.SetFlag('commit', '1') return 0