# HG changeset patch # User Aurélien Campéas # Date 1507563750 -7200 # Node ID 033e00be9ce423e2f85646cdb0c58559650c7f01 # Parent 0884856a4143a7d18dcd09c9bfcb9686806094fa topics: use stack rather than stackdata when one only wants the changeset count There might be a significant performance impact. Might resolve #309. diff -r 0884856a4143 -r 033e00be9ce4 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Sat Sep 30 11:11:04 2017 +0100 +++ b/hgext3rd/topic/__init__.py Mon Oct 09 17:42:30 2017 +0200 @@ -322,14 +322,14 @@ ct = self.currenttopic if not ct: return tr - ctwasempty = stack.stackdata(self, topic=ct)['changesetcount'] == 0 + ctwasempty = stack.stack(self, topic=ct).changesetcount == 0 reporef = weakref.ref(self) def currenttopicempty(tr): # check active topic emptyness repo = reporef() - csetcount = stack.stackdata(repo, topic=ct)['changesetcount'] + csetcount = stack.stack(repo, topic=ct).changesetcount empty = csetcount == 0 if empty and not ctwasempty: ui.status('active topic %r is now empty\n' % ct) @@ -480,7 +480,7 @@ ct = repo.currenttopic if clear: - empty = stack.stackdata(repo, topic=ct)['changesetcount'] == 0 + empty = stack.stack(repo, topic=ct).changesetcount == 0 if empty: if ct: ui.status(_('clearing empty topic "%s"\n') % ct) @@ -917,7 +917,7 @@ # rebased commit. We have explicitly stored in config if rebase is # running. ot = repo.currenttopic - empty = stack.stackdata(repo, topic=ot)['changesetcount'] == 0 + empty = stack.stack(repo, topic=ot).changesetcount == 0 if repo.ui.hasconfig('experimental', 'topicrebase'): isrebase = True if repo.ui.configbool('_internal', 'keep-topic'):