~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

MergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
    """
81
81
    def __init__(self, to_repository, from_repository, last_revision=None, pb=None):
82
82
        if to_repository.bzrdir.transport.base == from_repository.bzrdir.transport.base:
83
 
            raise Exception("can't fetch from a repository to itself %s, %s" % 
84
 
                            (from_repository.bzrdir.transport.base,
85
 
                             to_repository.bzrdir.transport.base))
 
83
            # check that last_revision is in 'from' and then return a no-operation.
 
84
            if last_revision not in (None, NULL_REVISION):
 
85
                from_repository.get_revision(last_revision)
 
86
            return
86
87
        self.to_repository = to_repository
87
88
        self.from_repository = from_repository
88
89
        # must not mutate self._last_revision as its potentially a shared instance