--- a/mercurial/revset.py Fri Jan 06 09:51:35 2012 +0100
+++ b/mercurial/revset.py Fri Jan 06 10:04:20 2012 +0100
@@ -6,7 +6,7 @@
# GNU General Public License version 2 or any later version.
import re
-import parser, util, error, discovery, hbisect
+import parser, util, error, discovery, hbisect, phases
import node as nodemod
import bookmarks as bookmarksmod
import match as matchmod
@@ -395,6 +395,12 @@
s = set(repo.changelog.descendants(*args)) | set(args)
return [r for r in subset if r in s]
+def draft(repo, subset, x):
+ """``draft()``
+ Changeset in draft phase."""
+ getargs(x, 0, 0, _("draft takes no arguments"))
+ return [r for r in subset if repo._phaserev[r] == phases.draft]
+
def filelog(repo, subset, x):
"""``filelog(pattern)``
Changesets connected to the specified filelog.
@@ -725,6 +731,12 @@
except error.RepoLookupError:
return []
+def public(repo, subset, x):
+ """``public()``
+ Changeset in public phase."""
+ getargs(x, 0, 0, _("public takes no arguments"))
+ return [r for r in subset if repo._phaserev[r] == phases.public]
+
def removes(repo, subset, x):
"""``removes(pattern)``
Changesets which remove files matching pattern.
@@ -763,6 +775,12 @@
cs = set(children(repo, subset, x))
return [r for r in s if r not in cs]
+def secret(repo, subset, x):
+ """``secret()``
+ Changeset in secret phase."""
+ getargs(x, 0, 0, _("secret takes no arguments"))
+ return [r for r in subset if repo._phaserev[r] == phases.secret]
+
def sort(repo, subset, x):
"""``sort(set[, [-]key...])``
Sort set by keys. The default sort order is ascending, specify a key
@@ -861,6 +879,7 @@
"date": date,
"desc": desc,
"descendants": descendants,
+ "draft": draft,
"file": hasfile,
"filelog": filelog,
"first": first,
@@ -881,11 +900,13 @@
"p2": p2,
"parents": parents,
"present": present,
+ "public": public,
"removes": removes,
"rev": rev,
"reverse": reverse,
"roots": roots,
"sort": sort,
+ "secret": secret,
"tag": tag,
"tagged": tagged,
"user": user,