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

Side by Side Diff: gclient.py

Issue 12764004: Don't delete trees that have an exact match in entries either (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 9 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
« 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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 entry_fixed = entry.replace('/', os.path.sep) 1129 entry_fixed = entry.replace('/', os.path.sep)
1130 e_dir = os.path.join(self.root_dir, entry_fixed) 1130 e_dir = os.path.join(self.root_dir, entry_fixed)
1131 1131
1132 def _IsParentOfAny(parent, path_list): 1132 def _IsParentOfAny(parent, path_list):
1133 parent_plus_slash = parent + '/' 1133 parent_plus_slash = parent + '/'
1134 return any( 1134 return any(
1135 path[:len(parent_plus_slash)] == parent_plus_slash 1135 path[:len(parent_plus_slash)] == parent_plus_slash
1136 for path in path_list) 1136 for path in path_list)
1137 1137
1138 # Use entry and not entry_fixed there. 1138 # Use entry and not entry_fixed there.
1139 if ((not any(path.startswith(entry + '/') for path in entries)) and 1139 if (entry not in entries and
1140 (not any(path.startswith(entry + '/') for path in entries)) and
1140 os.path.exists(e_dir)): 1141 os.path.exists(e_dir)):
1141 file_list = [] 1142 file_list = []
1142 scm = gclient_scm.CreateSCM(prev_url, self.root_dir, entry_fixed) 1143 scm = gclient_scm.CreateSCM(prev_url, self.root_dir, entry_fixed)
1143 scm.status(self._options, [], file_list) 1144 scm.status(self._options, [], file_list)
1144 modified_files = file_list != [] 1145 modified_files = file_list != []
1145 if (not self._options.delete_unversioned_trees or 1146 if (not self._options.delete_unversioned_trees or
1146 (modified_files and not self._options.force)): 1147 (modified_files and not self._options.force)):
1147 # There are modified files in this entry. Keep warning until 1148 # There are modified files in this entry. Keep warning until
1148 # removed. 1149 # removed.
1149 print(('\nWARNING: \'%s\' is no longer part of this client. ' 1150 print(('\nWARNING: \'%s\' is no longer part of this client. '
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1767 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1767 print >> sys.stderr, 'Error: %s' % str(e) 1768 print >> sys.stderr, 'Error: %s' % str(e)
1768 return 1 1769 return 1
1769 1770
1770 1771
1771 if '__main__' == __name__: 1772 if '__main__' == __name__:
1772 fix_encoding.fix_encoding() 1773 fix_encoding.fix_encoding()
1773 sys.exit(Main(sys.argv[1:])) 1774 sys.exit(Main(sys.argv[1:]))
1774 1775
1775 # vim: ts=2:sw=2:tw=80:et: 1776 # 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