hgext3rd/topic/stack.py
changeset 2670 f5d52fa1cd55
parent 2669 b933a8068c17
child 2684 90e11985d0cc
equal deleted inserted replaced
2669:b933a8068c17 2670:f5d52fa1cd55
    53     label = 'topic'
    53     label = 'topic'
    54     if topic == repo.currenttopic:
    54     if topic == repo.currenttopic:
    55         label = 'topic.active'
    55         label = 'topic.active'
    56 
    56 
    57     data = stackdata(repo, branch=branch, topic=topic)
    57     data = stackdata(repo, branch=branch, topic=topic)
    58     fm.plain(_('### topic: %s') % ui.label(topic, label),
    58     if topic is not None:
    59              label='topic.stack.summary.topic')
    59         fm.plain(_('### topic: %s')
       
    60                  % ui.label(topic, label),
       
    61                  label='topic.stack.summary.topic')
    60 
    62 
    61     if 1 < data['headcount']:
    63         if 1 < data['headcount']:
    62         fm.plain(' (')
    64             fm.plain(' (')
    63         fm.plain('%d heads' % data['headcount'],
    65             fm.plain('%d heads' % data['headcount'],
    64                  label='topic.stack.summary.headcount.multiple')
    66                      label='topic.stack.summary.headcount.multiple')
    65         fm.plain(')')
    67             fm.plain(')')
    66     fm.plain('\n')
    68         fm.plain('\n')
    67     fm.plain(_('### branch: %s')
    69     fm.plain(_('### branch: %s')
    68              % '+'.join(data['branches']), # XXX handle multi branches
    70              % '+'.join(data['branches']), # XXX handle multi branches
    69              label='topic.stack.summary.branches')
    71              label='topic.stack.summary.branches')
    70     if data['behindcount'] == -1:
    72     if topic is None:
    71         fm.plain(', ')
    73         if 1 < data['headcount']:
    72         fm.plain('ambigious rebase destination', label='topic.stack.summary.behinderror')
    74             fm.plain(' (')
    73     elif data['behindcount']:
    75             fm.plain('%d heads' % data['headcount'],
    74         fm.plain(', ')
    76                      label='topic.stack.summary.headcount.multiple')
    75         fm.plain('%d behind' % data['behindcount'], label='topic.stack.summary.behindcount')
    77             fm.plain(')')
       
    78     else:
       
    79         if data['behindcount'] == -1:
       
    80             fm.plain(', ')
       
    81             fm.plain('ambigious rebase destination', label='topic.stack.summary.behinderror')
       
    82         elif data['behindcount']:
       
    83             fm.plain(', ')
       
    84             fm.plain('%d behind' % data['behindcount'], label='topic.stack.summary.behindcount')
    76     fm.plain('\n')
    85     fm.plain('\n')
    77 
    86 
    78     for idx, r in enumerate(getstack(repo, branch=branch, topic=topic), 1):
    87     for idx, r in enumerate(getstack(repo, branch=branch, topic=topic), 1):
    79         ctx = repo[r]
    88         ctx = repo[r]
    80         p1 = ctx.p1()
    89         p1 = ctx.p1()