'Fetch the missing objects 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: iterator over objects, with __len__ implemented'

def fetch_objects(self, determine_wants, graph_walker, progress, get_tagged=None):

    wants = determine_wants(self.get_refs())
    if (not isinstance(wants, list)):
        raise TypeError('determine_wants()    did    not    return    a    list')
    shallows = getattr(graph_walker, 'shallow', frozenset())
    unshallows = getattr(graph_walker, 'unshallow', frozenset())
    if (wants == []):
        if (shallows or unshallows):
            return None
        return []
    haves = self.object_store.find_common_revisions(graph_walker)
    if (shallows or unshallows):
        haves = []
    def get_parents(commit):
        if (commit.id in shallows):
            return []
        return self.get_parents(commit.id, commit)
    return self.object_store.iter_shas(self.object_store.find_missing_objects(haves, wants, progress, get_tagged, get_parents=get_parents))
