##// END OF EJS Templates
i18n: add/relocate "i18n keyword" comments for i18n messages in revset.py
FUJIWARA Katsunori -
r17259:e96ad092 stable
parent child Browse files
Show More
@@ -342,6 +342,7 b' def bisect(repo, subset, x):'
342 342 - ``ignored`` : csets ignored due to DAG topology
343 343 - ``current`` : the cset currently being bisected
344 344 """
345 # i18n: "bisect" is a keyword
345 346 status = getstring(x, _("bisect requires a string")).lower()
346 347 state = set(hbisect.get(repo, status))
347 348 return [r for r in subset if r in state]
@@ -509,10 +510,11 b' def converted(repo, subset, x):'
509 510 # There is exactly no chance of resolving the revision, so do a simple
510 511 # string compare and hope for the best
511 512
513 rev = None
512 514 # i18n: "converted" is a keyword
513 rev = None
514 515 l = getargs(x, 0, 1, _('converted takes one or no arguments'))
515 516 if l:
517 # i18n: "converted" is a keyword
516 518 rev = getstring(l[0], _('converted requires a revision'))
517 519
518 520 def _matchvalue(r):
@@ -608,6 +610,7 b' def destination(repo, subset, x):'
608 610 def draft(repo, subset, x):
609 611 """``draft()``
610 612 Changeset in draft phase."""
613 # i18n: "draft" is a keyword
611 614 getargs(x, 0, 0, _("draft takes no arguments"))
612 615 pc = repo._phasecache
613 616 return [r for r in subset if pc.phase(repo, r) == phases.draft]
@@ -615,6 +618,7 b' def draft(repo, subset, x):'
615 618 def extinct(repo, subset, x):
616 619 """``extinct()``
617 620 obsolete changeset with obsolete descendant only."""
621 # i18n: "extinct" is a keyword
618 622 getargs(x, 0, 0, _("extinct takes no arguments"))
619 623 extinctset = set(repo.revs('(obsolete()::) - (::(not obsolete()))'))
620 624 return [r for r in subset if r in extinctset]
@@ -629,11 +633,14 b' def extra(repo, subset, x):'
629 633 use the prefix `literal:`.
630 634 """
631 635
636 # i18n: "extra" is a keyword
632 637 l = getargs(x, 1, 2, _('extra takes at least 1 and at most 2 arguments'))
638 # i18n: "extra" is a keyword
633 639 label = getstring(l[0], _('first argument to extra must be a string'))
634 640 value = None
635 641
636 642 if len(l) > 1:
643 # i18n: "extra" is a keyword
637 644 value = getstring(l[1], _('second argument to extra must be a string'))
638 645 kind, value, matcher = _stringmatcher(value)
639 646
@@ -652,6 +659,7 b' def filelog(repo, subset, x):'
652 659 for performance reasons: see :hg:`help log` for detail.
653 660 """
654 661
662 # i18n: "filelog" is a keyword
655 663 pat = getstring(x, _("filelog requires a pattern"))
656 664 m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath',
657 665 ctx=repo[None])
@@ -755,6 +763,7 b' def _matchfiles(repo, subset, x):'
755 763 hasset = False
756 764 rev, default = None, None
757 765 for arg in l:
766 # i18n: "_matchfiles" is a keyword
758 767 s = getstring(arg, _("_matchfiles requires string arguments"))
759 768 prefix, value = s[:2], s[2:]
760 769 if prefix == 'p:':
@@ -765,15 +774,18 b' def _matchfiles(repo, subset, x):'
765 774 exc.append(value)
766 775 elif prefix == 'r:':
767 776 if rev is not None:
777 # i18n: "_matchfiles" is a keyword
768 778 raise error.ParseError(_('_matchfiles expected at most one '
769 779 'revision'))
770 780 rev = value
771 781 elif prefix == 'd:':
772 782 if default is not None:
783 # i18n: "_matchfiles" is a keyword
773 784 raise error.ParseError(_('_matchfiles expected at most one '
774 785 'default mode'))
775 786 default = value
776 787 else:
788 # i18n: "_matchfiles" is a keyword
777 789 raise error.ParseError(_('invalid _matchfiles prefix: %s') % prefix)
778 790 if not hasset and matchmod.patkind(value) == 'set':
779 791 hasset = True
@@ -936,6 +948,7 b' def node_(repo, subset, x):'
936 948 def obsolete(repo, subset, x):
937 949 """``obsolete()``
938 950 Mutable changeset with a newer version."""
951 # i18n: "obsolete" is a keyword
939 952 getargs(x, 0, 0, _("obsolete takes no arguments"))
940 953 return [r for r in subset if repo[r].obsolete()]
941 954
@@ -1078,6 +1091,7 b' def present(repo, subset, x):'
1078 1091 def public(repo, subset, x):
1079 1092 """``public()``
1080 1093 Changeset in public phase."""
1094 # i18n: "public" is a keyword
1081 1095 getargs(x, 0, 0, _("public takes no arguments"))
1082 1096 pc = repo._phasecache
1083 1097 return [r for r in subset if pc.phase(repo, r) == phases.public]
@@ -1164,6 +1178,7 b' def matching(repo, subset, x):'
1164 1178 ``metadata`` is the default field which is used when no fields are
1165 1179 specified. You can match more than one field at a time.
1166 1180 """
1181 # i18n: "matching" is a keyword
1167 1182 l = getargs(x, 1, 2, _("matching takes 1 or 2 arguments"))
1168 1183
1169 1184 revs = getset(repo, xrange(len(repo)), l[0])
@@ -1171,6 +1186,7 b' def matching(repo, subset, x):'
1171 1186 fieldlist = ['metadata']
1172 1187 if len(l) > 1:
1173 1188 fieldlist = getstring(l[1],
1189 # i18n: "matching" is a keyword
1174 1190 _("matching requires a string "
1175 1191 "as its second argument")).split()
1176 1192
@@ -1228,6 +1244,7 b' def matching(repo, subset, x):'
1228 1244 getfield = _funcs.get(info, None)
1229 1245 if getfield is None:
1230 1246 raise error.ParseError(
1247 # i18n: "matching" is a keyword
1231 1248 _("unexpected field name passed to matching: %s") % info)
1232 1249 getfieldfuncs.append(getfield)
1233 1250 # convert the getfield array of functions into a "getinfo" function
@@ -1270,6 +1287,7 b' def roots(repo, subset, x):'
1270 1287 def secret(repo, subset, x):
1271 1288 """``secret()``
1272 1289 Changeset in secret phase."""
1290 # i18n: "secret" is a keyword
1273 1291 getargs(x, 0, 0, _("secret takes no arguments"))
1274 1292 pc = repo._phasecache
1275 1293 return [r for r in subset if pc.phase(repo, r) == phases.secret]
@@ -1291,6 +1309,7 b' def sort(repo, subset, x):'
1291 1309 l = getargs(x, 1, 2, _("sort requires one or two arguments"))
1292 1310 keys = "rev"
1293 1311 if len(l) == 2:
1312 # i18n: "sort" is a keyword
1294 1313 keys = getstring(l[1], _("sort spec must be a string"))
1295 1314
1296 1315 s = l[0]
@@ -1406,6 +1425,7 b' def tagged(repo, subset, x):'
1406 1425 def unstable(repo, subset, x):
1407 1426 """``unstable()``
1408 1427 Unstable changesets are non-obsolete with obsolete descendants."""
1428 # i18n: "unstable" is a keyword
1409 1429 getargs(x, 0, 0, _("unstable takes no arguments"))
1410 1430 unstableset = set(repo.revs('(obsolete()::) - obsolete()'))
1411 1431 return [r for r in subset if r in unstableset]
General Comments 0
You need to be logged in to leave comments. Login now