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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 """Returns the file that stores information about a changelist.""" | 613 """Returns the file that stores information about a changelist.""" |
614 if not changename or re.search(r'[^\w-]', changename): | 614 if not changename or re.search(r'[^\w-]', changename): |
615 ErrorExit("Invalid changelist name: " + changename) | 615 ErrorExit("Invalid changelist name: " + changename) |
616 return os.path.join(GetChangesDir(), changename) | 616 return os.path.join(GetChangesDir(), changename) |
617 | 617 |
618 | 618 |
619 def LoadChangelistInfoForMultiple(changenames, local_root, fail_on_not_found, | 619 def LoadChangelistInfoForMultiple(changenames, local_root, fail_on_not_found, |
620 update_status): | 620 update_status): |
621 """Loads many changes and merge their files list into one pseudo change. | 621 """Loads many changes and merge their files list into one pseudo change. |
622 | 622 |
623 This is mainly usefull to concatenate many changes into one for a 'gcl try'. | 623 This is mainly useful to concatenate many changes into one for a 'gcl try'. |
624 """ | 624 """ |
625 changes = changenames.split(',') | 625 changes = changenames.split(',') |
626 aggregate_change_info = ChangeInfo( | 626 aggregate_change_info = ChangeInfo( |
627 changenames, 0, 0, '', None, local_root, None, False) | 627 changenames, 0, 0, '', None, local_root, None, False) |
628 for change in changes: | 628 for change in changes: |
629 aggregate_change_info._files += ChangeInfo.Load( | 629 aggregate_change_info._files += ChangeInfo.Load( |
630 change, local_root, fail_on_not_found, update_status).GetFiles() | 630 change, local_root, fail_on_not_found, update_status).GetFiles() |
631 return aggregate_change_info | 631 return aggregate_change_info |
632 | 632 |
633 | 633 |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 return 1 | 1514 return 1 |
1515 | 1515 |
1516 | 1516 |
1517 if __name__ == "__main__": | 1517 if __name__ == "__main__": |
1518 fix_encoding.fix_encoding() | 1518 fix_encoding.fix_encoding() |
1519 try: | 1519 try: |
1520 sys.exit(main(sys.argv[1:])) | 1520 sys.exit(main(sys.argv[1:])) |
1521 except KeyboardInterrupt: | 1521 except KeyboardInterrupt: |
1522 sys.stderr.write('interrupted\n') | 1522 sys.stderr.write('interrupted\n') |
1523 sys.exit(1) | 1523 sys.exit(1) |
OLD | NEW |