~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Robert Collins
  • Date: 2008-01-11 07:12:15 UTC
  • mfrom: (3172.4.1 more-find-ghosts)
  • mto: This revision was merged to the branch mainline in revision 3184.
  • Revision ID: robertc@robertcollins.net-20080111071215-n51r2omrs3e7216m
Merge more-find-ghosts.

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
 
372
379
    """Fetch from a Model1 repository into a Knit2 repository
373
380
    """
374
381
    def __init__(self, to_repository, from_repository, last_revision=None,
375
 
                 pb=None):
 
382
                 pb=None, find_ghosts=True):
376
383
        self.helper = Inter1and2Helper(from_repository, to_repository)
377
384
        GenericRepoFetcher.__init__(self, to_repository, from_repository,
378
 
                                    last_revision, pb)
 
385
            last_revision, pb, find_ghosts)
379
386
 
380
387
    def _generate_root_texts(self, revs):
381
388
        self.helper.generate_root_texts(revs)
388
395
    """Fetch from a Knit1 repository into a Knit2 repository"""
389
396
 
390
397
    def __init__(self, to_repository, from_repository, last_revision=None, 
391
 
                 pb=None):
 
398
                 pb=None, find_ghosts=True):
392
399
        self.helper = Inter1and2Helper(from_repository, to_repository)
393
400
        KnitRepoFetcher.__init__(self, to_repository, from_repository,
394
 
                                 last_revision, pb)
 
401
            last_revision, pb, find_ghosts)
395
402
 
396
403
    def _generate_root_texts(self, revs):
397
404
        self.helper.generate_root_texts(revs)