OLD | NEW |
1 # coding=utf8 | 1 # coding=utf8 |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 """Manages a project checkout. | 5 """Manages a project checkout. |
6 | 6 |
7 Includes support for svn, git-svn and git. | 7 Includes support for svn, git-svn and git. |
8 """ | 8 """ |
9 | 9 |
10 from __future__ import with_statement | 10 from __future__ import with_statement |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 # No need to do anything special with p.is_new or if not | 482 # No need to do anything special with p.is_new or if not |
483 # p.diff_hunks. git apply manages all that already. | 483 # p.diff_hunks. git apply manages all that already. |
484 stdout += self._check_output_git( | 484 stdout += self._check_output_git( |
485 ['apply', '--index', '-p%s' % p.patchlevel], stdin=p.get(True)) | 485 ['apply', '--index', '-p%s' % p.patchlevel], stdin=p.get(True)) |
486 for prop in p.svn_properties: | 486 for prop in p.svn_properties: |
487 # Ignore some known auto-props flags through .subversion/config, | 487 # Ignore some known auto-props flags through .subversion/config, |
488 # bails out on the other ones. | 488 # bails out on the other ones. |
489 # TODO(maruel): Read ~/.subversion/config and detect the rules that | 489 # TODO(maruel): Read ~/.subversion/config and detect the rules that |
490 # applies here to figure out if the property will be correctly | 490 # applies here to figure out if the property will be correctly |
491 # handled. | 491 # handled. |
492 if not prop[0] in ('svn:eol-style', 'svn:executable'): | 492 if not prop[0] in ( |
| 493 'svn:eol-style', 'svn:executable', 'svn:mime-type'): |
493 raise patch.UnsupportedPatchFormat( | 494 raise patch.UnsupportedPatchFormat( |
494 p.filename, | 495 p.filename, |
495 'Cannot apply svn property %s to file %s.' % ( | 496 'Cannot apply svn property %s to file %s.' % ( |
496 prop[0], p.filename)) | 497 prop[0], p.filename)) |
497 for post in post_processors: | 498 for post in post_processors: |
498 post(self, p) | 499 post(self, p) |
499 except OSError, e: | 500 except OSError, e: |
500 raise PatchApplicationFailed(p.filename, '%s%s' % (stdout, e)) | 501 raise PatchApplicationFailed(p.filename, '%s%s' % (stdout, e)) |
501 except subprocess.CalledProcessError, e: | 502 except subprocess.CalledProcessError, e: |
502 raise PatchApplicationFailed( | 503 raise PatchApplicationFailed( |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 user, message)) | 748 user, message)) |
748 return 'FAKE' | 749 return 'FAKE' |
749 | 750 |
750 @property | 751 @property |
751 def project_name(self): | 752 def project_name(self): |
752 return self.checkout.project_name | 753 return self.checkout.project_name |
753 | 754 |
754 @property | 755 @property |
755 def project_path(self): | 756 def project_path(self): |
756 return self.checkout.project_path | 757 return self.checkout.project_path |
OLD | NEW |