~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-06 05:32:43 UTC
  • mto: (2535.3.33 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2713.
  • Revision ID: andrew.bennetts@canonical.com-20070806053243-myehcu0fvyrxpkyb
Get rid of RepoFetcher._same_repo by using Repository.__eq__.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
        # result variables.
90
90
        self.failed_revisions = []
91
91
        self.count_copied = 0
92
 
        if self._same_repo(to_repository, from_repository, last_revision):
 
92
        if to_repository == from_repository:
 
93
            if last_revision not in (None, NULL_REVISION):
 
94
                to_repository.get_revision(last_revision)
93
95
            return
94
96
        self.to_repository = to_repository
95
97
        self.from_repository = from_repository
113
115
        finally:
114
116
            self.from_repository.unlock()
115
117
 
116
 
    def _same_repo(self, to_repository, from_repository, last_revision):
117
 
        if to_repository.control_files._transport.base == from_repository.control_files._transport.base:
118
 
            # check that last_revision is in 'from' and then return a no-operation.
119
 
            if last_revision not in (None, NULL_REVISION):
120
 
                to_repository.get_revision(last_revision)
121
 
            return True
122
 
        return False
123
 
 
124
118
    def __fetch(self):
125
119
        """Primary worker function.
126
120