[merge] split out repository formats

John Arbash Meinel john at arbash-meinel.com
Tue Feb 6 14:46:01 GMT 2007


Aaron Bentley wrote:
> Martin Pool wrote:
>> Now personally I would rather in most cases dispense with the Format
>> object and class altogether and just hold the actual Repository class or
>> whatever.
> 
> This is what I don't understand: if you feel (as I do) that the
> RepositoryFormat objects should be part of the Repository objects, why
> do you want to split them into a separate file?
> 
> Aaron

I think he is just trying to shrink the repository.py file. And this is
just a step in that direction. My hope is that this was a start that
would end with also moving the Repository classes into their own files.

By the way, moving classes like this is pretty hard on backwards
compatibility. Or at least you can import it back into the original
module, but if the goal is to not load unused code, you lose that
benefit. I suppose you could do it temporarily and then in the next
release you can remove the local import.

As far as Martin's comments, I would rather see them holding classes
rather than instances. Partially because lazy loading a class is more
obvious than lazy loading an instance. It can work either way, though.

(You can implement a callable that returns just about anything, versus
an instance which already has to *be* that thing).

John
=:->



More information about the bazaar mailing list