[merge] change RepositoryFormat to a Registry

John Arbash Meinel john at arbash-meinel.com
Wed Jan 24 15:38:14 GMT 2007


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

Martin Pool wrote:
> This changes RepositoryFormat to use a Registry internally. 
> 
> At the moment this keeps all the same methods and just delegates them to
> the registry.  This is preliminary to splitting the formats into
> submodules, and lazily loading them.
> 
> 
> 

...

> === added directory bzrlib/repofmt // file-id:repofmt-20070124052833-mplndq0ayw
> ... l30b35-1 // last-changed:mbp at sourcefrog.net-20070124071209-yqiths20n6wxqaqr
> === modified file bzrlib/registry.py // last-changed:mbp at sourcefrog.net-2007012
> ... 4071209-yqiths20n6wxqaqr
> --- bzrlib/registry.py
> +++ bzrlib/registry.py
> @@ -200,6 +200,14 @@
>          for key, getter in self._dict.iteritems():
>              yield key, getter.get_obj()
>  
> +    def itervalues(self):
> +        """Iterate all registry values in key order.
> +
> +        This imports any lazily registered entries.
> +        """
> +        for key in self.keys():
> +            yield self.get(key)
> +

^- Do you need 'itervalues' rather than using 'iteritems()' and just
ignoring the keys? I'm fine with adding it, if it is genuinely useful.

If you do want to add it, we need a simple test for it in
bzrlib/tests/test_registry.py

Otherwise +1.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFt31mJdeBCYSNAAMRAgIeAJ9k9YOo7csmr5kM3Wf5uQBCOrt6CACfaxsL
lKhiVxd7WSVI9NuVeqOt1Dg=
=oorQ
-----END PGP SIGNATURE-----



More information about the bazaar mailing list