[MERGE] Enable writable http transports

John Arbash Meinel john at arbash-meinel.com
Thu Aug 31 18:15:51 BST 2006

Vincent LADEUIL wrote:
>>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:
> <snip/>
>     jam> (Some websites redirect invalid requests to another page, and thereby
>     jam> don't give you back a 404. Others have directory listings turned off, so
>     jam> you get some sort of invalid request when you ask for a directory.
>     jam> Also, just think about the basic "If i go to http://foo.com/ it is
>     jam> typically returning http://foo.com/index.html".)
>     jam> Anyway, 'has()' should be avoided.
> ... for directories at least. Ok.

Well, even for files. Because typically you don't care if there is a
file, you want the contents of the file if it exists. So you might as
well actually download it, rather than doing a check to see if it
exists, and then another round trip to download the contents.

There are a few places in our code where 'has()' would be fine, but
mostly it is because we are checking for the existence of a 0-length
file (for example .bzr/repository/no-working-trees,
.bzr/repository/shared or is it not-shared?)

Anyway, doing a GET on a 0-length file should be equivalent to HEAD, so
we still don't really need has().

I added it to Transport because it seemed to be more complete. But in
actuality we really don't need it, and probably should look into
deprecating it. (We might find a case where we really do want it).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060831/2e9b494d/attachment.pgp 

More information about the bazaar mailing list