OLD | NEW |
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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 self._RunHooks(command, file_list, is_using_git) | 1347 self._RunHooks(command, file_list, is_using_git) |
1348 | 1348 |
1349 if command == 'update': | 1349 if command == 'update': |
1350 # Notify the user if there is an orphaned entry in their working copy. | 1350 # Notify the user if there is an orphaned entry in their working copy. |
1351 # Only delete the directory if there are no changes in it, and | 1351 # Only delete the directory if there are no changes in it, and |
1352 # delete_unversioned_trees is set to true. | 1352 # delete_unversioned_trees is set to true. |
1353 prev_entries = self._ReadEntries() | 1353 prev_entries = self._ReadEntries() |
1354 for entry in prev_entries: | 1354 for entry in prev_entries: |
1355 e_dir = os.path.join(self._root_dir, entry) | 1355 e_dir = os.path.join(self._root_dir, entry) |
1356 if entry not in entries and os.path.exists(e_dir): | 1356 if entry not in entries and os.path.exists(e_dir): |
1357 if not options.delete_unversioned_trees or CaptureSVNStatus(e_dir): | 1357 if not self._options.delete_unversioned_trees or \ |
| 1358 CaptureSVNStatus(e_dir): |
1358 # There are modified files in this entry | 1359 # There are modified files in this entry |
1359 entries[entry] = None # Keep warning until removed. | 1360 entries[entry] = None # Keep warning until removed. |
1360 print("\nWARNING: \"%s\" is no longer part of this client. " | 1361 print("\nWARNING: \"%s\" is no longer part of this client. " |
1361 "It is recommended that you manually remove it.\n") % entry | 1362 "It is recommended that you manually remove it.\n") % entry |
1362 else: | 1363 else: |
1363 # Delete the entry | 1364 # Delete the entry |
1364 print("\n________ deleting \'%s\' " + | 1365 print("\n________ deleting \'%s\' " + |
1365 "in \'%s\'") % (entry, self._root_dir) | 1366 "in \'%s\'") % (entry, self._root_dir) |
1366 RemoveDirectory(e_dir) | 1367 RemoveDirectory(e_dir) |
1367 # record the current list of entries for next time | 1368 # record the current list of entries for next time |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 | 1741 |
1741 if "__main__" == __name__: | 1742 if "__main__" == __name__: |
1742 try: | 1743 try: |
1743 result = Main(sys.argv) | 1744 result = Main(sys.argv) |
1744 except Error, e: | 1745 except Error, e: |
1745 print >> sys.stderr, "Error: %s" % str(e) | 1746 print >> sys.stderr, "Error: %s" % str(e) |
1746 result = 1 | 1747 result = 1 |
1747 sys.exit(result) | 1748 sys.exit(result) |
1748 | 1749 |
1749 # vim: ts=2:sw=2:tw=80:et: | 1750 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |