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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 return | 872 return |
873 else: | 873 else: |
874 args.remove("--no_presubmit") | 874 args.remove("--no_presubmit") |
875 | 875 |
876 no_tree_status_check = ("--force" in args or "-f" in args) | 876 no_tree_status_check = ("--force" in args or "-f" in args) |
877 if not no_tree_status_check and not IsTreeOpen(): | 877 if not no_tree_status_check and not IsTreeOpen(): |
878 print ("Error: The tree is closed. Try again later or use --force to force" | 878 print ("Error: The tree is closed. Try again later or use --force to force" |
879 " the commit. May the --force be with you.") | 879 " the commit. May the --force be with you.") |
880 return | 880 return |
881 | 881 |
882 commit_cmd = ["svn", "commit", "--non-recursive"] | 882 # We face a problem with svn here: Let's say change 'bleh' modifies |
| 883 # svn:ignore on dir1\. but another unrelated change 'pouet' modifies |
| 884 # dir1\foo.cc. When the user `gcl commit bleh`, foo.cc is *also committed*. |
| 885 # The only fix is to use --non-recursive but that has its issues too: |
| 886 # Let's say if dir1 is deleted, --non-recursive must *not* be used otherwise |
| 887 # you'll get "svn: Cannot non-recursively commit a directory deletion of a |
| 888 # directory with child nodes". Yay... |
| 889 commit_cmd = ["svn", "commit"] |
883 filename = '' | 890 filename = '' |
884 if change_info.issue: | 891 if change_info.issue: |
885 # Get the latest description from Rietveld. | 892 # Get the latest description from Rietveld. |
886 change_info.description = GetIssueDescription(change_info.issue) | 893 change_info.description = GetIssueDescription(change_info.issue) |
887 | 894 |
888 commit_message = change_info.description.replace('\r\n', '\n') | 895 commit_message = change_info.description.replace('\r\n', '\n') |
889 if change_info.issue: | 896 if change_info.issue: |
890 commit_message += ('\nReview URL: http://%s/%s' % | 897 commit_message += ('\nReview URL: http://%s/%s' % |
891 (GetCodeReviewSetting("CODE_REVIEW_SERVER"), | 898 (GetCodeReviewSetting("CODE_REVIEW_SERVER"), |
892 change_info.issue)) | 899 change_info.issue)) |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 # the files. This allows commands such as 'gcl diff xxx' to work. | 1147 # the files. This allows commands such as 'gcl diff xxx' to work. |
1141 args =["svn", command] | 1148 args =["svn", command] |
1142 root = GetRepositoryRoot() | 1149 root = GetRepositoryRoot() |
1143 args.extend([os.path.join(root, x) for x in change_info.FileList()]) | 1150 args.extend([os.path.join(root, x) for x in change_info.FileList()]) |
1144 RunShell(args, True) | 1151 RunShell(args, True) |
1145 return 0 | 1152 return 0 |
1146 | 1153 |
1147 | 1154 |
1148 if __name__ == "__main__": | 1155 if __name__ == "__main__": |
1149 sys.exit(main()) | 1156 sys.exit(main()) |
OLD | NEW |