OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # coding: utf-8 | 2 # coding: utf-8 |
3 # | 3 # |
4 # Copyright 2007 Google Inc. | 4 # Copyright 2007 Google Inc. |
5 # | 5 # |
6 # Licensed under the Apache License, Version 2.0 (the "License"); | 6 # Licensed under the Apache License, Version 2.0 (the "License"); |
7 # you may not use this file except in compliance with the License. | 7 # you may not use this file except in compliance with the License. |
8 # You may obtain a copy of the License at | 8 # You may obtain a copy of the License at |
9 # | 9 # |
10 # http://www.apache.org/licenses/LICENSE-2.0 | 10 # http://www.apache.org/licenses/LICENSE-2.0 |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 help="Base URL path for files (listed as \"Base URL\" when " | 628 help="Base URL path for files (listed as \"Base URL\" when " |
629 "viewing issue). If omitted, will be guessed automatically " | 629 "viewing issue). If omitted, will be guessed automatically " |
630 "for SVN repos and left blank for others.") | 630 "for SVN repos and left blank for others.") |
631 group.add_option("--target_ref", action="store", dest="target_ref", | 631 group.add_option("--target_ref", action="store", dest="target_ref", |
632 default=None, | 632 default=None, |
633 help="The target ref that is transitively tracked by the " | 633 help="The target ref that is transitively tracked by the " |
634 "local branch this patch comes from.") | 634 "local branch this patch comes from.") |
635 parser.add_option("--cq_dry_run", action="store_true", | 635 parser.add_option("--cq_dry_run", action="store_true", |
636 help="Send the patchset to do a CQ dry run right after " | 636 help="Send the patchset to do a CQ dry run right after " |
637 "upload.") | 637 "upload.") |
| 638 parser.add_option("--depends_on_patchset", action="store", |
| 639 dest="depends_on_patchset", |
| 640 help="The uploaded patchset this patchset depends on. The " |
| 641 "value will be in this format- issue_num:patchset_num") |
638 group.add_option("--download_base", action="store_true", | 642 group.add_option("--download_base", action="store_true", |
639 dest="download_base", default=False, | 643 dest="download_base", default=False, |
640 help="Base files will be downloaded by the server " | 644 help="Base files will be downloaded by the server " |
641 "(side-by-side diffs may not work on files with CRs).") | 645 "(side-by-side diffs may not work on files with CRs).") |
642 group.add_option("--rev", action="store", dest="revision", | 646 group.add_option("--rev", action="store", dest="revision", |
643 metavar="REV", default=None, | 647 metavar="REV", default=None, |
644 help="Base revision/branch/tree to diff against. Use " | 648 help="Base revision/branch/tree to diff against. Use " |
645 "rev1:rev2 range to review already committed changeset.") | 649 "rev1:rev2 range to review already committed changeset.") |
646 group.add_option("--send_mail", action="store_true", | 650 group.add_option("--send_mail", action="store_true", |
647 dest="send_mail", default=False, | 651 dest="send_mail", default=False, |
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 for cc in options.cc.split(','): | 2433 for cc in options.cc.split(','): |
2430 CheckReviewer(cc) | 2434 CheckReviewer(cc) |
2431 form_fields.append(("cc", options.cc)) | 2435 form_fields.append(("cc", options.cc)) |
2432 if options.project: | 2436 if options.project: |
2433 form_fields.append(("project", options.project)) | 2437 form_fields.append(("project", options.project)) |
2434 if options.target_ref: | 2438 if options.target_ref: |
2435 form_fields.append(("target_ref", options.target_ref)) | 2439 form_fields.append(("target_ref", options.target_ref)) |
2436 if options.cq_dry_run: | 2440 if options.cq_dry_run: |
2437 form_fields.append(("cq_dry_run", "1")) | 2441 form_fields.append(("cq_dry_run", "1")) |
2438 form_fields.append(("commit", "1")) | 2442 form_fields.append(("commit", "1")) |
| 2443 if options.depends_on_patchset: |
| 2444 form_fields.append(("depends_on_patchset", options.depends_on_patchset)) |
2439 | 2445 |
2440 # Process --message, --title and --file. | 2446 # Process --message, --title and --file. |
2441 message = options.message or "" | 2447 message = options.message or "" |
2442 title = options.title or "" | 2448 title = options.title or "" |
2443 if options.file: | 2449 if options.file: |
2444 if options.message: | 2450 if options.message: |
2445 ErrorExit("Can't specify both message and message file options") | 2451 ErrorExit("Can't specify both message and message file options") |
2446 file = open(options.file, 'r') | 2452 file = open(options.file, 'r') |
2447 message = file.read() | 2453 message = file.read() |
2448 file.close() | 2454 file.close() |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 print | 2549 print |
2544 StatusUpdate("Interrupted.") | 2550 StatusUpdate("Interrupted.") |
2545 sys.exit(1) | 2551 sys.exit(1) |
2546 except auth.AuthenticationError as e: | 2552 except auth.AuthenticationError as e: |
2547 print >> sys.stderr, e | 2553 print >> sys.stderr, e |
2548 sys.exit(1) | 2554 sys.exit(1) |
2549 | 2555 |
2550 | 2556 |
2551 if __name__ == "__main__": | 2557 if __name__ == "__main__": |
2552 main() | 2558 main() |
OLD | NEW |