| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = int(from_info_live['Revision']) | 166 revision = int(from_info_live['Revision']) |
| 167 rev_str = ' at %d' % revision | 167 rev_str = ' at %d' % 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'): |
| 172 # The url is invalid or the server is not accessible, it's safer to bail |
| 173 # out right now. |
| 174 raise gclient_utils.Error('This url is unreachable: %s' % url) |
| 171 can_switch = ((from_info['Repository Root'] != to_info['Repository Root']) | 175 can_switch = ((from_info['Repository Root'] != to_info['Repository Root']) |
| 172 and (from_info['UUID'] == to_info['UUID'])) | 176 and (from_info['UUID'] == to_info['UUID'])) |
| 173 if can_switch: | 177 if can_switch: |
| 174 print("\n_____ relocating %s to a new checkout" % self.relpath) | 178 print("\n_____ relocating %s to a new checkout" % self.relpath) |
| 175 # We have different roots, so check if we can switch --relocate. | 179 # We have different roots, so check if we can switch --relocate. |
| 176 # Subversion only permits this if the repository UUIDs match. | 180 # Subversion only permits this if the repository UUIDs match. |
| 177 # Perform the switch --relocate, then rewrite the from_url | 181 # Perform the switch --relocate, then rewrite the from_url |
| 178 # to reflect where we "are now." (This is the same way that | 182 # to reflect where we "are now." (This is the same way that |
| 179 # Subversion itself handles the metadata when switch --relocate | 183 # Subversion itself handles the metadata when switch --relocate |
| 180 # is used.) This makes the checks below for whether we | 184 # is used.) This makes the checks below for whether we |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 # Col 3 | 589 # Col 3 |
| 586 if wc_status[0].getAttribute('copied') == 'true': | 590 if wc_status[0].getAttribute('copied') == 'true': |
| 587 statuses[3] = '+' | 591 statuses[3] = '+' |
| 588 # Col 4 | 592 # Col 4 |
| 589 if wc_status[0].getAttribute('switched') == 'true': | 593 if wc_status[0].getAttribute('switched') == 'true': |
| 590 statuses[4] = 'S' | 594 statuses[4] = 'S' |
| 591 # TODO(maruel): Col 5 and 6 | 595 # TODO(maruel): Col 5 and 6 |
| 592 item = (''.join(statuses), file) | 596 item = (''.join(statuses), file) |
| 593 results.append(item) | 597 results.append(item) |
| 594 return results | 598 return results |
| OLD | NEW |