~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Parth Malwankar
  • Date: 2010-05-05 14:02:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5213.
  • Revision ID: parth.malwankar@gmail.com-20100505140253-fqdiwllq4o4htbsg
added comment to init/init-repo pass tests for lacking whoami.

Show diffs side-by-side

added added

removed removed

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