OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 # Wrapper script around Rietveld's upload.py that groups files into | 6 # Wrapper script around Rietveld's upload.py that groups files into |
7 # changelists. | 7 # changelists. |
8 | 8 |
9 import getpass | 9 import getpass |
10 import os | 10 import os |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
548 if cl_name: | 548 if cl_name: |
549 note = "" | 549 note = "" |
550 if len(LoadChangelistInfo(cl_name).files) != len(files[cl_name]): | 550 if len(LoadChangelistInfo(cl_name).files) != len(files[cl_name]): |
551 note = " (Note: this changelist contains files outside this directory)" | 551 note = " (Note: this changelist contains files outside this directory)" |
552 print "\n--- Changelist " + cl_name + note + ":" | 552 print "\n--- Changelist " + cl_name + note + ":" |
553 for file in files[cl_name]: | 553 for file in files[cl_name]: |
554 print "".join(file) | 554 print "".join(file) |
555 | 555 |
556 | 556 |
557 def Help(argv=None): | 557 def Help(argv=None): |
558 if argv and argv[0] == 'try': | 558 if argv: |
559 TryChange(None, ['--help'], swallow_exception=False) | 559 if argv[0] == 'try': |
560 return | 560 TryChange(None, ['--help'], swallow_exception=False) |
561 return | |
Lei Zhang
2009/05/12 21:25:45
Remove return and change if below to elif?
Evan Stade
2009/05/12 21:53:20
but then it would print two helps...
Lei Zhang
2009/05/12 22:07:24
n/m, I have tunnel vision.
| |
562 if argv[0] == 'upload': | |
563 upload.RealMain(['upload.py', '--help']) | |
564 return | |
561 | 565 |
562 print ( | 566 print ( |
563 """GCL is a wrapper for Subversion that simplifies working with groups of files. | 567 """GCL is a wrapper for Subversion that simplifies working with groups of files. |
564 version """ + __version__ + """ | 568 version """ + __version__ + """ |
565 | 569 |
566 Basic commands: | 570 Basic commands: |
567 ----------------------------------------- | 571 ----------------------------------------- |
568 gcl change change_name | 572 gcl change change_name |
569 Add/remove files to a changelist. Only scans the current directory and | 573 Add/remove files to a changelist. Only scans the current directory and |
570 subdirectories. | 574 subdirectories. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
608 | 612 |
609 gcl status | 613 gcl status |
610 Lists modified and unknown files in the current directory and | 614 Lists modified and unknown files in the current directory and |
611 subdirectories. | 615 subdirectories. |
612 | 616 |
613 gcl try change_name | 617 gcl try change_name |
614 Sends the change to the tryserver so a trybot can do a test run on your | 618 Sends the change to the tryserver so a trybot can do a test run on your |
615 code. To send multiple changes as one path, use a comma-separated list | 619 code. To send multiple changes as one path, use a comma-separated list |
616 of changenames. | 620 of changenames. |
617 --> Use 'gcl help try' for more information! | 621 --> Use 'gcl help try' for more information! |
622 | |
623 gcl help [command] | |
624 Print this help menu, or help for the given command if it exists. | |
618 """) | 625 """) |
619 | 626 |
620 def GetEditor(): | 627 def GetEditor(): |
621 editor = os.environ.get("SVN_EDITOR") | 628 editor = os.environ.get("SVN_EDITOR") |
622 if not editor: | 629 if not editor: |
623 editor = os.environ.get("EDITOR") | 630 editor = os.environ.get("EDITOR") |
624 | 631 |
625 if not editor: | 632 if not editor: |
626 if sys.platform.startswith("win"): | 633 if sys.platform.startswith("win"): |
627 editor = "notepad" | 634 editor = "notepad" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1082 # the files. This allows commands such as 'gcl diff xxx' to work. | 1089 # the files. This allows commands such as 'gcl diff xxx' to work. |
1083 args =["svn", command] | 1090 args =["svn", command] |
1084 root = GetRepositoryRoot() | 1091 root = GetRepositoryRoot() |
1085 args.extend([os.path.join(root, x) for x in change_info.FileList()]) | 1092 args.extend([os.path.join(root, x) for x in change_info.FileList()]) |
1086 RunShell(args, True) | 1093 RunShell(args, True) |
1087 return 0 | 1094 return 0 |
1088 | 1095 |
1089 | 1096 |
1090 if __name__ == "__main__": | 1097 if __name__ == "__main__": |
1091 sys.exit(main()) | 1098 sys.exit(main()) |
OLD | NEW |