[PATCH RFC] batching: new module to support batching of commands

Matt Mackall mpm at selenic.com
Thu Jun 2 11:59:50 CDT 2011


On Thu, 2011-06-02 at 18:18 +0200, Peter Arrenbrecht wrote:
> # HG changeset patch
> # User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
> # Date 1307031409 -7200
> # Node ID 9946e78354feb1651953dfd65009a005fb0d3dd9
> # Parent  1ffeeb91c55d0b00445ceabde14a0d0faf906a33
> batching: new module to support batching of commands

Let's give it a different name to make it clear it's attached to the
wire protocol.

Remind me why we need this with the new discovery protocol?

> +class batch:

Inherit from object. We should probably make check-code complain about
using old-style classes.

> +class localbatch(batch):
> +    def __init__(self, local):
> +        batch.__init__(self)
> +        self.local = local
> +    def submit(self):
> +        for name, args, opts, resref in self.calls:
> +            resref.append(getattr(self.local, name)(*args, **opts))

Is there any point batching local operations? Shouldn't they just be
fulfilled immediately and have submit do nothing?

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list