# HG changeset patch # User Anton Shestakov # Date 1552107240 -28800 # Node ID 432f2155d10628d6cd17929080fc1c5bd9f391df # Parent a19d8196b0c9ab6d7f1da1aad5752c20a82d09c3 stack: handle external-children just like other states This also fixes color labels: previously when external-children was combined with another state, --color=debug would show something like: [topic.stack.index topic.stack.index.current - external-children|s4] Now there is a separate label for each state. diff -r a19d8196b0c9 -r 432f2155d106 hgext3rd/topic/stack.py --- a/hgext3rd/topic/stack.py Thu Mar 07 22:50:56 2019 +0800 +++ b/hgext3rd/topic/stack.py Sat Mar 09 12:54:00 2019 +0800 @@ -321,27 +321,20 @@ symbol = None states = [] - msg = '' iscurrentrevision = repo.revs('%d and parents()', ctx.rev()) if opts.get('children'): expr = 'children(%d) and merge() - %ld' revisions = repo.revs(expr, ctx.rev(), st.revs[1:]) if len(revisions) > 0: - msg = 'external-children' + states.append('external-children') if iscurrentrevision: symbol = '@' - if msg: - states.append('current - ' + msg) - else: - states.append('current') + states.append('current') if ctx.orphan(): symbol = '$' - if msg: - states.append('orphan - ' + msg) - else: - states.append('orphan') + states.append('orphan') if not isentry: symbol = '^' @@ -351,10 +344,9 @@ # none of the above if statments get executed if not symbol: symbol = ':' - if msg: - states.append(msg) - else: - states.append('clean') + + if not states: + states.append('clean') states.sort()