[PATCH 1 of 9] Add a repo.lookuplist convenience function

Alexis S. L. Carvalho alexis at cecm.usp.br
Tue Mar 4 00:13:26 CST 2008


Thus spake Matt Mackall:
> On Sun, Mar 02, 2008 at 04:01:23PM -0300, Alexis S. L. Carvalho wrote:
> > # HG changeset patch
> > # User Alexis S. L. Carvalho <alexis at cecm.usp.br>
> > # Date 1204481759 10800
> > # Node ID dd43ec3d30cd13f3925bd51006e0e2699f74ad8a
> > # Parent  305d4450036a9293eec7b3b057be34fd539f4538
> > Add a repo.lookuplist convenience function
> > 
> > It just calls repo.lookup on every element of a list of revisions
> > and returns the results.
> > 
> ...
> > -        nodes = [repo.lookup(n) for n in revs]
> > +        nodes = repo.lookuplist(revs)
>            nodes = map(repo.lookup, revs) # Poor map, much maligned..
>            nodes = repo.lookup(revs) # We could detect that revs is a list..

Yes, I'm cheating.

The main point of this patch was not to do a cleanup, but to mark most
places that can handle multiple revisions and that would automatically
be able to handle lookup('branch-name') returning the list of all branch
heads.

Splitting this patch from another one was one of the last things I did
and then I got too lazy to come up with a good commit message.

Alexis


More information about the Mercurial-devel mailing list