[MERGE] Change the `bzr init-repo` default to --trees (#53483)
Wouter van Heyst
larstiq at larstiq.dyndns.org
Fri Feb 2 19:30:49 GMT 2007
On Fri, Feb 02, 2007 at 01:15:32PM -0600, John Arbash Meinel wrote:
> > - Option('trees',
> > - help='Allows branches in repository to have'
> > + Option('no-trees',
> > + help='Disallows branches in repository to have'
> > ' a working tree')]
> > aliases = ["init-repo"]
> > - def run(self, location, format=None, trees=False):
> > + def run(self, location, format=None, no_trees=False):
> > if format is None:
> > format = bzrdir.format_registry.make_bzrdir('default')
>
> ^- I agree with the change (making --trees the default), but I think
> this is not the right way to do it.
>
> I could be wrong, but I think this breaks:
>
> bzr init-repo --trees
There was breakage, but due to non matching argument and option name
(see below), that's why I added tests for them (thanks Jelmer!)
> Because now the "correct" invocation is:
>
> bzr init-repo --no-no-trees
See bzrlib.option.Option.get_negation_names, the negation of a 'no-*' is
'*'.
> I think the correct fix is:
>
> Option('trees', ...)
>
> def run(self, location, format=None, trees=True):
I started out like that, but I wanted the help output to list the
non-default option, which is '--no-trees'. But since that is generated
from the name, the name had to be 'no-trees'. After that, command.run
can't find a no_trees argument, so I renamed trees also. I agree it's
ugly, and part of it could be helped by a Option type that negates.
> Aaron's earlier work means that all boolean options have a (hidden)
> negative of "--no-X". I would like those to be not-hidden, which I think
> is just a small change to the help-text generator, but I don't know exactly.
>
> As an example for the help text, I would just put the negative just
> before the positive, and leave the help text alone. So you would get:
>
>
> --no-trees
> --trees Set whether new branches inside the repository will
> default to having a working tree or not.
>
> I think if we have them next to eachother like this, it is pretty
> obvious, and we just need to be a little careful with the help text to
> make sure it reads correctly.
I'm in favour of such a change, it does leave the problem of picking the
default.
Wouter van Heyst
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070202/ec9adf76/attachment.pgp
More information about the bazaar
mailing list