~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: John Arbash Meinel
  • Date: 2010-09-25 20:08:01 UTC
  • mfrom: (5444 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5445.
  • Revision ID: john@arbash-meinel.com-20100925200801-7uf0ux3uwxo9i3x0
Merge bzr.dev 5444 to resolve some small text conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
    This is for use by fetchers and converters.
183
183
    """
184
184
 
 
185
    # This is a class variable so that the test suite can override it.
 
186
    known_graph_threshold = 100
 
187
 
185
188
    def __init__(self, source):
186
189
        """Constructor.
187
190
 
243
246
        # yet, and are unlikely to in non-rich-root environments anyway.
244
247
        root_id_order.sort(key=operator.itemgetter(0))
245
248
        # Create a record stream containing the roots to create.
246
 
        if len(revs) > 100:
247
 
            # XXX: not covered by tests, should have a flag to always run
248
 
            # this. -- mbp 20100129
249
 
            graph = self.source_repo.get_known_graph_ancestry(revs)
 
249
        if len(revs) > self.known_graph_threshold:
 
250
            graph = self.source.get_known_graph_ancestry(revs)
250
251
        new_roots_stream = _new_root_data_stream(
251
252
            root_id_order, rev_id_to_root_id, parent_map, self.source, graph)
252
253
        return [('texts', new_roots_stream)]
253
254
 
254
255
 
255
 
def _get_rich_root_heads_graph(source_repo, revision_ids):
256
 
    """Get a Graph object suitable for asking heads() for new rich roots."""
257
 
    return 
258
 
 
259
 
 
260
256
def _new_root_data_stream(
261
257
    root_keys_to_create, rev_id_to_root_id_map, parent_map, repo, graph=None):
262
258
    """Generate a texts substream of synthesised root entries.