/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: 2007-10-04 22:33:14 UTC
  • mfrom: (2881.4.1 fetch)
  • Revision ID: pqm@pqm.ubuntu.com-20071004223314-qpih4e2os3o2627a
(robertc) Move same-repo fetch checking logic to the repository class user visible function for more reuse. (Robert Collins)

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