##// END OF EJS Templates
scmutil: factor out building of transaction summary callback...
Denis Laxalde -
r34621:b799f116 default
parent child Browse files
Show More
@@ -1206,13 +1206,23 b' def registersummarycallback(repo, otr, t'
1206 1206 def txmatch(sources):
1207 1207 return any(txnname.startswith(source) for source in sources)
1208 1208
1209 if txmatch(_reportobsoletedsource):
1209 categories = []
1210
1211 def reportsummary(func):
1212 """decorator for report callbacks."""
1210 1213 reporef = weakref.ref(repo)
1211 def reportsummary(tr):
1212 """the actual callback reporting the summary"""
1214 def wrapped(tr):
1213 1215 repo = reporef()
1216 func(repo, tr)
1217 newcat = '%2i-txnreport' % len(categories)
1218 otr.addpostclose(newcat, wrapped)
1219 categories.append(newcat)
1220 return wrapped
1221
1222 if txmatch(_reportobsoletedsource):
1223 @reportsummary
1224 def reportobsoleted(repo, tr):
1214 1225 obsoleted = obsutil.getobsoleted(repo, tr)
1215 1226 if obsoleted:
1216 1227 repo.ui.status(_('obsoleted %i changesets\n')
1217 1228 % len(obsoleted))
1218 otr.addpostclose('00-txnreport', reportsummary)
General Comments 0
You need to be logged in to leave comments. Login now