hgext3rd/topic/__init__.py
changeset 2988 62201935e1a7
parent 2987 d59d6413bb68
child 2990 c2102598adf5
--- a/hgext3rd/topic/__init__.py	Fri Sep 22 18:01:29 2017 +0200
+++ b/hgext3rd/topic/__init__.py	Tue Sep 26 12:39:11 2017 +0200
@@ -318,17 +318,28 @@
             if ctr is not None:
                 return tr
 
+            # real transaction start
+            ct = self.currenttopic
+            if not ct:
+                return tr
+            ctwasempty = stack.stackdata(self, topic=ct)['changesetcount'] == 0
+
             reporef = weakref.ref(self)
 
             def currenttopicempty(tr):
                 # check active topic emptyness
-                ct = self.currenttopic
-                if not ct:
-                    return
                 repo = reporef()
-                empty = stack.stackdata(repo, topic=ct)['changesetcount'] == 0
-                if empty:
+                csetcount = stack.stackdata(repo, topic=ct)['changesetcount']
+                empty = csetcount == 0
+                if empty and not ctwasempty:
                     ui.status('active topic %r is now empty\n' % ct)
+                if ctwasempty and not empty:
+                    if csetcount == 1:
+                        msg = _('active topic %r grew its first changeset\n')
+                        ui.status(msg % ct)
+                    else:
+                        msg = _('active topic %r grew its %s first changesets\n')
+                        ui.status(msg % (ct, csetcount))
 
             tr.addpostclose('signalcurrenttopicempty', currenttopicempty)
             return tr