Commit 16f10f7f authored by jrobbins@chromium.org's avatar jrobbins@chromium.org

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
parent 0e490288
...@@ -1367,6 +1367,12 @@ def CMDtry(args): ...@@ -1367,6 +1367,12 @@ def CMDtry(args):
else: else:
change_info = ChangeInfo.Load(args[0], GetRepositoryRoot(), change_info = ChangeInfo.Load(args[0], GetRepositoryRoot(),
True, True) 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(): if change_info.GetFiles():
args = args[1:] args = args[1:]
else: else:
......
...@@ -2267,6 +2267,10 @@ def CMDtry(parser, args): ...@@ -2267,6 +2267,10 @@ def CMDtry(parser, args):
if not cl.GetIssue(): if not cl.GetIssue():
parser.error('Need to upload first') 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: if not options.name:
options.name = cl.GetBranch() options.name = cl.GetBranch()
...@@ -2412,6 +2416,9 @@ def CMDset_commit(parser, args): ...@@ -2412,6 +2416,9 @@ def CMDset_commit(parser, args):
if args: if args:
parser.error('Unrecognized args: %s' % ' '.join(args)) parser.error('Unrecognized args: %s' % ' '.join(args))
cl = Changelist() cl = Changelist()
props = cl.GetIssueProperties()
if props.get('private'):
parser.error('Cannot set commit on private issue')
cl.SetFlag('commit', '1') cl.SetFlag('commit', '1')
return 0 return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment