[PATCH 2 of 4] hbisect: add functions to return a label for a cset bisection status

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Thu Sep 22 08:29:23 CDT 2011


On Thursday 22 September 2011 091217 Gilles Moris wrote:
> On Thursday 22 September 2011 02:10:18 am Yann E. MORIN wrote:
> > # HG changeset patch
> > # User "Yann E. MORIN" <yann.morin.1998 at anciens.enib.fr>
> > # Date 1316375970 -7200
> > # Node ID 38490dd8eadf5c5e8b77ad2582328d6a4caf1f86
> > # Parent  85607e1e24e03e75410739cfee8465c3520ef0cd
> > hbisect: add functions to return a label for a cset bisection status
> >
> > Add two new functions that return a string containing the bisection status
> > of the node passed in parameter:
> >  - .label(node): return a multi-char string representing the status of node
> >  - .shortlabel(node): return a single-char string representing the status
> >    of node, usually the initial of the label
> >
> >     bisection status    .label()        .shortlabel()
> >     ----------------------------------------------------------
> >     good                'good'          '+'
> >     bad                 'bad'           '-'
> >     skipped             'skip'          's'
> >     untested            'untested'      'u'
> >     ignored             'ignored'       'i'
> >     (others)            None            None
> >
> 
> The list of shortlabel do not match the one returned by the shortlabel 
> function.

Ah, yes. I'll fix that up. Thanks.

> Like Greg, I don't think we should use '+' and '-', that are too much linked 
> to diffs. I would be more conservative than Greg and use just 'g' and 'b' 
> respectively, which match the -g and -b command options.

That was what I started with as well, but I previously had a script that
was printing the bisection status, and I was using +:good, -:bad, <:skipped
(and >:current) in there, so I just reproduced what I was used to.

But as opposed to Greg, i don't think we should use non-ascii glyphs,
because not all commonly available fonts do have such glyphs, and
non-UTF-8-aware terminals are still legions.

Maybe we could add a [bisect] section in ~/.hgrc, such as:

  [bisect]
  glyph.good = G
  glyph.bad = G
  glyph.skip = G
  glyph.untested = G
  glyph.ignored = G

with the defaults being the initials, and letting the user override it in
his|her ~/.hgrc.

Also, we could add colors, with the defaults being to use the terminal's
text color:

  [color]
  bisect.good = color
  bisect.bad = color
  bisect.skip = color
  bisect.untested = color
  bisect.ignored = color

That will come later, I guess; ;-)

> For untested and ignored, I think we can choose '?' and '!', which is close 
> from the 'hg status' output.
> For skipped, 's' is fine but I don't like '<' which symbol is not clear to me. 
> Another idea would be to use 'X' to show that we get rid of those ones.

If we just use the initials for good and bad, then we should do so for all
the other states, I think.

> BTW, I love the idea of the series.

Thank you for the review! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< O_o >==-- '------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |
'------------------------------'-------'------------------'--------------------'


More information about the Mercurial-devel mailing list