Bug: bzr log --long --short --line

John A Meinel john at arbash-meinel.com
Sat Feb 11 19:14:06 GMT 2006


Alexander Belchenko wrote:
> When I test Aaron's defaults for commands I discover this behaviour of
> log command: if for log command specified any combination of --long,
> --short, --line options then log will be printed with shortest possible
> variant. I.e.:
> 
> bzr log --long --short -> use short output
> bzr log --long --short --line -> use line output.
> 
> I think that log command probably should report warning/error when it
> found more than one format option. But unpleasant side effect from this
> bug is that when I define defaults for log command:
> 
> log = --short -r-5..-1
> 
> Then I'm unable to access to long log without --no-default option, i.e.:
> 
> bzr --no-defaults log
> 
> I'm have no idea how this behaviour could/should be fixed.
> 
> -- 
> Alexander

We should switch to optparse and use:

p.add_option('--line', dest='log_format', action='store_const',
	const='line', help='display the log message on a single line')
p.add_option('--short', dest='log_format', action='store_const',
	const='short', help='use short output for log formatting')
p.add_option('--long', dest='log_format', action='store_const',
	default=None,
	const='long', help='use long ouptut for the log format')


opts, args = p.parse_args(args)
if opts.log_format == None:
  opts.log_format = default_log_format.

Then in the future, optparse would allow us to supply multiple
arguments, and handle properly overloading them.

I'm starting to agree with Denys that we should switch to optparse with
double parsing the line. And just require that "--no-plugins" and
"--builtins" come before the command, since they effect what commands
will be available.

I don't think it would be too hard to shoe-horn our current
functionality into optparse. All we need is a translation layer, that
would take our current Option() objects, and build up a
optparse.OptionParser() that does the right thing.

Care would also need to be taken for --help, since the default
implementation does not do what we want.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060211/09bad488/attachment.pgp 


More information about the bazaar mailing list