Patchwork [5,of,6,STABLE] revset: add i18n comments to error messages for followlines predicate

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 30, 2017, 8:54 p.m.
Message ID <b46c9c1840f982673f2e.1493585647@speaknoevil>
Download mbox | patch
Permalink /patch/20318/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - April 30, 2017, 8:54 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1493585556 -32400
#      Mon May 01 05:52:36 2017 +0900
# Branch stable
# Node ID b46c9c1840f982673f2eb9108aeec877984b1737
# Parent  091d6b9157da08a36f65102fca85dc6017294a4c
revset: add i18n comments to error messages for followlines predicate

This patch also includes un-quoting "descend" keyword for similarity
to other error messages (this seems too trivial as a separated patch).

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -926,6 +926,7 @@  def followlines(repo, subset, x):
         revs = getset(repo, fullreposet(repo), args['startrev'])
         if len(revs) != 1:
             raise error.ParseError(
+                # i18n: "followlines" is a keyword
                 _("followlines expects exactly one revision"))
         rev = revs.last()
 
@@ -936,9 +937,11 @@  def followlines(repo, subset, x):
         m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=repo[rev])
         files = [f for f in repo[rev] if m(f)]
         if len(files) != 1:
+            # i18n: "followlines" is a keyword
             raise error.ParseError(_("followlines expects exactly one file"))
         fname = files[0]
 
+    # i18n: "followlines" is a keyword
     lr = getrange(args['lines'][0], _("followlines expects a line range"))
     fromline, toline = [getinteger(a, _("line range bounds must be integers"))
                         for a in lr]
@@ -948,7 +951,8 @@  def followlines(repo, subset, x):
     descend = False
     if 'descend' in args:
         descend = getboolean(args['descend'],
-                             _("'descend' argument must be a boolean"))
+                             # i18n: "descend" is a keyword
+                             _("descend argument must be a boolean"))
     if descend:
         rs = generatorset(
             (c.rev() for c, _linerange