hgext3rd/topic/__init__.py
changeset 4652 b72cd597a887
parent 4647 228caeb8b7af
child 4658 89c1b739fabe
--- a/hgext3rd/topic/__init__.py	Wed May 08 15:57:54 2019 +0800
+++ b/hgext3rd/topic/__init__.py	Wed May 08 16:00:34 2019 +0800
@@ -735,8 +735,8 @@
     ct = repo.currenttopic
     if clear:
         if ct:
-            empty = stack.stack(repo, topic=ct).changesetcount == 0
-            if empty:
+            st = stack.stack(repo, topic=ct)
+            if not st:
                 ui.status(_('clearing empty topic "%s"\n') % ct)
         return _changecurrenttopic(repo, None)
 
@@ -1234,8 +1234,8 @@
             if t and t != ot:
                 repo.ui.status(_("switching to topic %s\n") % t)
             if ot and not t:
-                empty = stack.stack(repo, topic=ot).changesetcount == 0
-                if empty:
+                st = stack.stack(repo, topic=ot)
+                if not st:
                     repo.ui.status(_('clearing empty topic "%s"\n') % ot)
         elif ist0:
             repo.ui.status(_("preserving the current topic '%s'\n") % ot)