[PATCH] remote_branch with asyncore

Aaron Bentley aaron.bentley at utoronto.ca
Tue Jun 28 01:22:15 BST 2005


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

Aaron Bentley wrote:
> Robert Collins wrote:
> 
>>>Style wise, I think this is harmful : dispatching by type is usually a
>>>sign that some behaviour or capability hasn't been recognized and put
>>>into the objects interface.
...
>>>So I suggest putting some indication of that in the public Store
>>>interface - so that if I were to write a Store that works from a CD-ROM,
>>>it would be an ImmutableStore, but not confuse your code.

I think I should also have mentioned that this is a crude form of
double-dispatch.  If you introduce a class that derives from
ImmutableStore but has different behavior, you should override
copy_multi, and probably copy_multi_helper as well.

For a better example, see ImmutableStore.copy_multi_helper, which works
because we know both branches can be treated as ImmutableStores.  (and
if you get to ImmutableStore.copy_multi_helper, you must assume that
other can be treated as an ImmutableStore, otherwise copy_multi would
have been overloaded.)

Presumably it would be much easier to get RsyncBranch to work
efficiently with another RsyncBranch than it would be to make it work
with any arbitrary remote branch, since you only have to change the
arguments to rsync.

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

iD8DBQFCwJg30F+nu1YWqI0RAi0HAJ4wgI41VYsYvM4TwfIootdQAoBNlQCeI1Bu
mgaIm4QoXZyVAvQvfWnc5MQ=
=jZbv
-----END PGP SIGNATURE-----




More information about the bazaar mailing list