OLD | NEW |
1 # Copyright 2009 Google Inc. All Rights Reserved. | 1 # Copyright 2009 Google Inc. All Rights Reserved. |
2 # | 2 # |
3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
6 # | 6 # |
7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
8 # | 8 # |
9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 os.remove(file_path) | 363 os.remove(file_path) |
364 elif os.path.isdir(file_path): | 364 elif os.path.isdir(file_path): |
365 logging.info('gclient_utils.RemoveDirectory(%s)' % file_path) | 365 logging.info('gclient_utils.RemoveDirectory(%s)' % file_path) |
366 gclient_utils.RemoveDirectory(file_path) | 366 gclient_utils.RemoveDirectory(file_path) |
367 else: | 367 else: |
368 logging.error('no idea what is %s.\nYou just found a bug in gclient' | 368 logging.error('no idea what is %s.\nYou just found a bug in gclient' |
369 ', please ping maruel@chromium.org ASAP!' % file_path) | 369 ', please ping maruel@chromium.org ASAP!' % file_path) |
370 except EnvironmentError: | 370 except EnvironmentError: |
371 logging.error('Failed to remove %s.' % file_path) | 371 logging.error('Failed to remove %s.' % file_path) |
372 | 372 |
373 # svn revert is so broken we don't even use it. Using | 373 try: |
374 # "svn up --revision BASE" achieve the same effect. | 374 # svn revert is so broken we don't even use it. Using |
375 RunSVNAndGetFileList(options, ['update', '--revision', 'BASE'], path, | 375 # "svn up --revision BASE" achieve the same effect. |
376 file_list) | 376 RunSVNAndGetFileList(options, ['update', '--revision', 'BASE'], path, |
| 377 file_list) |
| 378 except OSError, e: |
| 379 # Maybe the directory disapeared meanwhile. We don't want it to throw an |
| 380 # exception. |
| 381 logging.error('Failed to update:\n%s' % str(e)) |
377 | 382 |
378 def runhooks(self, options, args, file_list): | 383 def runhooks(self, options, args, file_list): |
379 self.status(options, args, file_list) | 384 self.status(options, args, file_list) |
380 | 385 |
381 def status(self, options, args, file_list): | 386 def status(self, options, args, file_list): |
382 """Display status information.""" | 387 """Display status information.""" |
383 path = os.path.join(self._root_dir, self.relpath) | 388 path = os.path.join(self._root_dir, self.relpath) |
384 command = ['status'] | 389 command = ['status'] |
385 command.extend(args) | 390 command.extend(args) |
386 if not os.path.isdir(path): | 391 if not os.path.isdir(path): |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 # Col 3 | 698 # Col 3 |
694 if wc_status[0].getAttribute('copied') == 'true': | 699 if wc_status[0].getAttribute('copied') == 'true': |
695 statuses[3] = '+' | 700 statuses[3] = '+' |
696 # Col 4 | 701 # Col 4 |
697 if wc_status[0].getAttribute('switched') == 'true': | 702 if wc_status[0].getAttribute('switched') == 'true': |
698 statuses[4] = 'S' | 703 statuses[4] = 'S' |
699 # TODO(maruel): Col 5 and 6 | 704 # TODO(maruel): Col 5 and 6 |
700 item = (''.join(statuses), file) | 705 item = (''.join(statuses), file) |
701 results.append(item) | 706 results.append(item) |
702 return results | 707 return results |
OLD | NEW |