[MERGE] Man page doesn't list hidden options (#131667)
Ian Clatworthy
ian.clatworthy at internode.on.net
Tue Aug 28 01:29:13 BST 2007
Aaron Bentley wrote:
> This patch fixes a bug in man page generation that caused it to list
> hidden options.
bb: tweak
See suggestion below.
> === modified file 'bzrlib/tests/test_options.py'
> --- bzrlib/tests/test_options.py 2007-08-09 05:16:53 +0000
> +++ bzrlib/tests/test_options.py 2007-08-24 19:27:23 +0000
> @@ -296,3 +296,13 @@
> if msgs:
> self.fail("The following options don't match the style guide:\n"
> + '\n'.join(msgs))
> +
> + def test_is_hidden(self):
> + registry = bzrdir.BzrDirFormatRegistry()
> + registry.register_metadir('hidden', 'RepositoryFormatKnit1',
> + 'two help', hidden=True)
> + registry.register_metadir('visible', 'RepositoryFormatKnit1',
> + 'two help', hidden=False)
> + format = option.RegistryOption('format', '', registry, str)
> + self.assertTrue(format.is_hidden('hidden'))
> + self.assertFalse(format.is_hidden('visible'))
>
I think this test would be clearer if the formats being registered
("hidden" and "visible") were mapped to different internal names, not
both mapped to RepositoryFormatKnit1. Likewise I suggest changing the
help to "format 1" and "format 2" say, instead of both being the same.
FWIW, in the longer term, I'd like to rework the man page generation so
that it reuses Command.get_help_text() - which doesn't have this bug -
instead of doing it's own thing. The fix above is fine though.
Ian C.
More information about the bazaar
mailing list