[MERGE] Replace VersionedFile.get_parents with get_parent_map

Robert Collins robertc at robertcollins.net
Tue Mar 25 00:36:31 GMT 2008


On Thu, 2008-03-20 at 18:58 -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> | On Thu, 2008-03-20 at 10:47 -0500, John Arbash Meinel wrote:
> |
> |
> |> Your change to iter_reverse_revision_history doesn't handle if a mainline parent
> |> is a ghost:
> |
> | I thought we truncated at that point normally? I can change it to work,
> | but is it desirable ?
> 
> Well, get_parent_map([ghost]) = {}
> So the {}[ghost] will raise a KeyError.
> 
> I'm fine with just truncating, just don't want a KeyError.

Actually, I'd rather a KeyError; or RevisionNotPresent.

We've had headaches in the past with methods that hide errors that
callers need to handle. I think 'history is missing' is one of them.

This API does not emit NULL_REVISION, so unless an exception is raised
there is no way for a caller to differentiate between 'end of history'
and 'end of available history'.

-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: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080325/22b44ba8/attachment.pgp 


More information about the bazaar mailing list