Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 25270:61b3529e2377
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 26 May 2015 07:44:37 -0500 |
parents | 3f1a9b44b8c2 e16456831516 |
children | 4d1e56b29a91 |
comparison
equal
deleted
inserted
replaced
25269:46bf4983cf31 | 25270:61b3529e2377 |
---|---|
327 | 327 |
328 # operator methods | 328 # operator methods |
329 | 329 |
330 def stringset(repo, subset, x): | 330 def stringset(repo, subset, x): |
331 x = repo[x].rev() | 331 x = repo[x].rev() |
332 if x in subset: | 332 if (x in subset |
333 or x == node.nullrev and isinstance(subset, fullreposet)): | |
333 return baseset([x]) | 334 return baseset([x]) |
334 return baseset() | 335 return baseset() |
335 | 336 |
336 def rangeset(repo, subset, x, y): | 337 def rangeset(repo, subset, x, y): |
337 m = getset(repo, fullreposet(repo), x) | 338 m = getset(repo, fullreposet(repo), x) |
1909 | 1910 |
1910 # experimental | 1911 # experimental |
1911 def wdir(repo, subset, x): | 1912 def wdir(repo, subset, x): |
1912 # i18n: "wdir" is a keyword | 1913 # i18n: "wdir" is a keyword |
1913 getargs(x, 0, 0, _("wdir takes no arguments")) | 1914 getargs(x, 0, 0, _("wdir takes no arguments")) |
1914 if None in subset: | 1915 if None in subset or isinstance(subset, fullreposet): |
1915 return baseset([None]) | 1916 return baseset([None]) |
1916 return baseset() | 1917 return baseset() |
1917 | 1918 |
1918 # for internal use | 1919 # for internal use |
1919 def _list(repo, subset, x): | 1920 def _list(repo, subset, x): |
3468 """ | 3469 """ |
3469 | 3470 |
3470 def __init__(self, repo): | 3471 def __init__(self, repo): |
3471 super(fullreposet, self).__init__(repo) | 3472 super(fullreposet, self).__init__(repo) |
3472 | 3473 |
3473 def __contains__(self, rev): | |
3474 # assumes the given rev is valid | |
3475 hidden = self._hiddenrevs | |
3476 return not (hidden and rev in hidden) | |
3477 | |
3478 def __and__(self, other): | 3474 def __and__(self, other): |
3479 """As self contains the whole repo, all of the other set should also be | 3475 """As self contains the whole repo, all of the other set should also be |
3480 in self. Therefore `self & other = other`. | 3476 in self. Therefore `self & other = other`. |
3481 | 3477 |
3482 This boldly assumes the other contains valid revs only. | 3478 This boldly assumes the other contains valid revs only. |