[MERGE] Tweak log -n UI to support +/- as fully expanded/collapsed

Ian Clatworthy ian.clatworthy at internode.on.net
Fri Jan 30 09:21:13 GMT 2009


Vincent Ladeuil wrote:
>>>>>> "Ian" == Ian Clatworthy <ian.clatworthy at internode.on.net> writes:
> 
>     Ian> As the most common use cases for log's new -n option are:
>     Ian> * show me all levels of nested revisions
>     Ian> * show me just the top level
> 
>     Ian> I think it's worth having the + and - symbols as aliases
>     Ian> for 0 and 1 respectively.
> 
> Can you elaborate on that ?

I think -n1 reads nicely but -n0 feels slightly strange.
I thought about -n* but adding a space (-n *) would cause
chaos in most shells. + and - are often (or were often) used
in GUI tree widgets to represent expand/collapse.

>     Ian>  def _parse_levels(s):
>     Ian> +    if s == '-':
>     Ian> +        return 1
>     Ian> +    if s == '+':
>     Ian> +        return 0
>     Ian>      try:
>     Ian>          return int(s)
>     Ian>      except ValueError:
> 
> You still don't trap negative values so I still think you'd
> better use type=int in the option declaration.

What would a negative value mean?

Also, I can't find anywhere in Bazaar that uses type=int now.
I pretty sure when I tried that months ago, it didn't work
because of how we wrap Python's OptionParser stuff with our
own enhancements. It might be fine now though.

Ian C.




More information about the bazaar mailing list