~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
    after running:
73
73
    count_copied -- number of revisions copied
74
74
 
75
 
    This should not be used directory, its essential a object to encapsulate
 
75
    This should not be used directly, it's essential a object to encapsulate
76
76
    the logic in InterRepository.fetch().
77
77
    """
78
78
    def __init__(self, to_repository, from_repository, last_revision=None, pb=None):
80
80
        self.failed_revisions = []
81
81
        self.count_copied = 0
82
82
        if to_repository.has_same_location(from_repository):
83
 
            # check that last_revision is in 'from' and then return a
84
 
            # no-operation.
85
 
            if last_revision is not None and not is_null(last_revision):
86
 
                to_repository.get_revision(last_revision)
87
 
            return
 
83
            # repository.fetch should be taking care of this case.
 
84
            raise errors.BzrError('RepoFetcher run '
 
85
                    'between two objects at the same location: '
 
86
                    '%r and %r' % (to_repository, from_repository))
88
87
        self.to_repository = to_repository
89
88
        self.from_repository = from_repository
90
89
        # must not mutate self._last_revision as its potentially a shared instance
353
352
            if root_id not in versionedfile:
354
353
                versionedfile[root_id] = to_store.get_weave_or_empty(root_id, 
355
354
                    self.target.get_transaction())
356
 
            parent_texts[root_id] = versionedfile[root_id].add_lines(
 
355
            _, _, parent_texts[root_id] = versionedfile[root_id].add_lines(
357
356
                revision_id, parents, [], parent_texts)
358
357
 
359
358
    def regenerate_inventory(self, revs):