[MERGE] Fix PlanMergeVersionedFile's no-parent handling
John Arbash Meinel
john at arbash-meinel.com
Wed Jul 2 18:25:18 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
| Hi all,
|
| This patch fixes _PlanMergeVersionedFile to be consistent with the
| VersionedFiles interface.
|
| There seems to be some confusion here;
|
| StackedParentsProvider.get_parent_map is documented to return
| NULL_REVISION when queried about a revision with no parent revisions.
|
| But VersionedFiles.get_parent_map returns ().
|
| Furthermore, we have code that expects () for get_parent_map, but we
| also have code that expects NULL_REVISION.
|
| Note that NULL_REVISION is not a tuple, so this is a pretty bizarre
| return type for methods that are supposed to return keys.
|
| The code I am proposing takes the path of least resistance, by making
| PlanMergeVersionedFile conform more closely to the VersionedFiles API.
|
| Aaron
I'm pretty sure it is supposed to return (NULL_REVISION,) for nodes
without any parents.
I had to spend a bit of time to get pack repositories to return the
right value, and then strip it out again for other cases.
It sounds like docstrings need a bit of updating. And a few proper tests
of get_parent_map.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkhruf4ACgkQJdeBCYSNAAO6VgCeL2yToq0Kdk9kgFlZsPzuw8N/
MlMAniALSD/tI9WqkFVVWeFr2Oefy3SE
=CdZf
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list