[PATCH hglib] context: initial implementation of changectx

Matt Mackall mpm at selenic.com
Mon Oct 17 14:32:43 CDT 2011


On Sat, 2011-10-15 at 21:49 +0200, Idan Kamara wrote:
> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1318708184 -7200
> # Node ID c57c6f0c9071da60240b604da80d1c77e5873737
> # Parent  5574413bce099f120fbf1ada7af59853c69f78db
> context: initial implementation of changectx

I mostly like this.

However, I intentionally made the bulk of Mercurial's context API look
like method calls rather than member variables. For the most part these
methods are fast, but they can in fact be quite expensive.

Whether or not that's the right choice, I don't see any good reason to
make it different in hglib when it's so obviously trying to mirror that
API.

> diff --git a/hglib/context.py b/hglib/context.py
> new file mode 100644
> --- /dev/null
> +++ b/hglib/context.py
> @@ -0,0 +1,190 @@
> +import client, util, templates
> +
> +nullcset = ['-1', '000000000000000000000000000000000000000', '', '', '', '']

Please use a leading underscore if this is intended to be 'private'.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list