# HG changeset patch # User Lucas Moscovicz # Date 1392229363 28800 # Node ID ed57358398af44184835e133e9530e6952f51be0 # Parent a979078bd7887ecea94e3c2c0c678bbfa4c585ec revset: added basic operations to spanset Added methods __add__, __sub__ and __and__ to duck type more methods in baseset diff -r a979078bd788 -r ed57358398af mercurial/revset.py --- a/mercurial/revset.py Wed Feb 12 10:16:21 2014 -0800 +++ b/mercurial/revset.py Wed Feb 12 10:22:43 2014 -0800 @@ -2149,5 +2149,15 @@ return (x <= self._start and x > self._end) or (x >= self._start and x< self._end) + def __and__(self, x): + return lazyset(self, lambda r: r in x) + + def __sub__(self, x): + return lazyset(self, lambda r: r not in x) + + def __add__(self, x): + l = baseset(self) + return l + baseset(x) + # tell hggettext to extract docstrings from these functions: i18nfunctions = symbols.values()