Aaron Bentley wrote:
> John A Meinel wrote:
>>> Public bug reported:
>>>
>>> After my changes to make the contents of '.bzr/branch/parent' be a
>>> relative path, we now have a new bug that shows up.
>>>
>>> Where when I try to branch someone else's branch, their parent may not be accessible to me.
>>> But 'bzr branch' uses 'sprout', which uses 'copy_content_into' which defaults to copying the parent over.
>
> That doesn't seem like something sprout should do.
>
> Aaron
Well, if you look at sprout, it does:
result = self._format.initialize(to_bzrdir)
self.copy_content_into(result, revision_id=revision_id)
result.set_parent(self.bzrdir.root_transport.base)
return result
So the first thing it does after the copy finishes is to overwrite the
parent.
And if you dig through clone (which had an api change, thus being
difficult to read):
result = self._format.initialize(to_bzrdir)
self.copy_content_into(result, revision_id=revision_id)
return result
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 while I agree sprout() shouldn't be copying the parent, it is kind of
a layering issue, and I don't think it is super critical. And I think we
need to fix branch.get_parent() anyway, since it shouldn't raise a
InvalidURLJoin. It could raise a different exception rather than
returning None, but it shouldn't raise *that* exception.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote: parent' be a
> John A Meinel wrote:
>>> Public bug reported:
>>>
>>> After my changes to make the contents of '.bzr/branch/
>>> relative path, we now have a new bug that shows up.
>>>
>>> Where when I try to branch someone else's branch, their parent may not be accessible to me.
>>> But 'bzr branch' uses 'sprout', which uses 'copy_content_into' which defaults to copying the parent over.
>
> That doesn't seem like something sprout should do.
>
> Aaron
Well, if you look at sprout, it does:
result = self._format. initialize( to_bzrdir) content_ into(result, revision_ id=revision_ id) set_parent( self.bzrdir. root_transport. base)
self.copy_
result.
return result
So the first thing it does after the copy finishes is to overwrite the
parent.
And if you dig through clone (which had an api change, thus being
difficult to read):
result = self._format. initialize( to_bzrdir) content_ into(result, revision_ id=revision_ id)
self.copy_
return result
copy_content_into is doing:
destination. set_revision_ history( new_history) .set_parent( parent)
parent = self.get_parent()
if parent:
destination
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 while I agree sprout() shouldn't be copying the parent, it is kind of
a layering issue, and I don't think it is super critical. And I think we
need to fix branch.get_parent() anyway, since it shouldn't raise a
InvalidURLJoin. It could raise a different exception rather than
returning None, but it shouldn't raise *that* exception.
John enigmail. mozdev. org
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFEt8SdJde BCYSNAAMRAkF9AK CxxEhOSDbw57E8j eQngBG/ zkWi/ACfRkqc Xtw4CjuE=
crPLKHtZ4rJ80S5
=MtSC
-----END PGP SIGNATURE-----