Skip to content
Snippets Groups Projects
Commit aa2e908c521e authored by Yann E. MORIN's avatar Yann E. MORIN
Browse files

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'              'G'
    good (implicit)     'good (implicit)'   'G'
    bad                 'bad'               'B'
    bad (implicit)      'bad (implicit)'    'B'
    skipped             'skip'              'S'
    untested            'untested'          'U'
    ignored             'ignored'           'I'
    (others)            None                None

There is no point in returning 'range' or 'pruned', as these get covered
by another, more meaningful status in the table above.

In case the node is not being bisected, the functions return None to leave
it up to the caller to decide what to print (nothing, an empty space, or
whatever else suits).

Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
parent fa0a464e4ca5
No related branches found
No related tags found
No related merge requests found
......@@ -220,3 +220,32 @@
else:
raise error.ParseError(_('invalid bisect state'))
def label(repo, node, short=False):
rev = repo.changelog.rev(node)
# Try explicit sets
if rev in get(repo, 'good'):
return _('good')
if rev in get(repo, 'bad'):
return _('bad')
if rev in get(repo, 'skip'):
return _('skipped')
if rev in get(repo, 'untested'):
return _('untested')
if rev in get(repo, 'ignored'):
return _('ignored')
# Try implicit sets
if rev in get(repo, 'goods'):
return _('good (implicit)')
if rev in get(repo, 'bads'):
return _('bad (implicit)')
return None
def shortlabel(label):
if label:
return label[0].upper()
return None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment