[merge] split out repository formats

Aaron Bentley aaron.bentley at utoronto.ca
Tue Feb 6 15:05:59 GMT 2007


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

John Arbash Meinel wrote:
> 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?

> 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.

I can sympathise with that, but I think it makes sense to keep related
code together.  I'd be much more inclined to split text repos, weave
repos, and knit repos into separate files, and keep the formats with them.

> 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.

Well, it's actually factory vs instance.  The reason for using factories
is that many of the BzrDir subtypes are just paramaterizations of
BzrDirFormatMeta1.  My main reason for avoiding instances was that some
code mucks around with the contents of the format object it uses, so I
wanted to provide a fresh instance each time.

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

iD8DBQFFyJlX0F+nu1YWqI0RAmzBAJ9PRcmwyqqI/Mljhkm4nLGo94NYiQCcDvDk
WGDiszRQg93DN58n1fcw5Xo=
=ShTO
-----END PGP SIGNATURE-----



More information about the bazaar mailing list