Ejemplo n.º 1
0
    def get_node_from_source(self, kind, path, action, from_path, from_rev):
        assert kind == 'file' or kind == 'dir'
        assert action == 'add' or action =='replace'

        if self._is_obsolete_tag_or_branch_copy(path, from_rev):
            self._handle_obsolete_tag_or_branch(path)
            return

        path = normpath(path)
        repo = self.source_repository
        lump = SvnLump()

        lump.set_header('Node-path', path)
        lump.set_header('Node-kind', kind)
        lump.set_header('Node-action', action)

        if kind == 'file':
            tin = repo.get_tin_for_file(from_path, from_rev)
            lump.content = tin
            lump.set_header('Text-content-length', str(tin.size))
            lump.set_header('Text-content-md5', tin.md5sum)

        lump.properties = repo.get_properties_of_path(from_path, from_rev)
        self.dump_writer.write_lump(lump)
Ejemplo n.º 2
0
    def get_node_from_source(self, kind, path, action, from_path, from_rev):
        assert kind == 'file' or kind == 'dir'
        assert action == 'add' or action == 'replace'

        if self._is_obsolete_tag_or_branch_copy(path, from_rev):
            self._handle_obsolete_tag_or_branch(path)
            return

        path = normpath(path)
        repo = self.source_repository
        lump = SvnLump()

        lump.set_header('Node-path', path)
        lump.set_header('Node-kind', kind)
        lump.set_header('Node-action', action)

        if kind == 'file':
            tin = repo.get_tin_for_file(from_path, from_rev)
            lump.content = tin
            lump.set_header('Text-content-length', str(tin.size))
            lump.set_header('Text-content-md5', tin.md5sum)

        lump.properties = repo.get_properties_of_path(from_path, from_rev)
        self.dump_writer.write_lump(lump)