Aaron Bentley wrote:
> 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
Maybe. The issue is that if you clone from remote into local, the path
might actually need to change. Say I have:
/branch-one
/branch-two (parent is ../branch-one)
and then I clone branch-two into /sub/branch-3
/sub/branch-3 (if parent is branch-one, it needs to be ../../branch-one).
A raw clone would give just ../branch-one which doesn't point anywhere.
Now we could make _get_raw_parent() try to create an absolute path, and
if it fails, it just copies the raw parent over. But I do believe that
is not a whole lot better, and not worth a new api layer.
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: set_revision_ history( new_history) set_parent( parent) raw_parent( ) _set_raw_ parent( parent)
> John A Meinel wrote:
>>> copy_content_into is doing:
>>>
>>> destination.
>>> 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, 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_
> if parent:
> destination.
>
> Aaron
Maybe. The issue is that if you clone from remote into local, the path
might actually need to change. Say I have:
/branch-one
/branch-two (parent is ../branch-one)
and then I clone branch-two into /sub/branch-3
/sub/branch-3 (if parent is branch-one, it needs to be
../../ branch- one).
A raw clone would give just ../branch-one which doesn't point anywhere.
Now we could make _get_raw_parent() try to create an absolute path, and
if it fails, it just copies the raw parent over. But I do believe that
is not a whole lot better, and not worth a new api layer.
John enigmail. mozdev. org
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFEt9aMJde BCYSNAAMRAn6NAJ 0T1MEYpmad4xeUR AmnnMoqykBJ9wCg 1ohi ZdPfW30g=
FTzQIIrrFSlWD38
=0Rdn
-----END PGP SIGNATURE-----