@@ -248,13 +248,11 @@
def orset(repo, subset, x, y):
xl = getset(repo, subset, x)
- s = xl.set()
- yl = getset(repo, baseset([r for r in subset if r not in s]), y)
+ yl = getset(repo, subset - xl, y)
return baseset(xl + yl)
def notset(repo, subset, x):
- s = getset(repo, subset, x).set()
- return baseset([r for r in subset if r not in s])
+ return subset - getset(repo, subset, x)
def listset(repo, subset, a, b):
raise error.ParseError(_("can't use a list in this context"))
@@ -897,9 +895,9 @@
"""``heads(set)``
Members of set with no children in set.
"""
- s = getset(repo, subset, x).set()
- ps = parents(repo, subset, x).set()
- return baseset([r for r in s if r not in ps])
+ s = getset(repo, subset, x)
+ ps = parents(repo, subset, x)
+ return s - ps
def hidden(repo, subset, x):
"""``hidden()``
@@ -1377,7 +1375,7 @@
s = getset(repo, baseset(repo.changelog), x).set()
subset = baseset([r for r in subset if r in s])
cs = _children(repo, subset, s)
- return baseset([r for r in subset if r not in cs])
+ return subset - cs
def secret(repo, subset, x):
"""``secret()``
@@ -2046,5 +2044,12 @@
self._set = set(self)
return self._set
+ def __sub__(self, x):
+ if isinstance(x, baseset):
+ s = x.set()
+ else:
+ s = set(x)
+ return baseset(self.set() - s)
+
# tell hggettext to extract docstrings from these functions:
i18nfunctions = symbols.values()