| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 from_info['Repository Root'], | 176 from_info['Repository Root'], |
| 177 to_info['Repository Root']) | 177 to_info['Repository Root']) |
| 178 else: | 178 else: |
| 179 if CaptureSVNStatus(checkout_path): | 179 if CaptureSVNStatus(checkout_path): |
| 180 raise gclient_utils.Error("Can't switch the checkout to %s; UUID " | 180 raise gclient_utils.Error("Can't switch the checkout to %s; UUID " |
| 181 "don't match and there is local changes " | 181 "don't match and there is local changes " |
| 182 "in %s. Delete the directory and " | 182 "in %s. Delete the directory and " |
| 183 "try again." % (url, checkout_path)) | 183 "try again." % (url, checkout_path)) |
| 184 # Ok delete it. | 184 # Ok delete it. |
| 185 print("\n_____ switching %s to a new checkout" % self.relpath) | 185 print("\n_____ switching %s to a new checkout" % self.relpath) |
| 186 RemoveDirectory(checkout_path) | 186 gclient_utils.RemoveDirectory(checkout_path) |
| 187 # We need to checkout. | 187 # We need to checkout. |
| 188 command = ['checkout', url, checkout_path] | 188 command = ['checkout', url, checkout_path] |
| 189 if revision: | 189 if revision: |
| 190 command.extend(['--revision', str(revision)]) | 190 command.extend(['--revision', str(revision)]) |
| 191 RunSVNAndGetFileList(command, self._root_dir, file_list) | 191 RunSVNAndGetFileList(command, self._root_dir, file_list) |
| 192 return | 192 return |
| 193 | 193 |
| 194 | 194 |
| 195 # If the provided url has a revision number that matches the revision | 195 # If the provided url has a revision number that matches the revision |
| 196 # number of the existing directory, then we don't need to bother updating. | 196 # number of the existing directory, then we don't need to bother updating. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 225 file_path = os.path.join(path, file[1]) | 225 file_path = os.path.join(path, file[1]) |
| 226 print(file_path) | 226 print(file_path) |
| 227 # Unversioned file or unexpected unversioned file. | 227 # Unversioned file or unexpected unversioned file. |
| 228 if file[0][0] in ('?', '~'): | 228 if file[0][0] in ('?', '~'): |
| 229 # Remove extraneous file. Also remove unexpected unversioned | 229 # Remove extraneous file. Also remove unexpected unversioned |
| 230 # directories. svn won't touch them but we want to delete these. | 230 # directories. svn won't touch them but we want to delete these. |
| 231 file_list.append(file_path) | 231 file_list.append(file_path) |
| 232 try: | 232 try: |
| 233 os.remove(file_path) | 233 os.remove(file_path) |
| 234 except EnvironmentError: | 234 except EnvironmentError: |
| 235 RemoveDirectory(file_path) | 235 gclient_utils.RemoveDirectory(file_path) |
| 236 | 236 |
| 237 if file[0][0] != '?': | 237 if file[0][0] != '?': |
| 238 # For any other status, svn revert will work. | 238 # For any other status, svn revert will work. |
| 239 file_list.append(file_path) | 239 file_list.append(file_path) |
| 240 files_to_revert.append(file[1]) | 240 files_to_revert.append(file[1]) |
| 241 | 241 |
| 242 # Revert them all at once. | 242 # Revert them all at once. |
| 243 if files_to_revert: | 243 if files_to_revert: |
| 244 accumulated_paths = [] | 244 accumulated_paths = [] |
| 245 accumulated_length = 0 | 245 accumulated_length = 0 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 xml_props_status) | 568 xml_props_status) |
| 569 # Col 2 | 569 # Col 2 |
| 570 if wc_status[0].getAttribute('wc-locked') == 'true': | 570 if wc_status[0].getAttribute('wc-locked') == 'true': |
| 571 statuses[2] = 'L' | 571 statuses[2] = 'L' |
| 572 # Col 3 | 572 # Col 3 |
| 573 if wc_status[0].getAttribute('copied') == 'true': | 573 if wc_status[0].getAttribute('copied') == 'true': |
| 574 statuses[3] = '+' | 574 statuses[3] = '+' |
| 575 item = (''.join(statuses), file) | 575 item = (''.join(statuses), file) |
| 576 results.append(item) | 576 results.append(item) |
| 577 return results | 577 return results |
| OLD | NEW |