Ejemplo n.º 1
0
    def fetch_pack(self, path, determine_wants, graph_walker, pack_data,
                   progress=None):
        """Retrieve a pack from a git smart server.

        :param determine_wants: Callback that returns list of commits to fetch
        :param graph_walker: Object with next() and ack().
        :param pack_data: Callback called for each bit of data in the pack
        :param progress: Callback for progress reports (strings)
        """
        from dulwich.repo import Repo
        r = Repo(path)
        objects_iter = r.fetch_objects(determine_wants, graph_walker, progress)

        # Did the process short-circuit (e.g. in a stateless RPC call)? Note
        # that the client still expects a 0-object pack in most cases.
        if objects_iter is None:
            return
        write_pack_objects(ProtocolFile(None, pack_data), objects_iter)
Ejemplo n.º 2
0
    def fetch_pack(self, path, determine_wants, graph_walker, pack_data,
                   progress=None):
        """Retrieve a pack from a git smart server.

        :param determine_wants: Callback that returns list of commits to fetch
        :param graph_walker: Object with next() and ack().
        :param pack_data: Callback called for each bit of data in the pack
        :param progress: Callback for progress reports (strings)
        """
        from dulwich.repo import Repo
        r = Repo(path)
        objects_iter = r.fetch_objects(determine_wants, graph_walker, progress)

        # Did the process short-circuit (e.g. in a stateless RPC call)? Note
        # that the client still expects a 0-object pack in most cases.
        if objects_iter is None:
            return
        write_pack_objects(ProtocolFile(None, pack_data), objects_iter)