OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Gclient-specific SCM-specific operations.""" | 5 """Gclient-specific SCM-specific operations.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 import re | 10 import re |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 return | 772 return |
773 | 773 |
774 # Get the existing scm url and the revision number of the current checkout. | 774 # Get the existing scm url and the revision number of the current checkout. |
775 try: | 775 try: |
776 from_info = scm.SVN.CaptureInfo(os.path.join(self.checkout_path, '.')) | 776 from_info = scm.SVN.CaptureInfo(os.path.join(self.checkout_path, '.')) |
777 except (gclient_utils.Error, subprocess2.CalledProcessError): | 777 except (gclient_utils.Error, subprocess2.CalledProcessError): |
778 raise gclient_utils.Error( | 778 raise gclient_utils.Error( |
779 ('Can\'t update/checkout %s if an unversioned directory is present. ' | 779 ('Can\'t update/checkout %s if an unversioned directory is present. ' |
780 'Delete the directory and try again.') % self.checkout_path) | 780 'Delete the directory and try again.') % self.checkout_path) |
781 | 781 |
| 782 if 'URL' not in from_info: |
| 783 raise gclient_utils.Error( |
| 784 ('gclient is confused. Couldn\'t get the url for %s.\n' |
| 785 'Try using @unmanaged.\n%s') % ( |
| 786 self.checkout_path, from_info)) |
| 787 |
782 # Look for locked directories. | 788 # Look for locked directories. |
783 dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.')) | 789 dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.')) |
784 if any(d[0][2] == 'L' for d in dir_info): | 790 if any(d[0][2] == 'L' for d in dir_info): |
785 try: | 791 try: |
786 self._Run(['cleanup', self.checkout_path], options) | 792 self._Run(['cleanup', self.checkout_path], options) |
787 except subprocess2.CalledProcessError, e: | 793 except subprocess2.CalledProcessError, e: |
788 # Get the status again, svn cleanup may have cleaned up at least | 794 # Get the status again, svn cleanup may have cleaned up at least |
789 # something. | 795 # something. |
790 dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.')) | 796 dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.')) |
791 | 797 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 | 978 |
973 This method returns a new list to be used as a command.""" | 979 This method returns a new list to be used as a command.""" |
974 new_command = command[:] | 980 new_command = command[:] |
975 if revision: | 981 if revision: |
976 new_command.extend(['--revision', str(revision).strip()]) | 982 new_command.extend(['--revision', str(revision).strip()]) |
977 # --force was added to 'svn update' in svn 1.5. | 983 # --force was added to 'svn update' in svn 1.5. |
978 if ((options.force or options.manually_grab_svn_rev) and | 984 if ((options.force or options.manually_grab_svn_rev) and |
979 scm.SVN.AssertVersion("1.5")[0]): | 985 scm.SVN.AssertVersion("1.5")[0]): |
980 new_command.append('--force') | 986 new_command.append('--force') |
981 return new_command | 987 return new_command |
OLD | NEW |