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

Side by Side Diff: gclient.py

Issue 159788: Fix output on Windows when gclient warns the user about a stale directory. (Closed)
Patch Set: Created 11 years, 4 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/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright 2008 Google Inc. All Rights Reserved. 3 # Copyright 2008 Google Inc. All Rights Reserved.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 1371
1372 is_using_git = IsUsingGit(self._root_dir, entries.keys()) 1372 is_using_git = IsUsingGit(self._root_dir, entries.keys())
1373 self._RunHooks(command, file_list, is_using_git) 1373 self._RunHooks(command, file_list, is_using_git)
1374 1374
1375 if command == 'update': 1375 if command == 'update':
1376 # Notify the user if there is an orphaned entry in their working copy. 1376 # Notify the user if there is an orphaned entry in their working copy.
1377 # Only delete the directory if there are no changes in it, and 1377 # Only delete the directory if there are no changes in it, and
1378 # delete_unversioned_trees is set to true. 1378 # delete_unversioned_trees is set to true.
1379 prev_entries = self._ReadEntries() 1379 prev_entries = self._ReadEntries()
1380 for entry in prev_entries: 1380 for entry in prev_entries:
1381 e_dir = os.path.join(self._root_dir, entry) 1381 # Fix path separator on Windows.
1382 entry_fixed = entry.replace('/', os.path.sep)
1383 e_dir = os.path.join(self._root_dir, entry_fixed)
1384 # Use entry and not entry_fixed there.
1382 if entry not in entries and os.path.exists(e_dir): 1385 if entry not in entries and os.path.exists(e_dir):
1383 if not self._options.delete_unversioned_trees or \ 1386 if not self._options.delete_unversioned_trees or \
1384 CaptureSVNStatus(e_dir): 1387 CaptureSVNStatus(e_dir):
1385 # There are modified files in this entry 1388 # There are modified files in this entry. Keep warning until
1386 entries[entry] = None # Keep warning until removed. 1389 # removed.
1387 print("\nWARNING: \"%s\" is no longer part of this client. " 1390 entries[entry] = None
1388 "It is recommended that you manually remove it.\n") % entry 1391 print(("\nWARNING: \"%s\" is no longer part of this client. "
1392 "It is recommended that you manually remove it.\n") %
1393 entry_fixed)
1389 else: 1394 else:
1390 # Delete the entry 1395 # Delete the entry
1391 print("\n________ deleting \'%s\' " + 1396 print("\n________ deleting \'%s\' " +
1392 "in \'%s\'") % (entry, self._root_dir) 1397 "in \'%s\'") % (entry_fixed, self._root_dir)
1393 RemoveDirectory(e_dir) 1398 RemoveDirectory(e_dir)
1394 # record the current list of entries for next time 1399 # record the current list of entries for next time
1395 self._SaveEntries(entries) 1400 self._SaveEntries(entries)
1396 1401
1397 def PrintRevInfo(self): 1402 def PrintRevInfo(self):
1398 """Output revision info mapping for the client and its dependencies. This 1403 """Output revision info mapping for the client and its dependencies. This
1399 allows the capture of a overall "revision" for the source tree that can 1404 allows the capture of a overall "revision" for the source tree that can
1400 be used to reproduce the same tree in the future. The actual output 1405 be used to reproduce the same tree in the future. The actual output
1401 contains enough information (source paths, svn server urls and revisions) 1406 contains enough information (source paths, svn server urls and revisions)
1402 that it can be used either to generate external svn commands (without 1407 that it can be used either to generate external svn commands (without
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 1795
1791 if "__main__" == __name__: 1796 if "__main__" == __name__:
1792 try: 1797 try:
1793 result = Main(sys.argv) 1798 result = Main(sys.argv)
1794 except Error, e: 1799 except Error, e:
1795 print >> sys.stderr, "Error: %s" % str(e) 1800 print >> sys.stderr, "Error: %s" % str(e)
1796 result = 1 1801 result = 1
1797 sys.exit(result) 1802 sys.exit(result)
1798 1803
1799 # vim: ts=2:sw=2:tw=80:et: 1804 # 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