##// 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 b''
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import re
8 import re
9 import parser, util, error, discovery, hbisect
9 import parser, util, error, discovery, hbisect, phases
10 import node as nodemod
10 import node as nodemod
11 import bookmarks as bookmarksmod
11 import bookmarks as bookmarksmod
12 import match as matchmod
12 import match as matchmod
@@ -395,6 +395,12 b' def descendants(repo, subset, x):'
395 s = set(repo.changelog.descendants(*args)) | set(args)
395 s = set(repo.changelog.descendants(*args)) | set(args)
396 return [r for r in subset if r in s]
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 def filelog(repo, subset, x):
404 def filelog(repo, subset, x):
399 """``filelog(pattern)``
405 """``filelog(pattern)``
400 Changesets connected to the specified filelog.
406 Changesets connected to the specified filelog.
@@ -725,6 +731,12 b' def present(repo, subset, x):'
725 except error.RepoLookupError:
731 except error.RepoLookupError:
726 return []
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 def removes(repo, subset, x):
740 def removes(repo, subset, x):
729 """``removes(pattern)``
741 """``removes(pattern)``
730 Changesets which remove files matching pattern.
742 Changesets which remove files matching pattern.
@@ -763,6 +775,12 b' def roots(repo, subset, x):'
763 cs = set(children(repo, subset, x))
775 cs = set(children(repo, subset, x))
764 return [r for r in s if r not in cs]
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 def sort(repo, subset, x):
784 def sort(repo, subset, x):
767 """``sort(set[, [-]key...])``
785 """``sort(set[, [-]key...])``
768 Sort set by keys. The default sort order is ascending, specify a key
786 Sort set by keys. The default sort order is ascending, specify a key
@@ -861,6 +879,7 b' symbols = {'
861 "date": date,
879 "date": date,
862 "desc": desc,
880 "desc": desc,
863 "descendants": descendants,
881 "descendants": descendants,
882 "draft": draft,
864 "file": hasfile,
883 "file": hasfile,
865 "filelog": filelog,
884 "filelog": filelog,
866 "first": first,
885 "first": first,
@@ -881,11 +900,13 b' symbols = {'
881 "p2": p2,
900 "p2": p2,
882 "parents": parents,
901 "parents": parents,
883 "present": present,
902 "present": present,
903 "public": public,
884 "removes": removes,
904 "removes": removes,
885 "rev": rev,
905 "rev": rev,
886 "reverse": reverse,
906 "reverse": reverse,
887 "roots": roots,
907 "roots": roots,
888 "sort": sort,
908 "sort": sort,
909 "secret": secret,
889 "tag": tag,
910 "tag": tag,
890 "tagged": tagged,
911 "tagged": tagged,
891 "user": user,
912 "user": user,
@@ -134,3 +134,19 b' Test secret changeset are not pull'
134 2 0 C
134 2 0 C
135 1 0 B
135 1 0 B
136 0 0 A
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