Rev 6304: (gz) Include registry option value switches in help style checking test in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Fri Nov 25 17:49:45 UTC 2011


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6304 [merge]
revision-id: pqm at pqm.ubuntu.com-20111125174944-cwzx7kzwxgw9a0u7
parent: pqm at pqm.ubuntu.com-20111125165338-tzw8uqnq48801bu4
parent: martin.packman at canonical.com-20111124170530-6xjwet8bnvggs2zt
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-11-25 17:49:44 +0000
message:
  (gz) Include registry option value switches in help style checking test
   (Martin Packman)
modified:
  bzrlib/conflicts.py            conflicts.py-20051001061850-78ef952ba63d2b42
  bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
  bzrlib/option.py               option.py-20051014052914-661fb36e76e7362f
  bzrlib/tests/test_options.py   testoptions.py-20051014093702-96457cfc86319a8f
=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py	2011-09-16 15:39:47 +0000
+++ b/bzrlib/conflicts.py	2011-11-23 18:59:43 +0000
@@ -80,13 +80,13 @@
 
 
 resolve_action_registry.register(
-    'done', 'done', 'Marks the conflict as resolved' )
+    'done', 'done', 'Marks the conflict as resolved.')
 resolve_action_registry.register(
     'take-this', 'take_this',
-    'Resolve the conflict preserving the version in the working tree' )
+    'Resolve the conflict preserving the version in the working tree.')
 resolve_action_registry.register(
     'take-other', 'take_other',
-    'Resolve the conflict taking the merged version into account' )
+    'Resolve the conflict taking the merged version into account.')
 resolve_action_registry.default_key = 'done'
 
 class ResolveActionOption(option.RegistryOption):

=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py	2011-11-15 15:27:38 +0000
+++ b/bzrlib/log.py	2011-11-23 18:59:43 +0000
@@ -1807,13 +1807,13 @@
 
 
 log_formatter_registry.register('short', ShortLogFormatter,
-                                'Moderately short log format')
+                                'Moderately short log format.')
 log_formatter_registry.register('long', LongLogFormatter,
-                                'Detailed log format')
+                                'Detailed log format.')
 log_formatter_registry.register('line', LineLogFormatter,
-                                'Log format with one line per revision')
+                                'Log format with one line per revision.')
 log_formatter_registry.register('gnu-changelog', GnuChangelogLogFormatter,
-                                'Format used by GNU ChangeLog files')
+                                'Format used by GNU ChangeLog files.')
 
 
 def register_formatter(name, formatter):

=== modified file 'bzrlib/option.py'
--- a/bzrlib/option.py	2011-11-23 12:43:23 +0000
+++ b/bzrlib/option.py	2011-11-23 18:59:43 +0000
@@ -526,13 +526,13 @@
 
 _merge_type_registry = MergeTypeRegistry()
 _merge_type_registry.register_lazy('diff3', 'bzrlib.merge', 'Diff3Merger',
-                                   "Merge using external diff3")
+                                   "Merge using external diff3.")
 _merge_type_registry.register_lazy('lca', 'bzrlib.merge', 'LCAMerger',
-                                   "LCA-newness merge")
+                                   "LCA-newness merge.")
 _merge_type_registry.register_lazy('merge3', 'bzrlib.merge', 'Merge3Merger',
-                                   "Native diff3-style merge")
+                                   "Native diff3-style merge.")
 _merge_type_registry.register_lazy('weave', 'bzrlib.merge', 'WeaveMerger',
-                                   "Weave-based merge")
+                                   "Weave-based merge.")
 
 # Declare the standard options
 _standard_option('help', short_name='h',

=== modified file 'bzrlib/tests/test_options.py'
--- a/bzrlib/tests/test_options.py	2011-11-23 11:19:21 +0000
+++ b/bzrlib/tests/test_options.py	2011-11-24 17:01:07 +0000
@@ -352,16 +352,22 @@
     def test_option_grammar(self):
         msgs = []
         # Option help should be written in sentence form, and have a final
-        # period and be all on a single line, because the display code will
-        # wrap it.
-        option_re = re.compile(r'^[A-Z][^\n]+\.$')
+        # period with an optional bracketed suffix. All the text should be on
+        # one line, because the display code will wrap it.
+        option_re = re.compile(r'^[A-Z][^\n]+\.(?: \([^\n]+\))?$')
         for scope, opt in self.get_builtin_command_options():
-            if not opt.help:
-                msgs.append('%-16s %-16s %s' %
-                       ((scope or 'GLOBAL'), opt.name, 'NO HELP'))
-            elif not option_re.match(opt.help):
-                msgs.append('%-16s %-16s %s' %
-                        ((scope or 'GLOBAL'), opt.name, opt.help))
+            for name, _, _, helptxt in opt.iter_switches():
+                if name != opt.name:
+                    name = "/".join([opt.name, name])
+                if not helptxt:
+                    msgs.append('%-16s %-16s %s' %
+                           ((scope or 'GLOBAL'), name, 'NO HELP'))
+                elif not option_re.match(helptxt):
+                    if name.startswith("format/"):
+                        # Don't complain about the odd format registry help
+                        continue
+                    msgs.append('%-16s %-16s %s' %
+                            ((scope or 'GLOBAL'), name, helptxt))
         if msgs:
             self.fail("The following options don't match the style guide:\n"
                     + '\n'.join(msgs))




More information about the bazaar-commits mailing list