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

login
register
mail settings
Submitter Katsunori FUJIWARA
Date July 31, 2016, 9:41 p.m.
Message ID <bd0f925780188ebd4b9b.1470001263@feefifofum>
Download mbox | patch
Permalink /patch/16008/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - July 31, 2016, 9:41 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@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.

Patch

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