Rev 6284: Shorter name for the branch content helper. in file:///home/vila/src/bzr/bugs/884270-merge-po/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Nov 28 15:17:00 UTC 2011


At file:///home/vila/src/bzr/bugs/884270-merge-po/

------------------------------------------------------------
revno: 6284
revision-id: v.ladeuil+lp at free.fr-20111128151659-aafu1y91s05aippx
parent: v.ladeuil+lp at free.fr-20111124104743-rxqwhmzqu5k17f24
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 884270-merge-po
timestamp: Mon 2011-11-28 16:16:59 +0100
message:
  Shorter name for the branch content helper.
-------------- next part --------------
=== modified file 'bzrlib/plugins/po_merge/po_merge.py'
--- a/bzrlib/plugins/po_merge/po_merge.py	2011-11-24 10:47:43 +0000
+++ b/bzrlib/plugins/po_merge/po_merge.py	2011-11-28 15:16:59 +0000
@@ -91,7 +91,7 @@
 
     def file_matches(self, params):
         """Return True if merge_matching should be called on this file."""
-        if not self.po_files or not self.pot_file:
+        if not self.po_files or not self.pot_file or not self.command:
             # Return early if there is no options defined
             return False
         match = False
@@ -113,9 +113,9 @@
         if self.merger.this_tree.has_filename(pot_path):
             self.selected_pot_file = pot_path
             self.selected_po_file = po_path
-            # FIXME: I can't find a way to know if the .pot file has conflicts
-            # *during* the merge itself. So either the actual content on disk
-            # is fine and msgmerge will work OR it's not and it will
+            # FIXME: I can't find an easy way to know if the .pot file has
+            # conflicts *during* the merge itself. So either the actual content
+            # on disk is fine and msgmerge will work OR it's not and it will
             # fail. Conversely, either the result is ok for the user and he's
             # happy OR the user needs to resolve the conflicts in the .pot file
             # and use remerge. -- vila 2011-11-24

=== modified file 'bzrlib/plugins/po_merge/tests/test_blackbox_po_merge.py'
--- a/bzrlib/plugins/po_merge/tests/test_blackbox_po_merge.py	2011-11-24 10:47:43 +0000
+++ b/bzrlib/plugins/po_merge/tests/test_blackbox_po_merge.py	2011-11-28 15:16:59 +0000
@@ -42,8 +42,8 @@
 
     def test_merge_with_hook_gives_unexpected_results(self):
         # Since the conflicts in .pot are not seen *during* the merge, the .po
-        # merge triggers the hook and create no conflicts. But the .pot used is
-        # the one present in the tree *before* the merge.
+        # merge triggers the hook and creates no conflicts. But the .pot used
+        # is the one present in the tree *before* the merge.
         self.run_script("""\
 $ bzr branch adduser -rrevid:this work
 2>Branched 2 revisions.
@@ -72,7 +72,7 @@
 """)
         # Fix the conflicts in the .pot file
         with open('adduser.pot', 'w') as f:
-            f.write(_adduser_branch['resolved_pot'])
+            f.write(_Adduser['resolved_pot'])
         # Tell bzr the conflict is resolved
         self.run_script("""\
 $ bzr resolve adduser.pot
@@ -106,21 +106,21 @@
                            [('add', ('', 'root-id', 'directory', '')),
                             # Create empty files
                             ('add', ('adduser.pot', 'pot-id', 'file',
-                                     _adduser_branch['base_pot'])),
+                                     _Adduser['base_pot'])),
                             ('add', ('fr.po', 'po-id', 'file',
-                                     _adduser_branch['base_po'])),
+                                     _Adduser['base_po'])),
             ])
     # The 'other' branch
     builder.build_snapshot('other', ['base'],
                            [('modify', ('pot-id',
-                                        _adduser_branch['other_pot'])),
+                                        _Adduser['other_pot'])),
                             ('modify', ('po-id',
-                                        _adduser_branch['other_po'])),
+                                        _Adduser['other_po'])),
                             ])
     # The 'this' branch
     builder.build_snapshot('this', ['base'],
-                           [('modify', ('pot-id', _adduser_branch['this_pot'])),
-                            ('modify', ('po-id', _adduser_branch['this_po'])),
+                           [('modify', ('pot-id', _Adduser['this_pot'])),
+                            ('modify', ('po-id', _Adduser['this_po'])),
                             ])
     # builder.get_branch() tip is now 'this'
     builder.finish_series()
@@ -139,9 +139,9 @@
         self.run_script("""\
 $ bzr branch adduser -rrevid:%(revid)s %(branch_name)s
 """ % env, null_output_matches_anything=True)
-        self.assertFileEqual(_adduser_branch['%(revid)s_pot' % env],
+        self.assertFileEqual(_Adduser['%(revid)s_pot' % env],
                              '%(branch_name)s/adduser.pot' % env)
-        self.assertFileEqual(_adduser_branch['%(revid)s_po' % env],
+        self.assertFileEqual(_Adduser['%(revid)s_po' % env],
                              '%(branch_name)s/fr.po' % env )
 
     def test_base(self):
@@ -158,7 +158,7 @@
 # details. This is declared at the end of the file to avoid cluttering the
 # beginning of the file.
 
-_adduser_branch = dict(
+_Adduser = dict(
     base_pot = r"""# SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.



More information about the bazaar-commits mailing list