diff --git a/mercurial/revset.py b/mercurial/revset.py
index 33c7a94d4dd0b28c59d34930f4b8b7d7f9459aa5_bWVyY3VyaWFsL3JldnNldC5weQ==..d2de20e1451fc093f10ff01394883c3512a3d388_bWVyY3VyaWFsL3JldnNldC5weQ== 100644
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -323,8 +323,6 @@
 
 def stringset(repo, subset, x):
     x = repo[x].rev()
-    if x == -1 and len(subset) == len(repo):
-        return baseset([-1])
     if x in subset:
         return baseset([x])
     return baseset()
@@ -3312,10 +3310,11 @@
 class fullreposet(spanset):
     """a set containing all revisions in the repo
 
-    This class exists to host special optimization.
+    This class exists to host special optimization and magic to handle virtual
+    revisions such as "null".
     """
 
     def __init__(self, repo):
         super(fullreposet, self).__init__(repo)
 
     def __contains__(self, rev):
@@ -3316,7 +3315,8 @@
     """
 
     def __init__(self, repo):
         super(fullreposet, self).__init__(repo)
 
     def __contains__(self, rev):
+        # assumes the given rev is valid
         hidden = self._hiddenrevs
@@ -3322,6 +3322,5 @@
         hidden = self._hiddenrevs
-        return ((self._start <= rev < self._end)
-                and not (hidden and rev in hidden))
+        return not (hidden and rev in hidden)
 
     def __and__(self, other):
         """As self contains the whole repo, all of the other set should also be
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
index 33c7a94d4dd0b28c59d34930f4b8b7d7f9459aa5_dGVzdHMvdGVzdC1vYnNvbGV0ZS50..d2de20e1451fc093f10ff01394883c3512a3d388_dGVzdHMvdGVzdC1vYnNvbGV0ZS50 100644
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -187,6 +187,8 @@
   [255]
   $ hg debugrevspec 'rev(6)'
   $ hg debugrevspec 'rev(4)'
+  $ hg debugrevspec 'null'
+  -1
 
 Check that public changeset are not accounted as obsolete:
 
diff --git a/tests/test-revset.t b/tests/test-revset.t
index 33c7a94d4dd0b28c59d34930f4b8b7d7f9459aa5_dGVzdHMvdGVzdC1yZXZzZXQudA==..d2de20e1451fc093f10ff01394883c3512a3d388_dGVzdHMvdGVzdC1yZXZzZXQudA== 100644
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -478,5 +478,23 @@
   [255]
 
 Test null revision
+  $ log '(null)'
+  -1
+  $ log '(null:0)'
+  -1
+  0
+  $ log '(0:null)'
+  0
+  -1
+  $ log 'null::0'
+  -1
+  0
+  $ log 'null:tip - 0:'
+  -1
+  $ log 'null: and null::' | head -1
+  -1
+  $ log 'null: or 0:' | head -2
+  -1
+  0
   $ log 'ancestors(null)'
   -1
@@ -481,5 +499,12 @@
   $ log 'ancestors(null)'
   -1
+  $ log 'reverse(null:)' | tail -2
+  0
+  -1
+  $ log 'first(null:)'
+  -1
+  $ log 'min(null:)'
+  -1
   $ log 'tip:null and all()' | tail -2
   1
   0