##// END OF EJS Templates
phases: implements simple revset symbol...
Pierre-Yves David -
r15819:33ca11b0 default
parent child Browse files
Show More
@@ -6,7 +6,7
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 import re
9 import parser, util, error, discovery, hbisect
9 import parser, util, error, discovery, hbisect, phases
10 10 import node as nodemod
11 11 import bookmarks as bookmarksmod
12 12 import match as matchmod
@@ -395,6 +395,12 def descendants(repo, subset, x):
395 395 s = set(repo.changelog.descendants(*args)) | set(args)
396 396 return [r for r in subset if r in s]
397 397
398 def draft(repo, subset, x):
399 """``draft()``
400 Changeset in draft phase."""
401 getargs(x, 0, 0, _("draft takes no arguments"))
402 return [r for r in subset if repo._phaserev[r] == phases.draft]
403
398 404 def filelog(repo, subset, x):
399 405 """``filelog(pattern)``
400 406 Changesets connected to the specified filelog.
@@ -725,6 +731,12 def present(repo, subset, x):
725 731 except error.RepoLookupError:
726 732 return []
727 733
734 def public(repo, subset, x):
735 """``public()``
736 Changeset in public phase."""
737 getargs(x, 0, 0, _("public takes no arguments"))
738 return [r for r in subset if repo._phaserev[r] == phases.public]
739
728 740 def removes(repo, subset, x):
729 741 """``removes(pattern)``
730 742 Changesets which remove files matching pattern.
@@ -763,6 +775,12 def roots(repo, subset, x):
763 775 cs = set(children(repo, subset, x))
764 776 return [r for r in s if r not in cs]
765 777
778 def secret(repo, subset, x):
779 """``secret()``
780 Changeset in secret phase."""
781 getargs(x, 0, 0, _("secret takes no arguments"))
782 return [r for r in subset if repo._phaserev[r] == phases.secret]
783
766 784 def sort(repo, subset, x):
767 785 """``sort(set[, [-]key...])``
768 786 Sort set by keys. The default sort order is ascending, specify a key
@@ -861,6 +879,7 symbols = {
861 879 "date": date,
862 880 "desc": desc,
863 881 "descendants": descendants,
882 "draft": draft,
864 883 "file": hasfile,
865 884 "filelog": filelog,
866 885 "first": first,
@@ -881,11 +900,13 symbols = {
881 900 "p2": p2,
882 901 "parents": parents,
883 902 "present": present,
903 "public": public,
884 904 "removes": removes,
885 905 "rev": rev,
886 906 "reverse": reverse,
887 907 "roots": roots,
888 908 "sort": sort,
909 "secret": secret,
889 910 "tag": tag,
890 911 "tagged": tagged,
891 912 "user": user,
@@ -134,3 +134,19 Test secret changeset are not pull
134 134 2 0 C
135 135 1 0 B
136 136 0 0 A
137 $ cd ..
138
139 Test revset
140
141 $ cd initialrepo
142 $ hglog -r 'public()'
143 0 0 A
144 1 0 B
145 2 0 C
146 3 0 D
147 6 0 B'
148 $ hglog -r 'draft()'
149 $ hglog -r 'secret()'
150 4 2 E
151 5 2 H
152 7 2 merge B' and E
General Comments 0
You need to be logged in to leave comments. Login now