Merge lp:~spiv/bzr/fetch-spec-everything-not-in-other into lp:bzr
Status: | Merged |
---|---|
Merged at revision: | 5648 |
Proposed branch: | lp:~spiv/bzr/fetch-spec-everything-not-in-other |
Merge into: | lp:bzr |
Diff against target: |
247 lines (+32/-36) 10 files modified
bzrlib/fetch.py (+10/-15) bzrlib/graph.py (+6/-5) bzrlib/remote.py (+3/-3) bzrlib/repofmt/knitrepo.py (+1/-1) bzrlib/repofmt/weaverepo.py (+1/-1) bzrlib/repository.py (+2/-2) bzrlib/tests/per_interrepository/test_interrepository.py (+1/-1) bzrlib/tests/test_remote.py (+3/-3) doc/en/release-notes/bzr-2.3.txt (+0/-5) doc/en/release-notes/bzr-2.4.txt (+5/-0) |
To merge this branch: | bzr merge lp:~spiv/bzr/fetch-spec-everything-not-in-other |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pool | Approve | ||
John A Meinel | Pending | ||
Review via email: mp+42811@code.launchpad.net |
This proposal supersedes a proposal from 2010-11-29.
Commit message
Add EverythingResult, EverythingNotIn
Description of the change
Like <https:/
This patch defines some new “fetch specs” to be passed as the fetch_spec argument of fetch: EverythingResult, EmptySearchResult, EverythingNotIn
Separately I'm not 100% sure we need the ability to have fetch specs that aren't resolved into search results immediately (i.e. how AbstractSearch instances are used). This happens to be effectively how the existing code works: e.g. code that does "target.
A nice thing about adding these objects is that it shifts logic to handle these different cases out of the innards of fetch.py to somewhere more modular. This in turn means we can support these things better over HPSS, and so this patch does that: the 'everything' search is now added to the network protocol. Happily new verb was needed, we can safely interpret a BadSearch error in this case as meaning we need to fallback.
Another change in this patch is the deprecation of search_
+ if not isinstance(search, graph.Everythin gResult) :
^- can we add an attribute, rather than an isinstance check?
if not search. is_everything( ):
490 + def _present_ source_ revisions_ for(self, revision_ids): get_graph( ) get_parent_ map(revision_ ids)) ids.difference( present_ revs) NoSuchRevision( self.source, missing.pop()) get_graph( ).iter_ ancestry( revision_ ids) NULL_REVISION get_graph( )" and then you inline "self.source. get_graph( )" into the source_ids list comprehension. Better to re-use the graph object.
491 + """Returns set of all revisions in ancestry of revision_ids present in
492 + the source repo.
493 +
494 + :param revision_ids: if None, all revisions in source are returned.
495 + """
496 + if revision_ids is not None:
497 + # First, ensure all specified revisions exist. Callers expect
498 + # NoSuchRevision when they pass absent revision_ids here.
499 + revision_ids = set(revision_ids)
500 + graph = self.source.
501 + present_revs = set(graph.
502 + missing = revision_
503 + if missing:
504 + raise errors.
505 + source_ids = [rev_id for (rev_id, parents) in
506 + self.source.
507 + if rev_id != _mod_revision.
508 + and parents is not None]
^- you have "graph = self.source.
145 + def get_recipe(self): rror(self. get_recipe) struct( self):
146 + raise NotImplementedE
147 +
148 + def get_network_
149 + return ('everything',)
Why don't EverythingNotIn Other and NotInOtherForRevs implement these functions?
Overall, I think these changes seem good, but I don't really see how this gets us closer to computing a search without having one end doing a step-by-step search. (Certainly you're still using the same 'search_ missing_ revision_ ids', and you don't seem to be serializing anything over the wire...)