storage branch - remaining issues?

Aaron Bentley aaron.bentley at utoronto.ca
Thu Jan 19 17:27:35 GMT 2006


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

John A Meinel wrote:
> Aaron Bentley wrote:
>>I see great value in a uniform interface, and no serious
>>disadvantages.
>>
> 
> 
> Other than having the logic about how to decode a string (whether it is
> a url, or a path) in another place, which then needs to be used
> everywhere we might get a path.

The choice isn't between having paths in Transport.base and doing
up-front decoding everywhere we get a path.  Those are two of many
options.  I can well imagine doing the decoding in
Branch.open_containing or in get_transport.  I've got nothing against
convenience functions, I just like my structures to be well-defined.

> For example, I don't think '.' is a valid url. Which means if we want
> urls everywhere, then 'Branch.open_containing()' shouldn't be passed '.'.

'.' is a valid relative URL, as far as I know.

> I just see more centralization by putting it into the transport
> constructors, rather than having to catch every path on its way in.
> 
> Another possibility would be to have 'takes_args' have classes, 

That could be handy.

>>Because it didn't come from a file, and because I think it's dirty to
>>write bytes to a file and then read unicode from it.
> 
> 
> But at that point isn't it a (group of) strings in memory?

Better to pass the group of strings than to create a new string from the
group and pass that, imho.

> But I suppose you might want to:
> 
> branch2.put_utf8(branch1.get_utf8('foo'))

I think there are very few cases where we want to write unicode verbatim
from another source.  Usually, it's a read/modify/write process.

> 
> And get_utf8 would return a file which returns utf8, and branch2 would
> put it.
> (Though the above could be branch2.put(branch1.get('foo')))
> 
> I'm okay with iterators, I just don't like the idea of iterating over a
> string.

Since the result of iterating over a string is the same as the result of
iterating over a tuple containing that string, we can optimize this case
with:
if isinstance(iterable, basestring):
    iterable = (iterable,)

> I do. So we might actually have a file-id conflict. Though I think I got
> the id from the changeset plugin. Hopefully Martin used the same id.

I think I did not use the same ID.

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

iD8DBQFDz8wH0F+nu1YWqI0RArnrAJ9aDV3lMRgWC12Q/LQ6LWhT+xIkJwCcCRSR
OAGjK1Ha0e6ebcpyY6Tfq78=
=4GGb
-----END PGP SIGNATURE-----




More information about the bazaar mailing list