def handle_renames(self, diff_content):

        # svn diff against a repository URL on two revisions appears to
        # handle moved files properly, so only adjust the diff file names
        # if they were created using a working copy.
        if self.options.repository_url:
            return diff_content

        result = []

        from_line = to_line = None
        for line in diff_content:
            if self.DIFF_ORIG_FILE_LINE_RE.match(line):
                from_line = line
                continue

            if self.DIFF_NEW_FILE_LINE_RE.match(line):
                to_line = line
                continue

            # This is where we decide how mangle the previous '--- '
            if from_line and to_line:
                # If the file is marked completely removed, bail out with
                # original diff. The reason for this is that 'svn diff
                # --notice-ancestry' generates two diffs for a replaced file:
                # one as a complete deletion, and one as a new addition.
                # If it was replaced with history, though, we need to preserve
                # the file name in the "deletion" part - or the patch won't
                # apply.
                if self.DIFF_COMPLETE_REMOVAL_RE.match(line):
                    result.append(from_line)
                    result.append(to_line)
                else:
                    to_file, _ = self.parse_filename_header(to_line[4:])
                    copied_from = self.find_copyfrom(to_file)
                    if copied_from is not None:
                        result.append(from_line.replace(to_file, copied_from))
                    else:
                        result.append(from_line)  # As is, no copy performed
                    result.append(to_line)
                from_line = to_line = None

            # We only mangle '---' lines. All others get added straight to
            # the output.
            result.append(line)

        return result
The output of svn diff is incorrect when the file in question came
dataset/ETHPy150Open reviewboard/rbtools/rbtools/clients/svn.py/SVNClient.handle_renames