Comment 3 for bug 52976

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 52976] Re: [Bug 52976] Re: [Bug 52976] bzr branch fails to set parent

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> copy_content_into is doing:
>
> destination.set_revision_history(new_history)
> parent = self.get_parent()
> if parent:
> destination.set_parent(parent)
>
>
> So one difference would be to move the 'get_parent()' call into clone()
> instead of being in copy_content. However, I'm pretty sure that
> 'copy_content_into' has an api that says it is cloning the object.

So, copy_content_into is supposed to be a clone sort of operation that
does an exact copy. So if it tries to copy a branch with an invalid
parent, the result should be a branch with an invalid parent. (Because
you may later use the branch from a location where the parent *is* valid.)

e.g. copy_content_into should do
parent = self._get_raw_parent()
if parent:
    destination._set_raw_parent(parent)

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEt8+O0F+nu1YWqI0RAvqNAJ9URjnzY9SaWHXTm6i5GUA1c+FPeQCghsHD
kV58ugcBZ983QGDtLwGVkTo=
=HR17
-----END PGP SIGNATURE-----