Rev 6295: Register the options earlier so 'bzr help po_merge.pot_dirs' can be used. in file:///home/vila/src/bzr/bugs/884270-merge-po/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Nov 29 10:21:18 UTC 2011
At file:///home/vila/src/bzr/bugs/884270-merge-po/
------------------------------------------------------------
revno: 6295
revision-id: v.ladeuil+lp at free.fr-20111129102118-pfk6ju6eydbknpxm
parent: v.ladeuil+lp at free.fr-20111129101356-g3iz91m627wgf2ze
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 884270-merge-po
timestamp: Tue 2011-11-29 11:21:18 +0100
message:
Register the options earlier so 'bzr help po_merge.pot_dirs' can be used.
-------------- next part --------------
=== modified file 'bzrlib/plugins/po_merge/__init__.py'
--- a/bzrlib/plugins/po_merge/__init__.py 2011-11-28 16:44:35 +0000
+++ b/bzrlib/plugins/po_merge/__init__.py 2011-11-29 10:21:18 +0000
@@ -51,11 +51,48 @@
"""
-# Since we are a built-in plugin we share the bzrlib version
-from bzrlib import version_info
+from bzrlib import (
+ config,
+ # Since we are a built-in plugin we share the bzrlib version
+ version_info,
+ )
from bzrlib.hooks import install_lazy_named_hook
+config.option_registry.register(config.Option(
+ 'po_merge.command',
+ default='msgmerge -N "{other}" "{pot_file}" -C "{this}" -o "{result}"',
+ help='''\
+Command used to create a conflict-free .po file during merge.
+
+The following parameters are provided by the hook:
+``this`` is the ``.po`` file content before the merge in the current branch,
+``other`` is the ``.po`` file content in the branch merged from,
+``pot_file`` is the path to the ``.pot`` file corresponding to the ``.po``
+file being merged.
+``result`` is the path where ``msgmerge`` will output its result. The hook will
+use the content of this file to produce the resulting ``.po`` file.
+
+The command is invoked at the root of the working tree so all paths are
+relative.
+'''))
+
+
+config.option_registry.register(config.Option(
+ 'po_merge.po_dirs', default='po,debian/po',
+ from_unicode=config.list_from_store,
+ help='List of dirs containing .po files that the hook applies to.'))
+
+
+config.option_registry.register(config.Option(
+ 'po_merge.po_glob', default='*.po',
+ help='Glob matching all ``.po`` files in one of ``po_merge.po_dirs``.'))
+
+config.option_registry.register(config.Option(
+ 'po_merge.pot_glob', default='*.pot',
+ help='Glob matching the ``.pot`` file in one of ``po_merge.po_dirs``.'))
+
+
def po_merge_hook(merger):
"""Merger.merge_file_content hook for bzr-format NEWS files."""
from bzrlib.plugins.po_merge.po_merge import PoMerger
=== modified file 'bzrlib/plugins/po_merge/po_merge.py'
--- a/bzrlib/plugins/po_merge/po_merge.py 2011-11-29 10:13:56 +0000
+++ b/bzrlib/plugins/po_merge/po_merge.py 2011-11-29 10:21:18 +0000
@@ -38,40 +38,6 @@
""")
-config.option_registry.register(config.Option(
- 'po_merge.command',
- default='msgmerge -N "{other}" "{pot_file}" -C "{this}" -o "{result}"',
- help='''\
-Command used to create a conflict-free .po file during merge.
-
-The following parameters are provided by the hook:
-``this`` is the ``.po`` file content before the merge in the current branch,
-``other`` is the ``.po`` file content in the branch merged from,
-``pot_file`` is the path to the ``.pot`` file corresponding to the ``.po``
-file being merged.
-``result`` is the path where ``msgmerge`` will output its result. The hook will
-use the content of this file to produce the resulting ``.po`` file.
-
-The command is invoked at the root of the working tree so all paths are
-relative.
-'''))
-
-
-config.option_registry.register(config.Option(
- 'po_merge.po_dirs', default='po,debian/po',
- from_unicode=config.list_from_store,
- help='List of dirs containing .po files that the hook applies to.'))
-
-
-config.option_registry.register(config.Option(
- 'po_merge.po_glob', default='*.po',
- help='Glob matching all ``.po`` files in one of ``po_merge.po_dirs``.'))
-
-config.option_registry.register(config.Option(
- 'po_merge.pot_glob', default='*.pot',
- help='Glob matching the ``.pot`` file in one of ``po_merge.po_dirs``.'))
-
-
class PoMerger(merge.PerFileMerger):
"""Merge .po files."""
More information about the bazaar-commits
mailing list