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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 command = ["svn", "status", "--xml"] | 129 command = ["svn", "status", "--xml"] |
130 if file is None: | 130 if file is None: |
131 pass | 131 pass |
132 elif isinstance(file, basestring): | 132 elif isinstance(file, basestring): |
133 command.append(file) | 133 command.append(file) |
134 else: | 134 else: |
135 command.extend(file) | 135 command.extend(file) |
136 | 136 |
137 status_letter = { | 137 status_letter = { |
138 '': ' ', | 138 '': ' ', |
139 'unversioned': '?', | |
140 'modified': 'M', | |
141 'added': 'A', | 139 'added': 'A', |
142 'conflicted': 'C', | 140 'conflicted': 'C', |
143 'deleted': 'D', | 141 'deleted': 'D', |
144 'ignored': 'I', | 142 'ignored': 'I', |
| 143 'missing': '!', |
| 144 'modified': 'M', |
| 145 'normal': ' ', |
145 'replaced': 'R', | 146 'replaced': 'R', |
146 # TODO(maruel): Find the corresponding strings for X, !, ~ | 147 'unversioned': '?', |
| 148 # TODO(maruel): Find the corresponding strings for X, ~ |
147 } | 149 } |
148 dom = ParseXML(RunShell(command)) | 150 dom = ParseXML(RunShell(command)) |
149 results = [] | 151 results = [] |
150 if dom: | 152 if dom: |
151 # /status/target/entry/(wc-status|commit|author|date) | 153 # /status/target/entry/(wc-status|commit|author|date) |
152 for target in dom.getElementsByTagName('target'): | 154 for target in dom.getElementsByTagName('target'): |
153 base_path = target.getAttribute('path') | 155 base_path = target.getAttribute('path') |
154 for entry in target.getElementsByTagName('entry'): | 156 for entry in target.getElementsByTagName('entry'): |
155 file = entry.getAttribute('path') | 157 file = entry.getAttribute('path') |
156 wc_status = entry.getElementsByTagName('wc-status') | 158 wc_status = entry.getElementsByTagName('wc-status') |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 # the files. This allows commands such as 'gcl diff xxx' to work. | 1182 # the files. This allows commands such as 'gcl diff xxx' to work. |
1181 args =["svn", command] | 1183 args =["svn", command] |
1182 root = GetRepositoryRoot() | 1184 root = GetRepositoryRoot() |
1183 args.extend([os.path.join(root, x) for x in change_info.FileList()]) | 1185 args.extend([os.path.join(root, x) for x in change_info.FileList()]) |
1184 RunShell(args, True) | 1186 RunShell(args, True) |
1185 return 0 | 1187 return 0 |
1186 | 1188 |
1187 | 1189 |
1188 if __name__ == "__main__": | 1190 if __name__ == "__main__": |
1189 sys.exit(main()) | 1191 sys.exit(main()) |
OLD | NEW |