[MERGE] HTTP redirection
Aaron Bentley
aaron.bentley at utoronto.ca
Wed Feb 14 14:08:01 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vincent Ladeuil wrote:
>>>>>> "aaron" == Aaron Bentley <aaron.bentley at utoronto.ca> writes:
> aaron> The way it looks to me, control formats are formats of control
> aaron> directories. Examples would be 'CVS', '.svn', '{arch}', etc. We
> aaron> currently have only one type of control directory-- a '.bzr' control
> aaron> directory.
> aaron> The inheritance makes it a bit confusing, but when viewed as a control
> aaron> dir, BzrDir is a concrete type, and the fact that it has subtypes is
> aaron> best ignored.
>
> The original purpose was to allow *foreign* BzrDirFormat (see hg,
> svn and git plugins) to have distinct behaviors than native ones,
> and I felt that registering an abstract class was... surprising
> at best (hence the comment).
I agree that it's surprising, but I think it's preferable.
It is not reasonable to use BzrDirMetaFormat1 as a stand-in for BzrDir.
One is not supposed to invoke probe_transport on BzrDirMeta1, but on
BzrDir, because it can return any of the subtypes of BzrDir. From the
context of BzrDir, BzrDirMetaFormat1 is not special. It is one of
several subtypes.
I think it would be a really good idea to split BzrDirFormat into
BzrControlFormat and BzrDirFormatInterface. BzrControlFormat would then
be a concrete type with very few methods. All the BzrDir formats would
then derive from BzrDirFormatInterface.
> And my previous implementation was changing the way
> BzrDirMetaFormat1 behave (to avoid imposing the redirection
> handling to foreign branches).
It would be wrong to make the change for BzrDirMetaFormat1 only. That
would have introduced a regresion for BzrDir4,5&6.
Further, I think that if any control directory's find_format method
raises a RedirectRested, redirecting is the only reasonable choice. A
control dir that does not want this processing should handle the
redirect in find_format.
> This is not *needed* anymore, so I can revert that if you
> wish. But it will have to be re-introduced if we need to have a
> specific behavior for native BzrDirFormats that we do not want to
> impose on foreign BzrDirFormats.
I disagree. Foreign control directory formats can implement anything
they like in find_format. They need not even derive from BzrDirFormat.
If they want to fail on redirect, they can simply raise a different
error.
> >> Have I answered your concerns ?
>
> aaron> Mostly, but I think you should revert your control_dir
> aaron> change.
>
> Can you confirm that ?
I confirm that.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF0xfB0F+nu1YWqI0RAu1pAJ9V2Sv8Fd431ntGZPeafdKCO57xPwCdFBuk
cXX3/XuYW5ZWhbInCrb0wXU=
=LsrH
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list