Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 29646:a8a5dd8986f0 stable
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 01 Aug 2016 06:08:26 +0900 |
parents | 9e8d258708bb |
children | 5004ef47f437 e5b794063fd4 |
comparison
equal
deleted
inserted
replaced
29645:3b4d69b3988d | 29646:a8a5dd8986f0 |
---|---|
1864 raise error.ParseError(_("unknown sort key %r") % fk) | 1864 raise error.ParseError(_("unknown sort key %r") % fk) |
1865 keyflags.append((k, reverse)) | 1865 keyflags.append((k, reverse)) |
1866 | 1866 |
1867 if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags): | 1867 if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags): |
1868 # i18n: "topo" is a keyword | 1868 # i18n: "topo" is a keyword |
1869 raise error.ParseError(_( | 1869 raise error.ParseError(_('topo sort order cannot be combined ' |
1870 'topo sort order cannot be combined with other sort keys')) | 1870 'with other sort keys')) |
1871 | 1871 |
1872 opts = {} | 1872 opts = {} |
1873 if 'topo.firstbranch' in args: | 1873 if 'topo.firstbranch' in args: |
1874 if any(k == 'topo' for k, reverse in keyflags): | 1874 if any(k == 'topo' for k, reverse in keyflags): |
1875 opts['topo.firstbranch'] = args['topo.firstbranch'] | 1875 opts['topo.firstbranch'] = args['topo.firstbranch'] |
1876 else: | 1876 else: |
1877 # i18n: "topo" and "topo.firstbranch" are keywords | 1877 # i18n: "topo" and "topo.firstbranch" are keywords |
1878 raise error.ParseError(_( | 1878 raise error.ParseError(_('topo.firstbranch can only be used ' |
1879 'topo.firstbranch can only be used when using the topo sort ' | 1879 'when using the topo sort key')) |
1880 'key')) | |
1881 | 1880 |
1882 return args['set'], keyflags, opts | 1881 return args['set'], keyflags, opts |
1883 | 1882 |
1884 @predicate('sort(set[, [-]key... [, ...]])', safe=True) | 1883 @predicate('sort(set[, [-]key... [, ...]])', safe=True) |
1885 def sort(repo, subset, x): | 1884 def sort(repo, subset, x): |