|
|
@ -97,7 +97,6 @@ class FilePatchDiff(FilePatchBase):
|
|
|
|
self.patchlevel = 0
|
|
|
|
self.patchlevel = 0
|
|
|
|
if self.is_git_diff:
|
|
|
|
if self.is_git_diff:
|
|
|
|
self._verify_git_header()
|
|
|
|
self._verify_git_header()
|
|
|
|
assert not svn_properties
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self._verify_svn_header()
|
|
|
|
self._verify_svn_header()
|
|
|
|
|
|
|
|
|
|
|
@ -197,6 +196,7 @@ class FilePatchDiff(FilePatchBase):
|
|
|
|
self._fail('Unexpected git diff; couldn\'t find git header.')
|
|
|
|
self._fail('Unexpected git diff; couldn\'t find git header.')
|
|
|
|
|
|
|
|
|
|
|
|
# Handle these:
|
|
|
|
# Handle these:
|
|
|
|
|
|
|
|
# new file mode \d{6}
|
|
|
|
# rename from <>
|
|
|
|
# rename from <>
|
|
|
|
# rename to <>
|
|
|
|
# rename to <>
|
|
|
|
# copy from <>
|
|
|
|
# copy from <>
|
|
|
@ -204,18 +204,26 @@ class FilePatchDiff(FilePatchBase):
|
|
|
|
while lines:
|
|
|
|
while lines:
|
|
|
|
if lines[0].startswith('--- '):
|
|
|
|
if lines[0].startswith('--- '):
|
|
|
|
break
|
|
|
|
break
|
|
|
|
match = re.match(r'^(rename|copy) from (.+)$', lines.pop(0))
|
|
|
|
line = lines.pop(0)
|
|
|
|
if not match:
|
|
|
|
match = re.match(r'^(rename|copy) from (.+)$', line)
|
|
|
|
|
|
|
|
if match:
|
|
|
|
|
|
|
|
if old != match.group(2):
|
|
|
|
|
|
|
|
self._fail('Unexpected git diff input name for %s.' % match.group(1))
|
|
|
|
|
|
|
|
if not lines:
|
|
|
|
|
|
|
|
self._fail('Missing git diff output name for %s.' % match.group(1))
|
|
|
|
|
|
|
|
match = re.match(r'^(rename|copy) to (.+)$', lines.pop(0))
|
|
|
|
|
|
|
|
if not match:
|
|
|
|
|
|
|
|
self._fail('Missing git diff output name for %s.' % match.group(1))
|
|
|
|
|
|
|
|
if new != match.group(2):
|
|
|
|
|
|
|
|
self._fail('Unexpected git diff output name for %s.' % match.group(1))
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
if old != match.group(2):
|
|
|
|
|
|
|
|
self._fail('Unexpected git diff input name for %s.' % match.group(1))
|
|
|
|
match = re.match(r'^new file mode (\d{6})$', line)
|
|
|
|
if not lines:
|
|
|
|
if match:
|
|
|
|
self._fail('Missing git diff output name for %s.' % match.group(1))
|
|
|
|
mode = match.group(1)
|
|
|
|
match = re.match(r'^(rename|copy) to (.+)$', lines.pop(0))
|
|
|
|
# Only look at owner ACL for executable.
|
|
|
|
if not match:
|
|
|
|
if bool(int(mode[4]) & 4):
|
|
|
|
self._fail('Missing git diff output name for %s.' % match.group(1))
|
|
|
|
self.svn_properties.append(('svn:executable', '*'))
|
|
|
|
if new != match.group(2):
|
|
|
|
|
|
|
|
self._fail('Unexpected git diff output name for %s.' % match.group(1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Handle ---/+++
|
|
|
|
# Handle ---/+++
|
|
|
|
while lines:
|
|
|
|
while lines:
|
|
|
|