Accept svn:mime-type as a valid svn property.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/9172003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@117133 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 13 years ago
parent cf602553bc
commit 9799a079c5

@ -1,5 +1,5 @@
# coding=utf8
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Manages a project checkout.
@ -489,7 +489,8 @@ class GitCheckoutBase(CheckoutBase):
# TODO(maruel): Read ~/.subversion/config and detect the rules that
# applies here to figure out if the property will be correctly
# handled.
if not prop[0] in ('svn:eol-style', 'svn:executable'):
if not prop[0] in (
'svn:eol-style', 'svn:executable', 'svn:mime-type'):
raise patch.UnsupportedPatchFormat(
p.filename,
'Cannot apply svn property %s to file %s.' % (

@ -1,4 +1,4 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defines class Rietveld to easily access a rietveld instance.
@ -198,7 +198,8 @@ class Rietveld(object):
match = re.match(r'^(\w+): (.+)$', action)
if not match or not rietveld_svn_props:
raise patch.UnsupportedPatchFormat(
filename, 'Failed to parse svn properties.')
filename,
'Failed to parse svn properties: %s, %s' % (action, svn_props))
if match.group(2) == 'svn:mergeinfo':
# Silently ignore the content.
@ -210,7 +211,7 @@ class Rietveld(object):
raise patch.UnsupportedPatchFormat(
filename, 'Unsupported svn property operation.')
if match.group(2) in ('svn:eol-style', 'svn:executable'):
if match.group(2) in ('svn:eol-style', 'svn:executable', 'svn:mime-type'):
# ' + foo' where foo is the new value. That's fragile.
content = rietveld_svn_props.pop(0)
match2 = re.match(r'^ \+ (.*)$', content)

@ -289,6 +289,15 @@ class RietveldTest(unittest.TestCase):
' + LF\n',
'foo'))
# http://codereview.chromium.org/api/9139006/7001
self.assertEquals(
[('svn:mime-type', 'image/png')],
rietveld.Rietveld.parse_svn_properties(
'\n'
'Added: svn:mime-type\n'
' + image/png\n',
'foo'))
def test_bad_svn_properties(self):
try:
rietveld.Rietveld.parse_svn_properties(u'\n', 'foo')

Loading…
Cancel
Save