~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-08-16 06:46:17 UTC
  • mfrom: (5375.1.6 chk-canonicalizer-613698)
  • Revision ID: pqm@pqm.ubuntu.com-20100816064617-wizstoapjbffkj05
(spiv) Add hidden option 'bzr reconcile --canonicalize-chks' to repair repos
 affected by bug 522637. (Andrew Bennetts)

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
 
 
188
185
    def __init__(self, source):
189
186
        """Constructor.
190
187
 
246
243
        # yet, and are unlikely to in non-rich-root environments anyway.
247
244
        root_id_order.sort(key=operator.itemgetter(0))
248
245
        # 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)
 
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)
251
250
        new_roots_stream = _new_root_data_stream(
252
251
            root_id_order, rev_id_to_root_id, parent_map, self.source, graph)
253
252
        return [('texts', new_roots_stream)]
254
253
 
255
254
 
 
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
 
256
260
def _new_root_data_stream(
257
261
    root_keys_to_create, rev_id_to_root_id_map, parent_map, repo, graph=None):
258
262
    """Generate a texts substream of synthesised root entries.