##// END OF EJS Templates
revset: added substraction to baseset class...
Lucas Moscovicz -
r20366:5ec6321f default
parent child Browse files
Show More
@@ -249,13 +249,11 b' def andset(repo, subset, x, y):'
249
249
250 def orset(repo, subset, x, y):
250 def orset(repo, subset, x, y):
251 xl = getset(repo, subset, x)
251 xl = getset(repo, subset, x)
252 s = xl.set()
252 yl = getset(repo, subset - xl, y)
253 yl = getset(repo, baseset([r for r in subset if r not in s]), y)
254 return baseset(xl + yl)
253 return baseset(xl + yl)
255
254
256 def notset(repo, subset, x):
255 def notset(repo, subset, x):
257 s = getset(repo, subset, x).set()
256 return subset - getset(repo, subset, x)
258 return baseset([r for r in subset if r not in s])
259
257
260 def listset(repo, subset, a, b):
258 def listset(repo, subset, a, b):
261 raise error.ParseError(_("can't use a list in this context"))
259 raise error.ParseError(_("can't use a list in this context"))
@@ -912,9 +910,9 b' def heads(repo, subset, x):'
912 """``heads(set)``
910 """``heads(set)``
913 Members of set with no children in set.
911 Members of set with no children in set.
914 """
912 """
915 s = getset(repo, subset, x).set()
913 s = getset(repo, subset, x)
916 ps = parents(repo, subset, x).set()
914 ps = parents(repo, subset, x)
917 return baseset([r for r in s if r not in ps])
915 return s - ps
918
916
919 def hidden(repo, subset, x):
917 def hidden(repo, subset, x):
920 """``hidden()``
918 """``hidden()``
@@ -1400,7 +1398,7 b' def roots(repo, subset, x):'
1400 s = getset(repo, baseset(repo.changelog), x).set()
1398 s = getset(repo, baseset(repo.changelog), x).set()
1401 subset = baseset([r for r in subset if r in s])
1399 subset = baseset([r for r in subset if r in s])
1402 cs = _children(repo, subset, s)
1400 cs = _children(repo, subset, s)
1403 return baseset([r for r in subset if r not in cs])
1401 return subset - cs
1404
1402
1405 def secret(repo, subset, x):
1403 def secret(repo, subset, x):
1406 """``secret()``
1404 """``secret()``
@@ -2069,5 +2067,12 b' class baseset(list):'
2069 self._set = set(self)
2067 self._set = set(self)
2070 return self._set
2068 return self._set
2071
2069
2070 def __sub__(self, x):
2071 if isinstance(x, baseset):
2072 s = x.set()
2073 else:
2074 s = set(x)
2075 return baseset(self.set() - s)
2076
2072 # tell hggettext to extract docstrings from these functions:
2077 # tell hggettext to extract docstrings from these functions:
2073 i18nfunctions = symbols.values()
2078 i18nfunctions = symbols.values()
General Comments 0
You need to be logged in to leave comments. Login now