equal
deleted
inserted
replaced
1201 ] |
1201 ] |
1202 |
1202 |
1203 def registersummarycallback(repo, otr, txnname=''): |
1203 def registersummarycallback(repo, otr, txnname=''): |
1204 """register a callback to issue a summary after the transaction is closed |
1204 """register a callback to issue a summary after the transaction is closed |
1205 """ |
1205 """ |
1206 for source in _reportobsoletedsource: |
1206 def txmatch(sources): |
1207 if txnname.startswith(source): |
1207 return any(txnname.startswith(source) for source in sources) |
1208 reporef = weakref.ref(repo) |
1208 |
1209 def reportsummary(tr): |
1209 if txmatch(_reportobsoletedsource): |
1210 """the actual callback reporting the summary""" |
1210 reporef = weakref.ref(repo) |
1211 repo = reporef() |
1211 def reportsummary(tr): |
1212 obsoleted = obsutil.getobsoleted(repo, tr) |
1212 """the actual callback reporting the summary""" |
1213 if obsoleted: |
1213 repo = reporef() |
1214 repo.ui.status(_('obsoleted %i changesets\n') |
1214 obsoleted = obsutil.getobsoleted(repo, tr) |
1215 % len(obsoleted)) |
1215 if obsoleted: |
1216 otr.addpostclose('00-txnreport', reportsummary) |
1216 repo.ui.status(_('obsoleted %i changesets\n') |
1217 break |
1217 % len(obsoleted)) |
|
1218 otr.addpostclose('00-txnreport', reportsummary) |