OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """SCM-specific utility classes.""" | 5 """SCM-specific utility classes.""" |
6 | 6 |
7 import cStringIO | 7 import cStringIO |
8 import glob | 8 import glob |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 always=verbose, | 464 always=verbose, |
465 filter_fn=CaptureMatchingLines, | 465 filter_fn=CaptureMatchingLines, |
466 stdout=stdout) | 466 stdout=stdout) |
467 except subprocess2.CalledProcessError: | 467 except subprocess2.CalledProcessError: |
468 def IsKnownFailure(): | 468 def IsKnownFailure(): |
469 for x in failure: | 469 for x in failure: |
470 if (x.startswith('svn: OPTIONS of') or | 470 if (x.startswith('svn: OPTIONS of') or |
471 x.startswith('svn: PROPFIND of') or | 471 x.startswith('svn: PROPFIND of') or |
472 x.startswith('svn: REPORT of') or | 472 x.startswith('svn: REPORT of') or |
473 x.startswith('svn: Unknown hostname') or | 473 x.startswith('svn: Unknown hostname') or |
474 x.startswith('svn: Server sent unexpected return value')): | 474 x.startswith('svn: Server sent unexpected return value') or |
| 475 x.startswith('svn: Can\'t connect to host')): |
475 return True | 476 return True |
476 return False | 477 return False |
477 | 478 |
478 # Subversion client is really misbehaving with Google Code. | 479 # Subversion client is really misbehaving with Google Code. |
479 if args[0] == 'checkout': | 480 if args[0] == 'checkout': |
480 # Ensure at least one file was checked out, otherwise *delete* the | 481 # Ensure at least one file was checked out, otherwise *delete* the |
481 # directory. | 482 # directory. |
482 if len(file_list) == previous_list_len: | 483 if len(file_list) == previous_list_len: |
483 if not IsKnownFailure(): | 484 if not IsKnownFailure(): |
484 # No known svn error was found, bail out. | 485 # No known svn error was found, bail out. |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 if (file_status[0][0] in ('D', 'A', '!') or | 984 if (file_status[0][0] in ('D', 'A', '!') or |
984 not file_status[0][1:].isspace()): | 985 not file_status[0][1:].isspace()): |
985 # Added, deleted file requires manual intervention and require calling | 986 # Added, deleted file requires manual intervention and require calling |
986 # revert, like for properties. | 987 # revert, like for properties. |
987 try: | 988 try: |
988 SVN.Capture(['revert', file_status[1]], cwd=repo_root) | 989 SVN.Capture(['revert', file_status[1]], cwd=repo_root) |
989 except subprocess2.CalledProcessError: | 990 except subprocess2.CalledProcessError: |
990 if not os.path.exists(file_path): | 991 if not os.path.exists(file_path): |
991 continue | 992 continue |
992 raise | 993 raise |
OLD | NEW |