~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Martin Pool
  • Date: 2007-10-10 00:21:57 UTC
  • mfrom: (2900 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2901.
  • Revision ID: mbp@sourcefrog.net-20071010002157-utci0x44m2w47wgd
merge news

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