Commit 75547c3f authored by maruel@chromium.org's avatar maruel@chromium.org

Fix rietveld when status is only one char

Update unit test accordingly.

R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100207 0039d316-1c4b-4281-b951-d872f2087c98
parent 77f47793
......@@ -160,7 +160,9 @@ class Rietveld(object):
if status[0] == 'A':
# It won't be set for empty file.
p.is_new = True
if status[1] == '+' and not (p.source_filename or p.svn_properties):
if (len(status) > 1 and
status[1] == '+' and
not (p.source_filename or p.svn_properties)):
raise patch.UnsupportedPatchFormat(
filename, 'Failed to process the svn properties')
else:
......
......@@ -97,7 +97,7 @@ class RietveldTest(unittest.TestCase):
def test_get_patch_2_files(self):
self.requests = [
('/api/123/456',
_api({'foo': _file('A '), 'file_a': _file('M ', chunk_id=790)})),
_api({'foo': _file('A'), 'file_a': _file('M', chunk_id=790)})),
('/download/issue123_456_789.diff', RAW.NEW),
('/download/issue123_456_790.diff', RAW.NEW_NOT_NULL),
]
......@@ -109,7 +109,7 @@ class RietveldTest(unittest.TestCase):
def test_get_patch_add(self):
self.requests = [
('/api/123/456', _api({'foo': _file('A ')})),
('/api/123/456', _api({'foo': _file('A')})),
('/download/issue123_456_789.diff', RAW.NEW),
]
patches = self.rietveld.get_patch(123, 456)
......
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