Comment 3 for bug 214894

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 214894] Re: AssertionError when pushing to remote bzr+ssh repository (len(history) != revno)
  • unnamed Edit (189 bytes, application/pgp-signature; name=signature.asc)

On Tue, 2008-04-29 at 19:53 +0000, John A Meinel wrote:
> Looking into this, the problem is with the
> RemoteRepository.get_parent_map() code.
>
> Specifically, if the server doesn't support get_parent_map() it falls
> back to just calling get_revision_graph().
>
> However, for nodes with 0 parents, get_parent_map() returns ('null:',) while get_revision_graph() just returns ().
> for get_parent_map(), a return of () means that the revision is a ghost.
>
> This shows up for Branch5, because it checks the normalization of
> history when you call set_last_revision_info(). And the
> _lefthand_history() code iterates backwards, stopping when it finds a
> ghost.
>
> So when you "bzr push bzr+ssh://" a Branch5 (dirstate) it checks the
> length of the remote history, and doesn't include the first revision
> (because it thinks it is a ghost).
>
> The fix isn't very hard, you just need to filter the
> get_revision_graph() call and substitute ('null:',) for any () nodes.
>
> I'll work up a patch. This is probably worthy of a 1.3.2 fix if we
> really want to allow bzr >1.2 to interoperate with bzr <1.2 (and 1.3.2
> because that is easier to get into Hardy than asking them to release
> 1.5)

Good catch. I think we should do a point release.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.