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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 help="Make the issue restricted to reviewers and those CCed") | 643 help="Make the issue restricted to reviewers and those CCed") |
644 # Upload options | 644 # Upload options |
645 group = parser.add_option_group("Patch options") | 645 group = parser.add_option_group("Patch options") |
646 group.add_option("-i", "--issue", type="int", action="store", | 646 group.add_option("-i", "--issue", type="int", action="store", |
647 metavar="ISSUE", default=None, | 647 metavar="ISSUE", default=None, |
648 help="Issue number to which to add. Defaults to new issue.") | 648 help="Issue number to which to add. Defaults to new issue.") |
649 group.add_option("--base_url", action="store", dest="base_url", default=None, | 649 group.add_option("--base_url", action="store", dest="base_url", default=None, |
650 help="Base URL path for files (listed as \"Base URL\" when " | 650 help="Base URL path for files (listed as \"Base URL\" when " |
651 "viewing issue). If omitted, will be guessed automatically " | 651 "viewing issue). If omitted, will be guessed automatically " |
652 "for SVN repos and left blank for others.") | 652 "for SVN repos and left blank for others.") |
| 653 group.add_option("--target_ref", action="store", dest="target_ref", |
| 654 default=None, |
| 655 help="The target ref that is transitively tracked by the " |
| 656 "local branch this patch comes from.") |
653 group.add_option("--download_base", action="store_true", | 657 group.add_option("--download_base", action="store_true", |
654 dest="download_base", default=False, | 658 dest="download_base", default=False, |
655 help="Base files will be downloaded by the server " | 659 help="Base files will be downloaded by the server " |
656 "(side-by-side diffs may not work on files with CRs).") | 660 "(side-by-side diffs may not work on files with CRs).") |
657 group.add_option("--rev", action="store", dest="revision", | 661 group.add_option("--rev", action="store", dest="revision", |
658 metavar="REV", default=None, | 662 metavar="REV", default=None, |
659 help="Base revision/branch/tree to diff against. Use " | 663 help="Base revision/branch/tree to diff against. Use " |
660 "rev1:rev2 range to review already committed changeset.") | 664 "rev1:rev2 range to review already committed changeset.") |
661 group.add_option("--send_mail", action="store_true", | 665 group.add_option("--send_mail", action="store_true", |
662 dest="send_mail", default=False, | 666 dest="send_mail", default=False, |
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 if options.reviewers: | 2602 if options.reviewers: |
2599 for reviewer in options.reviewers.split(','): | 2603 for reviewer in options.reviewers.split(','): |
2600 CheckReviewer(reviewer) | 2604 CheckReviewer(reviewer) |
2601 form_fields.append(("reviewers", options.reviewers)) | 2605 form_fields.append(("reviewers", options.reviewers)) |
2602 if options.cc: | 2606 if options.cc: |
2603 for cc in options.cc.split(','): | 2607 for cc in options.cc.split(','): |
2604 CheckReviewer(cc) | 2608 CheckReviewer(cc) |
2605 form_fields.append(("cc", options.cc)) | 2609 form_fields.append(("cc", options.cc)) |
2606 if options.project: | 2610 if options.project: |
2607 form_fields.append(("project", options.project)) | 2611 form_fields.append(("project", options.project)) |
| 2612 if options.target_ref: |
| 2613 form_fields.append(("target_ref", options.target_ref)) |
2608 | 2614 |
2609 # Process --message, --title and --file. | 2615 # Process --message, --title and --file. |
2610 message = options.message or "" | 2616 message = options.message or "" |
2611 title = options.title or "" | 2617 title = options.title or "" |
2612 if options.file: | 2618 if options.file: |
2613 if options.message: | 2619 if options.message: |
2614 ErrorExit("Can't specify both message and message file options") | 2620 ErrorExit("Can't specify both message and message file options") |
2615 file = open(options.file, 'r') | 2621 file = open(options.file, 'r') |
2616 message = file.read() | 2622 message = file.read() |
2617 file.close() | 2623 file.close() |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2709 os.environ['LC_ALL'] = 'C' | 2715 os.environ['LC_ALL'] = 'C' |
2710 RealMain(sys.argv) | 2716 RealMain(sys.argv) |
2711 except KeyboardInterrupt: | 2717 except KeyboardInterrupt: |
2712 print | 2718 print |
2713 StatusUpdate("Interrupted.") | 2719 StatusUpdate("Interrupted.") |
2714 sys.exit(1) | 2720 sys.exit(1) |
2715 | 2721 |
2716 | 2722 |
2717 if __name__ == "__main__": | 2723 if __name__ == "__main__": |
2718 main() | 2724 main() |
OLD | NEW |