Enforcing usernames

Martin Geisler mg at lazybytes.net
Wed May 27 04:29:21 CDT 2009


Lasse Kliemann <lasse-list-mercurial-2009 at mail.plastictree.net>
writes:

> The code of the extension is just a few lines, so maybe someone can
> have a look at it and see whether it is alright. For instance, I am
> not exactly sure how this works:
>
>    xrange(repo[node], len(repo))
>
> I took this from the acl extension.

The xrange built-in function will give you an iterator:

>>> for i in xrange(5, 10):
...     print i
... 
5
6
7
8
9

In your code it will iterate over revision numbers from repo[node]
(the revision number of the changeset that caused the hook to be
called) until len(repo) (the total number of revisions, i.e., 'tip').

> BTW, I am still looking forward to help with the commitsigs
> extension. I'll be quite busy for the next 1 1/2 weeks, however.
> I'll get back to it after that.

That's good to hear!

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


More information about the Mercurial mailing list