[RFC] ghost aware apis
Robert Collins
robertc at robertcollins.net
Tue Feb 28 05:48:55 GMT 2006
On Tue, 2006-02-28 at 16:37 +1100, Robert Collins wrote:
> Ok, after chatting with aaron I think the following ghost aware apis are
> what we need, and we should aim to get them into the mainline as soon as
> convenient...
>
> For the following samples the revision graph is:
> {3:[2],
> 2:[1,0],
> 1:[0],
> 0:[],
> }
>
> and revisions 1 and 0 are ghosts, and we have no cache of ancestry data
> for ghosts.
>
> A replacement for getting the ancestry for a revision that is ghost
> aware, lets say its called get_ancestry_ghosts. This returns a list of
> the topologically sorted ancestors of revision_id, and all the ghosts in
> that list.
>
> That is:
> get_ancestry_ghosts(3) -> [0, 1, 2, 3], set([0, 1])
> get_ancestry_ghosts(1) -> [1], set([1])
> get_ancestry_ghosts(0) -> [0], set([0])
>
> Secondly, an api to get the revision graph as a map which will also
> return a set of the ghosts:
> get_ancestry_graph(3) -> {3:[2], 2:[1,0], }, set([0, 1])
> get_ancestry_graph(1) -> {}, set()
>
>
> Thoughts? sound good?
Oh, I should mention, that using a non ghost aware api will return
ghost-ignorant data, so that behaviour on older repositories is only
compromised when we actually want ghost specific results. So there
should be a get_ancestry_graph_ghosts rather than get_ancestry_graph up
above.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060228/f7148eb9/attachment.pgp
More information about the bazaar
mailing list