/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-01-15 06:15:54 UTC
  • mfrom: (3172.4.4 more-find-ghosts)
  • Revision ID: pqm@pqm.ubuntu.com-20080115061554-qyfxjo4fxlsjobar
(robertc) Stop fetching ghosts over the smart server pulls by
        default. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
    This should not be used directly, it's essential a object to encapsulate
76
76
    the logic in InterRepository.fetch().
77
77
    """
78
 
    def __init__(self, to_repository, from_repository, last_revision=None, pb=None):
 
78
 
 
79
    def __init__(self, to_repository, from_repository, last_revision=None, pb=None,
 
80
        find_ghosts=True):
 
81
        """Create a repo fetcher.
 
82
 
 
83
        :param find_ghosts: If True search the entire history for ghosts.
 
84
        """
79
85
        # result variables.
80
86
        self.failed_revisions = []
81
87
        self.count_copied = 0
88
94
        self.from_repository = from_repository
89
95
        # must not mutate self._last_revision as its potentially a shared instance
90
96
        self._last_revision = last_revision
 
97
        self.find_ghosts = find_ghosts
91
98
        if pb is None:
92
99
            self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
93
100
            self.nested_pb = self.pb
196
203
            # XXX: this gets the full graph on both sides, and will make sure
197
204
            # that ghosts are filled whether or not you care about them.
198
205
            return self.to_repository.missing_revision_ids(self.from_repository,
199
 
                                                           self._last_revision)
 
206
                self._last_revision, find_ghosts=self.find_ghosts)
200
207
        except errors.NoSuchRevision:
201
208
            raise InstallFailed([self._last_revision])
202
209
 
329
336
 
330
337
        :param revs: A list of revision ids
331
338
        """
 
339
        # In case that revs is not a list.
 
340
        revs = list(revs)
332
341
        while revs:
333
342
            for tree in self.source.revision_trees(revs[:100]):
334
343
                if tree.inventory.revision_id is None:
372
381
    """Fetch from a Model1 repository into a Knit2 repository
373
382
    """
374
383
    def __init__(self, to_repository, from_repository, last_revision=None,
375
 
                 pb=None):
 
384
                 pb=None, find_ghosts=True):
376
385
        self.helper = Inter1and2Helper(from_repository, to_repository)
377
386
        GenericRepoFetcher.__init__(self, to_repository, from_repository,
378
 
                                    last_revision, pb)
 
387
            last_revision, pb, find_ghosts)
379
388
 
380
389
    def _generate_root_texts(self, revs):
381
390
        self.helper.generate_root_texts(revs)
388
397
    """Fetch from a Knit1 repository into a Knit2 repository"""
389
398
 
390
399
    def __init__(self, to_repository, from_repository, last_revision=None, 
391
 
                 pb=None):
 
400
                 pb=None, find_ghosts=True):
392
401
        self.helper = Inter1and2Helper(from_repository, to_repository)
393
402
        KnitRepoFetcher.__init__(self, to_repository, from_repository,
394
 
                                 last_revision, pb)
 
403
            last_revision, pb, find_ghosts)
395
404
 
396
405
    def _generate_root_texts(self, revs):
397
406
        self.helper.generate_root_texts(revs)