diff -r 37b4375b1221 -r 18309380fb88 mercurial/scmutil.py --- a/mercurial/scmutil.py Wed Oct 11 05:23:45 2017 +0200 +++ b/mercurial/scmutil.py Sun Oct 01 09:52:44 2017 +0200 @@ -1203,15 +1203,16 @@ def registersummarycallback(repo, otr, txnname=''): """register a callback to issue a summary after the transaction is closed """ - for source in _reportobsoletedsource: - if txnname.startswith(source): - reporef = weakref.ref(repo) - def reportsummary(tr): - """the actual callback reporting the summary""" - repo = reporef() - obsoleted = obsutil.getobsoleted(repo, tr) - if obsoleted: - repo.ui.status(_('obsoleted %i changesets\n') - % len(obsoleted)) - otr.addpostclose('00-txnreport', reportsummary) - break + def txmatch(sources): + return any(txnname.startswith(source) for source in sources) + + if txmatch(_reportobsoletedsource): + reporef = weakref.ref(repo) + def reportsummary(tr): + """the actual callback reporting the summary""" + repo = reporef() + obsoleted = obsutil.getobsoleted(repo, tr) + if obsoleted: + repo.ui.status(_('obsoleted %i changesets\n') + % len(obsoleted)) + otr.addpostclose('00-txnreport', reportsummary)