OLD | NEW |
1 # Copyright 2009 Google Inc. All Rights Reserved. | 1 # Copyright 2009 Google Inc. All Rights Reserved. |
2 # | 2 # |
3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
6 # | 6 # |
7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
8 # | 8 # |
9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if not from_info: | 156 if not from_info: |
157 raise gclient_utils.Error("Can't update/checkout %r if an unversioned " | 157 raise gclient_utils.Error("Can't update/checkout %r if an unversioned " |
158 "directory is present. Delete the directory " | 158 "directory is present. Delete the directory " |
159 "and try again." % | 159 "and try again." % |
160 checkout_path) | 160 checkout_path) |
161 | 161 |
162 if options.manually_grab_svn_rev: | 162 if options.manually_grab_svn_rev: |
163 # Retrieve the current HEAD version because svn is slow at null updates. | 163 # Retrieve the current HEAD version because svn is slow at null updates. |
164 if not revision: | 164 if not revision: |
165 from_info_live = CaptureSVNInfo(from_info['URL'], '.') | 165 from_info_live = CaptureSVNInfo(from_info['URL'], '.') |
166 revision = from_info_live['Revision'] | 166 revision = str(from_info_live['Revision']) |
167 rev_str = ' at %s' % revision | 167 rev_str = ' at %s' % revision |
168 | 168 |
169 if from_info['URL'] != components[0]: | 169 if from_info['URL'] != components[0]: |
170 to_info = CaptureSVNInfo(url, '.') | 170 to_info = CaptureSVNInfo(url, '.') |
171 if not to_info.get('Repository Root') or not to_info.get('UUID'): | 171 if not to_info.get('Repository Root') or not to_info.get('UUID'): |
172 # The url is invalid or the server is not accessible, it's safer to bail | 172 # The url is invalid or the server is not accessible, it's safer to bail |
173 # out right now. | 173 # out right now. |
174 raise gclient_utils.Error('This url is unreachable: %s' % url) | 174 raise gclient_utils.Error('This url is unreachable: %s' % url) |
175 can_switch = ((from_info['Repository Root'] != to_info['Repository Root']) | 175 can_switch = ((from_info['Repository Root'] != to_info['Repository Root']) |
176 and (from_info['UUID'] == to_info['UUID'])) | 176 and (from_info['UUID'] == to_info['UUID'])) |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 # Col 3 | 589 # Col 3 |
590 if wc_status[0].getAttribute('copied') == 'true': | 590 if wc_status[0].getAttribute('copied') == 'true': |
591 statuses[3] = '+' | 591 statuses[3] = '+' |
592 # Col 4 | 592 # Col 4 |
593 if wc_status[0].getAttribute('switched') == 'true': | 593 if wc_status[0].getAttribute('switched') == 'true': |
594 statuses[4] = 'S' | 594 statuses[4] = 'S' |
595 # TODO(maruel): Col 5 and 6 | 595 # TODO(maruel): Col 5 and 6 |
596 item = (''.join(statuses), file) | 596 item = (''.join(statuses), file) |
597 results.append(item) | 597 results.append(item) |
598 return results | 598 return results |
OLD | NEW |