diff hgext3rd/topic/stack.py @ 4652:b72cd597a887

stack: check if stack is empty more pythonically
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 08 May 2019 16:00:34 +0800
parents 55c347b4874f
children fd4f422b0b57
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py	Wed May 08 15:57:54 2019 +0800
+++ b/hgext3rd/topic/stack.py	Wed May 08 16:00:34 2019 +0800
@@ -248,9 +248,6 @@
         label = 'topic.active'
 
     st = stack(repo, branch, topic)
-    empty = False
-    if st.changesetcount == 0:
-        empty = True
     if topic is not None:
         fm.plain(_('### topic: %s')
                  % ui.label(topic, label),
@@ -281,7 +278,7 @@
             fm.plain('%d behind' % st.behindcount, label='topic.stack.summary.behindcount')
     fm.plain('\n')
 
-    if empty:
+    if not st:
         fm.plain(_("(stack is empty)\n"))
 
     st = stack(repo, branch=branch, topic=topic)