[MERGE] Create a SearchResult for memoising graph searches
John Arbash Meinel
john at arbash-meinel.com
Thu Jan 17 19:40:55 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> This adds a SearchResult accessed via search.get_result(). This should
> be extremely useful in getting the smart server to send streams of
> revisions without having to upload megabytes of keys to it.
>
> -Rob
>
...
> + :return: A tuple (start_keys_set, exclude_keys_set, revision_count). To
> + recreate the results of this search, create a breadth first
> + searcher on the same graph starting at start_keys. Then call next()
> + (or next_with_ghosts()) repeatedly, and on every result, call
> + stop_searching_any on any keys from the exclude_keys set. The
> + revision_count value acts as a trivial cross-check - the found
> + revisions of the new search should have as many elements as
> + revision_count. If it does not, then additional revisions have been
> + ghosted since the search was executed the first time and the second
> + time.
> + """
^- It seems like it would be nicer to have something that you don't have
to step through the whole graph. But I guess if it is meant to be
transmitted over the wire, you want a minimal set of revisions to send.
...
> - # XXX: This seems valid, is there a reason to actually create a
> - # repository and put things in it?
^- The one reason I found to actually creating a repository is that it
enforces the DAG shape. With a plain dictionary it is very easy to have
a node which creates a cycle, which then does odd things in the tests.
I don't think it is enough to make us want to spend the time committing
revisions, though. So I'm happy enough to have it pulled out.
If we are going to get rid of it here, we should probably get rid of the
"prepare_memory_tree" and "build_ancestry" helpers, since I don't think
they are used anymore.
BB:approve
The rest is just for us to discuss.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHj69HJdeBCYSNAAMRAv8jAJ0bORHqx8izBMT5Evxb0qgTOpsv6gCdGSAj
UM4fscI3kgq+sKk3+Cwp5P0=
=rrJH
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list