Foreign branch infrastructure plans

Robert Collins robert.collins at canonical.com
Mon Mar 16 23:46:43 GMT 2009


On Tue, 2009-03-17 at 10:00 +1100, Martin Pool wrote:
> 
> > So I'd like it if we moved all the convenience methods higher up the
> > stack, and have things that provide defaults always raise
> > NotImplementedError  at the same level that the convenience methods
> are
> > defined.
> 
> So then you'd have to specifically hook up the convenience methods,
> like hypothetically
> 
>   def get_foo(self):
>     return self._get_foo_from_wibble()

Roughly. By convenience methods I mean things like
get_inventory() which is really iter_inventories([rev]).next()[1]
Most Repositories will want to replace iter_inventories, none should
have motivation to replace get_inventory.

So concretely we might say:
Repository
   def get_inventory():
      ....

   def iter_inventories():
      raise NotImplementedError(self.iter_inventories)


DiskRepository(Repository):

   def iter_inventories():
      ...self.iter_inventory_xmls()...

etc, and then

RemoteRepository(Repository):
   def iter_inventories():
       <some verb>

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090317/44d54c8c/attachment.pgp 


More information about the bazaar mailing list