def fetch_pack_data(self, determine_wants, graph_walker, progress, get_tagged=None, depth=None): """Fetch the pack data required for a set of revisions. :param determine_wants: Function that takes a dictionary with heads and returns the list of heads to fetch. :param graph_walker: Object that can iterate over the list of revisions to fetch and has an "ack" method that will be called to acknowledge that a revision is present. :param progress: Simple progress function that will be called with updated progress strings. :param get_tagged: Function that returns a dict of pointed-to sha -> tag sha for including tags. :param depth: Shallow fetch depth :return: count and iterator over pack data """ # TODO(jelmer): Fetch pack data directly, don't create objects first. objects = self.fetch_objects(determine_wants, graph_walker, progress, get_tagged, depth=depth) return pack_objects_to_data(objects)
def add_objects(self, objects): """Add a set of objects to this object store. :param objects: Iterable over (object, path) tuples, should support __len__. :return: Pack object of the objects written. """ return self.add_pack_data(*pack_objects_to_data(objects))
def add_objects(self, objects): """Add a set of objects to this object store. :param objects: Iterable over (object, path) tuples, should support __len__. :return: Pack object of the objects written. """ return self.add_pack_data(*pack_objects_to_data(objects))
def add_objects(self, objects, progress=None): """Add a set of objects to this object store. Args: objects: Iterable over (object, path) tuples, should support __len__. Returns: Pack object of the objects written. """ return self.add_pack_data(*pack_objects_to_data(objects), progress=progress)
def generate_pack_data(self, have, want, progress=None, ofs_delta=True): """Generate pack data objects for a set of wants/haves. :param have: List of SHA1s of objects that should not be sent :param want: List of SHA1s of objects that should be sent :param ofs_delta: Whether OFS deltas can be included :param progress: Optional progress reporting method """ # TODO(user): More efficient implementation return pack_objects_to_data( self.generate_pack_contents(have, want, progress))
def generate_pack_data(self, have, want, progress=None, ofs_delta=True): """Generate pack data objects for a set of wants/haves. :param have: List of SHA1s of objects that should not be sent :param want: List of SHA1s of objects that should be sent :param ofs_delta: Whether OFS deltas can be included :param progress: Optional progress reporting method """ # TODO(jelmer): More efficient implementation return pack_objects_to_data( self.generate_pack_contents(have, want, progress))
def generate_lossy_pack_data(self, have, want, progress=None, get_tagged=None, ofs_delta=False): return pack_objects_to_data( self.generate_pack_contents(have, want, progress, get_tagged, lossy=True))
def generate_pack_data(self, have, want, shallow=None, progress=None, ofs_delta=True): """Generate pack data objects for a set of wants/haves. Args: have: List of SHA1s of objects that should not be sent want: List of SHA1s of objects that should be sent shallow: Set of shallow commit SHA1s to skip ofs_delta: Whether OFS deltas can be included progress: Optional progress reporting method """ # TODO(jelmer): More efficient implementation return pack_objects_to_data( self.generate_pack_contents(have, want, shallow, progress))
def fetch_pack_data(self, determine_wants, graph_walker, progress, get_tagged=None): """Fetch the pack data required for a set of revisions. :param determine_wants: Function that takes a dictionary with heads and returns the list of heads to fetch. :param graph_walker: Object that can iterate over the list of revisions to fetch and has an "ack" method that will be called to acknowledge that a revision is present. :param progress: Simple progress function that will be called with updated progress strings. :param get_tagged: Function that returns a dict of pointed-to sha -> tag sha for including tags. :return: count and iterator over pack data """ # TODO(jelmer): Fetch pack data directly, don't create objects first. objects = self.fetch_objects(determine_wants, graph_walker, progress, get_tagged) return pack_objects_to_data(objects)
def generate_pack_data(have, want, ofs_delta=False): return pack_objects_to_data([ (commit, None), (tree, b''), ])
def generate_pack_data(have, want, ofs_delta=False): return pack_objects_to_data([(commit, None), (tree, b''), ])
def generate_pack_data(*args, **kwargs): return pack_objects_to_data([])
def generate_pack_data(have, want, ofs_delta=False): return pack_objects_to_data([])