4 # |
4 # |
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
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 |
13 from i18n import _ |
13 from i18n import _ |
14 import encoding |
14 import encoding |
393 if not args: |
393 if not args: |
394 return [] |
394 return [] |
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. |
401 """ |
407 """ |
402 |
408 |
723 try: |
729 try: |
724 return getset(repo, subset, x) |
730 return getset(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. |
731 """ |
743 """ |
732 # i18n: "removes" is a keyword |
744 # i18n: "removes" is a keyword |
760 Changesets with no parent changeset in set. |
772 Changesets with no parent changeset in set. |
761 """ |
773 """ |
762 s = getset(repo, subset, x) |
774 s = getset(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] |
|
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] |
765 |
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 |
769 as ``-key`` to sort in descending order. |
787 as ``-key`` to sort in descending order. |