hgext3rd/topic/stack.py
changeset 2937 b54abc7e80e2
parent 2936 3a9303b7b648
child 2938 9872526fc39f
equal deleted inserted replaced
2936:3a9303b7b648 2937:b54abc7e80e2
   205     label = 'topic'
   205     label = 'topic'
   206     if topic == repo.currenttopic:
   206     if topic == repo.currenttopic:
   207         label = 'topic.active'
   207         label = 'topic.active'
   208 
   208 
   209     data = stackdata(repo, branch=branch, topic=topic)
   209     data = stackdata(repo, branch=branch, topic=topic)
       
   210     empty = False
       
   211     if data['changesetcount'] == 0:
       
   212         empty = True
   210     if topic is not None:
   213     if topic is not None:
   211         fm.plain(_('### topic: %s')
   214         fm.plain(_('### topic: %s')
   212                  % ui.label(topic, label),
   215                  % ui.label(topic, label),
   213                  label='topic.stack.summary.topic')
   216                  label='topic.stack.summary.topic')
   214 
   217 
   234         elif data['behindcount']:
   237         elif data['behindcount']:
   235             fm.plain(', ')
   238             fm.plain(', ')
   236             fm.plain('%d behind' % data['behindcount'], label='topic.stack.summary.behindcount')
   239             fm.plain('%d behind' % data['behindcount'], label='topic.stack.summary.behindcount')
   237     fm.plain('\n')
   240     fm.plain('\n')
   238 
   241 
       
   242     if empty:
       
   243         fm.plain(_("(stack is empty)\n"))
       
   244 
   239     for idx, r in enumerate(stack(repo, branch=branch, topic=topic), 0):
   245     for idx, r in enumerate(stack(repo, branch=branch, topic=topic), 0):
   240         ctx = repo[r]
   246         ctx = repo[r]
   241         # special case for t0, b0 as it's hard to plugin into rest of the logic
   247         # special case for t0, b0 as it's hard to plugin into rest of the logic
   242         if idx == 0:
   248         if idx == 0:
   243             # t0, b0 can be None
   249             # t0, b0 can be None