~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

(jam) Bug #393366,
        request the same order from fallbacks that we request from self.
        (makes annotate play nicer with stacking)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1489
1489
                                                                non_local_keys,
1490
1490
                                                                positions):
1491
1491
                generator = _VFContentMapGenerator(self, keys, non_local_keys,
1492
 
                                                   global_map)
 
1492
                                                   global_map,
 
1493
                                                   ordering=ordering)
1493
1494
                for record in generator.get_record_stream():
1494
1495
                    yield record
1495
1496
        else:
1993
1994
class _ContentMapGenerator(object):
1994
1995
    """Generate texts or expose raw deltas for a set of texts."""
1995
1996
 
 
1997
    def __init__(self, ordering='unordered'):
 
1998
        self._ordering = ordering
 
1999
 
1996
2000
    def _get_content(self, key):
1997
2001
        """Get the content object for key."""
1998
2002
        # Note that _get_content is only called when the _ContentMapGenerator
2032
2036
            # Loop over fallback repositories asking them for texts - ignore
2033
2037
            # any missing from a particular fallback.
2034
2038
            for record in source.get_record_stream(missing_keys,
2035
 
                'unordered', True):
 
2039
                self._ordering, True):
2036
2040
                if record.storage_kind == 'absent':
2037
2041
                    # Not in thie particular stream, may be in one of the
2038
2042
                    # other fallback vfs objects.
2170
2174
    """Content map generator reading from a VersionedFiles object."""
2171
2175
 
2172
2176
    def __init__(self, versioned_files, keys, nonlocal_keys=None,
2173
 
        global_map=None, raw_record_map=None):
 
2177
        global_map=None, raw_record_map=None, ordering='unordered'):
2174
2178
        """Create a _ContentMapGenerator.
2175
2179
 
2176
2180
        :param versioned_files: The versioned files that the texts are being
2184
2188
        :param raw_record_map: A unparsed raw record map to use for answering
2185
2189
            contents.
2186
2190
        """
 
2191
        _ContentMapGenerator.__init__(self, ordering=ordering)
2187
2192
        # The vf to source data from
2188
2193
        self.vf = versioned_files
2189
2194
        # The keys desired