Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: gclient.py

Issue 3769002: Fix "No SCM found for url None" error that can occur after update... (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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 """Meta checkout manager supporting both Subversion and GIT. 6 """Meta checkout manager supporting both Subversion and GIT.
7 7
8 Files 8 Files
9 .gclient : Current client configuration, written by 'config' command. 9 .gclient : Current client configuration, written by 'config' command.
10 Format is a Python script defining 'solutions', a list whose 10 Format is a Python script defining 'solutions', a list whose
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 # hooks. 728 # hooks.
729 if not self._options.nohooks: 729 if not self._options.nohooks:
730 self.RunHooksRecursively(self._options) 730 self.RunHooksRecursively(self._options)
731 731
732 if command == 'update': 732 if command == 'update':
733 # Notify the user if there is an orphaned entry in their working copy. 733 # Notify the user if there is an orphaned entry in their working copy.
734 # Only delete the directory if there are no changes in it, and 734 # Only delete the directory if there are no changes in it, and
735 # delete_unversioned_trees is set to true. 735 # delete_unversioned_trees is set to true.
736 entries = [i.name for i in self.tree(False)] 736 entries = [i.name for i in self.tree(False)]
737 for entry, prev_url in self._ReadEntries().iteritems(): 737 for entry, prev_url in self._ReadEntries().iteritems():
738 if prev_url is None:
M-A Ruel 2010/10/14 01:51:30 I'll change it for "if not prev_url:"
739 # entry must have been overridden via .gclient custom_deps
740 continue
738 # Fix path separator on Windows. 741 # Fix path separator on Windows.
739 entry_fixed = entry.replace('/', os.path.sep) 742 entry_fixed = entry.replace('/', os.path.sep)
740 e_dir = os.path.join(self.root_dir(), entry_fixed) 743 e_dir = os.path.join(self.root_dir(), entry_fixed)
741 # Use entry and not entry_fixed there. 744 # Use entry and not entry_fixed there.
742 if entry not in entries and os.path.exists(e_dir): 745 if entry not in entries and os.path.exists(e_dir):
743 file_list = [] 746 file_list = []
744 scm = gclient_scm.CreateSCM(prev_url, self.root_dir(), entry_fixed) 747 scm = gclient_scm.CreateSCM(prev_url, self.root_dir(), entry_fixed)
745 scm.status(self._options, [], file_list) 748 scm.status(self._options, [], file_list)
746 modified_files = file_list != [] 749 modified_files = file_list != []
747 if not self._options.delete_unversioned_trees or modified_files: 750 if not self._options.delete_unversioned_trees or modified_files:
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 return CMDhelp(parser, argv) 1240 return CMDhelp(parser, argv)
1238 except gclient_utils.Error, e: 1241 except gclient_utils.Error, e:
1239 print >> sys.stderr, 'Error: %s' % str(e) 1242 print >> sys.stderr, 'Error: %s' % str(e)
1240 return 1 1243 return 1
1241 1244
1242 1245
1243 if '__main__' == __name__: 1246 if '__main__' == __name__:
1244 sys.exit(Main(sys.argv[1:])) 1247 sys.exit(Main(sys.argv[1:]))
1245 1248
1246 # vim: ts=2:sw=2:tw=80:et: 1249 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698