[PATCH 3 of 6 STABLE] revset: refactor to make xgettext put i18n comments into hg.pot file

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Sun Jul 31 17:41:03 EDT 2016


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1469999306 -32400
#      Mon Aug 01 06:08:26 2016 +0900
# Branch stable
# Node ID bd0f925780188ebd4b9b9a1a9cff047b54618e69
# Parent  e1d879c97b9cb59ee82805a0123f8e3653e2cd6e
revset: refactor to make xgettext put i18n comments into hg.pot file

xgettext expects both "_()" and (a part of) text to be placed at just
next line of "i18n:" comment.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1866,8 +1866,8 @@ def _getsortargs(x):
 
     if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags):
         # i18n: "topo" is a keyword
-        raise error.ParseError(_(
-            'topo sort order cannot be combined with other sort keys'))
+        raise error.ParseError(_('topo sort order cannot be combined '
+                                 'with other sort keys'))
 
     opts = {}
     if 'topo.firstbranch' in args:
@@ -1875,9 +1875,8 @@ def _getsortargs(x):
             opts['topo.firstbranch'] = args['topo.firstbranch']
         else:
             # i18n: "topo" and "topo.firstbranch" are keywords
-            raise error.ParseError(_(
-                'topo.firstbranch can only be used when using the topo sort '
-                'key'))
+            raise error.ParseError(_('topo.firstbranch can only be used '
+                                     'when using the topo sort key'))
 
     return args['set'], keyflags, opts
 


More information about the Mercurial-devel mailing list