Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 20711:b95490cf8abd
revset: added set method to addset to duck type generatorset
Since this class is only going to be used inside revset.py (it does not duck
type baseset) it needs to duck type only a few more methods for the next
patches.
author | Lucas Moscovicz <lmoscovicz@fb.com> |
---|---|
date | Mon, 10 Mar 2014 10:49:04 -0700 |
parents | 71df845d86cf |
children | c152e538b85b |
comparison
equal
deleted
inserted
replaced
20710:9c1665f36588 | 20711:b95490cf8abd |
---|---|
2338 yield r | 2338 yield r |
2339 | 2339 |
2340 def __contains__(self, x): | 2340 def __contains__(self, x): |
2341 return x in self._r1 or x in self._r2 | 2341 return x in self._r1 or x in self._r2 |
2342 | 2342 |
2343 def set(self): | |
2344 return self | |
2345 | |
2343 class _generatorset(object): | 2346 class _generatorset(object): |
2344 """Wrap a generator for lazy iteration | 2347 """Wrap a generator for lazy iteration |
2345 | 2348 |
2346 Wrapper structure for generators that provides lazy membership and can | 2349 Wrapper structure for generators that provides lazy membership and can |
2347 be iterated more than once. | 2350 be iterated more than once. |