[PATCH RFC] revset: completely ignore "null" symbol in new-style query (BC)
Yuya Nishihara
yuya at tcha.org
Tue Jan 6 09:38:53 CST 2015
On Mon, 05 Jan 2015 15:45:17 -0600, Matt Mackall wrote:
> On Sun, 2015-01-04 at 12:21 +0900, Yuya Nishihara wrote:
> > This depends on my previous patch "revset: drop pre-lazyset optimization for
> > stringset of subset == entire repo." I want to know if "null" revision is
> > supported in revset.
>
> We probably do want to support null. It's one of the primary barriers to
> eliminating old-style queries. We also want to eventually support a
> symbol/identifier that means "the working copy".
So maybe we'll need a magic to extend the initial "subset" to null or "the
working copy" symbol. I'll try something like the following.
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -252,8 +252,6 @@ def _getrevsource(repo, r):
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()
@@ -3070,5 +3068,8 @@ class fullreposet(_spanset):
other.sort(reverse)
return other
+ def __contains__(self, rev):
+ return rev == -1 or super(fullreposet, self).__contains__(rev)
+
# tell hggettext to extract docstrings from these functions:
i18nfunctions = symbols.values()
More information about the Mercurial-devel
mailing list