Commit e2335ae8 authored by maruel@chromium.org's avatar maruel@chromium.org

Fix support when 2 properties are modified.

Add regression test.

R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100209 0039d316-1c4b-4281-b951-d872f2087c98
parent 75547c3f
...@@ -187,14 +187,15 @@ class Rietveld(object): ...@@ -187,14 +187,15 @@ class Rietveld(object):
# \n # \n
# Added: svn:ignore\n # Added: svn:ignore\n
# + LF\n # + LF\n
while rietveld_svn_props:
spacer = rietveld_svn_props.pop(0)
if spacer or not rietveld_svn_props:
# svn diff always put a spacer between the unified diff and property
# diff
raise patch.UnsupportedPatchFormat(
filename, 'Failed to parse svn properties.')
spacer = rietveld_svn_props.pop(0)
if spacer or not rietveld_svn_props:
# svn diff always put a spacer between the unified diff and property
# diff
raise patch.UnsupportedPatchFormat(
filename, 'Failed to parse svn properties.')
while rietveld_svn_props:
# Something like 'Added: svn:eol-style'. Note the action is localized. # Something like 'Added: svn:eol-style'. Note the action is localized.
# *sigh*. # *sigh*.
action = rietveld_svn_props.pop(0) action = rietveld_svn_props.pop(0)
......
...@@ -258,6 +258,19 @@ class RietveldTest(unittest.TestCase): ...@@ -258,6 +258,19 @@ class RietveldTest(unittest.TestCase):
[], [],
rietveld.Rietveld.parse_svn_properties(u'', 'foo')) rietveld.Rietveld.parse_svn_properties(u'', 'foo'))
# http://codereview.chromium.org/api/7834045/15001
self.assertEquals(
[('svn:executable', '*'), ('svn:eol-style', 'LF')],
rietveld.Rietveld.parse_svn_properties(
'\n'
'Added: svn:executable\n'
' + *\n'
'Added: svn:eol-style\n'
' + LF\n',
'foo'))
def test_bad_svn_properties(self):
try: try:
rietveld.Rietveld.parse_svn_properties(u'\n', 'foo') rietveld.Rietveld.parse_svn_properties(u'\n', 'foo')
self.fail() self.fail()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment