[MERGE] Replace VersionedFile.get_parents with get_parent_map

John Arbash Meinel john at arbash-meinel.com
Thu Mar 20 23:58:44 GMT 2008


-----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.

|
|> This seems wrong:
|> @@ -758,8 +768,11 @@
|> ~         version_ids = set(other.versions()).intersection(set(version_ids))
|> ~         # pull in the referenced graph.
|> ~         version_ids = other.get_ancestry(version_ids)
|> - -        pending_graph = [(version, other.get_parents(version)) for
|> - -                         version in version_ids]
|> +        pending_parents = other.get_parent_map(version_ids)
|> +        pending_graph = pending_parents.items()
|> +        if len(pending_graph) != len(version_ids):
|> +            raise RevisionNotPresent(
|> +                set(version_ids) - pending_parents.keys(), self)
|>
|> When I try it:
|>
|> |>> set([1, 2,3]) - [2, 3]
|> TypeError: unsupported operand type(s) for -: 'set' and 'list'
|>
|> Which may indicate we have a missing test.
|
| Ah yes, looks like we do. I'll fix the thing.
|
|> Otherwise:
|>
|> BB:tweak
|
| Thanks, I'll hold off until the iter_reverse stuff is clarified.
|
| -Rob

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH4vo0JdeBCYSNAAMRApDQAJ9sIZ7IPAvYAKOXGY0ZRxJ7V+vQTACg1Ko2
T7mjFEHkk2dwWVYljmrnCF4=
=IW3P
-----END PGP SIGNATURE-----



More information about the bazaar mailing list