OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """\ | 6 """\ |
7 Wrapper script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
8 of files. | 8 of files. |
9 """ | 9 """ |
10 | 10 |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 # When the command is 'try' and --patchset is used, the patch to try | 1360 # When the command is 'try' and --patchset is used, the patch to try |
1361 # is on the Rietveld server. | 1361 # is on the Rietveld server. |
1362 if not args: | 1362 if not args: |
1363 ErrorExit("You need to pass a change list name") | 1363 ErrorExit("You need to pass a change list name") |
1364 if args[0].find(',') != -1: | 1364 if args[0].find(',') != -1: |
1365 change_info = LoadChangelistInfoForMultiple(args[0], GetRepositoryRoot(), | 1365 change_info = LoadChangelistInfoForMultiple(args[0], GetRepositoryRoot(), |
1366 True, True) | 1366 True, True) |
1367 else: | 1367 else: |
1368 change_info = ChangeInfo.Load(args[0], GetRepositoryRoot(), | 1368 change_info = ChangeInfo.Load(args[0], GetRepositoryRoot(), |
1369 True, True) | 1369 True, True) |
| 1370 |
| 1371 props = change_info.RpcServer().get_issue_properties( |
| 1372 change_info.issue, False) |
| 1373 if props.get('private'): |
| 1374 ErrorExit('Cannot use trybots on a private issue') |
| 1375 |
1370 if change_info.GetFiles(): | 1376 if change_info.GetFiles(): |
1371 args = args[1:] | 1377 args = args[1:] |
1372 else: | 1378 else: |
1373 change_info = None | 1379 change_info = None |
1374 return TryChange(change_info, args, swallow_exception=False) | 1380 return TryChange(change_info, args, swallow_exception=False) |
1375 | 1381 |
1376 | 1382 |
1377 @attrs(usage='<old-name> <new-name>') | 1383 @attrs(usage='<old-name> <new-name>') |
1378 def CMDrename(args): | 1384 def CMDrename(args): |
1379 """Renames an existing change.""" | 1385 """Renames an existing change.""" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 raise | 1504 raise |
1499 print >> sys.stderr, ( | 1505 print >> sys.stderr, ( |
1500 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1506 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1501 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1507 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
1502 return 1 | 1508 return 1 |
1503 | 1509 |
1504 | 1510 |
1505 if __name__ == "__main__": | 1511 if __name__ == "__main__": |
1506 fix_encoding.fix_encoding() | 1512 fix_encoding.fix_encoding() |
1507 sys.exit(main(sys.argv[1:])) | 1513 sys.exit(main(sys.argv[1:])) |
OLD | NEW |