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