[PATCH 1 of 3] revlog: implement __contains__ to lookup a rev

Matt Mackall mpm at selenic.com
Mon Apr 4 16:08:45 CDT 2011


On Mon, 2011-04-04 at 23:53 +0300, Idan Kamara wrote:
> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1301933162 -10800
> # Node ID 8fa270f007c88a817150656052dee29c8443535b
> # Parent  4d2f177e1a9d9be7fce7518a191c21e748078ea1
> revlog: implement __contains__ to lookup a rev

As I explained on IRC earlier today, I don't think we want this.

We've got three kinds of nodes: changelog, manifest, and file nodes.
Only changelog nodes are usually exposed to the user. And if we've got a
node that's not a changelog node that we can't find, that's almost
certainly a fatal error. So if you're first checking if we've got a
node, you're probably doing something wrong.

And for the legitimate case of checking whether we've got changelog
nodes, we've already got repo.__contains__.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list