~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

Define SearchResult/Search interfaces with explicit abstract base classes, add some docstrings and change a method name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
        """
166
166
        mutter("self._fetch_spec, self._last_revision: %r, %r",
167
167
                self._fetch_spec, self._last_revision)
168
 
        get_search = getattr(self._fetch_spec, 'get_search', None)
169
 
        if get_search is not None:
170
 
            mutter('resolving fetch_spec into search: %s', self._fetch_spec)
 
168
        get_search_result = getattr(self._fetch_spec, 'get_search_result', None)
 
169
        if get_search_result is not None:
 
170
            mutter(
 
171
                'resolving fetch_spec into search result: %s', self._fetch_spec)
171
172
            # This is EverythingNotInOther or a similar kind of fetch_spec.
172
173
            # Turn it into a search result.
173
 
            return get_search()
 
174
            return get_search_result()
174
175
        elif self._fetch_spec is not None:
175
176
            # The fetch spec is already a concrete search result.
176
177
            return self._fetch_spec
181
182
        elif self._last_revision is not None:
182
183
            return graph.NotInOtherForRevs(self.to_repository,
183
184
                self.from_repository, [self._last_revision],
184
 
                find_ghosts=self.find_ghosts).get_search()
 
185
                find_ghosts=self.find_ghosts).get_search_result()
185
186
        else: # self._last_revision is None:
186
187
            return graph.EverythingNotInOther(self.to_repository,
187
 
                self.from_repository, find_ghosts=self.find_ghosts).get_search()
 
188
                self.from_repository,
 
189
                find_ghosts=self.find_ghosts).get_search_result()
188
190
 
189
191
    def _parent_inventories(self, revision_ids):
190
192
        # Find all the parent revisions referenced by the stream, but