diff -r 18309380fb88 -r b799f11644d8 mercurial/scmutil.py --- a/mercurial/scmutil.py Sun Oct 01 09:52:44 2017 +0200 +++ b/mercurial/scmutil.py Wed Oct 04 18:49:09 2017 +0200 @@ -1206,13 +1206,23 @@ def txmatch(sources): return any(txnname.startswith(source) for source in sources) - if txmatch(_reportobsoletedsource): + categories = [] + + def reportsummary(func): + """decorator for report callbacks.""" reporef = weakref.ref(repo) - def reportsummary(tr): - """the actual callback reporting the summary""" + def wrapped(tr): repo = reporef() + func(repo, tr) + newcat = '%2i-txnreport' % len(categories) + otr.addpostclose(newcat, wrapped) + categories.append(newcat) + return wrapped + + if txmatch(_reportobsoletedsource): + @reportsummary + def reportobsoleted(repo, tr): obsoleted = obsutil.getobsoleted(repo, tr) if obsoleted: repo.ui.status(_('obsoleted %i changesets\n') % len(obsoleted)) - otr.addpostclose('00-txnreport', reportsummary)