##// END OF EJS Templates
perf: have a generic "clearstorecache" function...
marmoute -
r32731:6f791ca7 default
parent child Browse files
Show More
@@ -357,6 +357,14 b' def repocleartagscachefunc(repo):'
357 357 # - perf.py itself has been available since 1.1 (or eb240755386d)
358 358 raise error.Abort(("tags API of this hg command is unknown"))
359 359
360 # utilities to clear cache
361
362 def clearfilecache(repo, attrname):
363 unfi = repo.unfiltered()
364 if attrname in vars(unfi):
365 delattr(unfi, attrname)
366 unfi._filecache.pop(attrname, None)
367
360 368 # perf commands
361 369
362 370 @command('perfwalk', formatteropts)
@@ -1259,12 +1267,6 b' def perfrevset(ui, repo, expr, clear=Fal'
1259 1267 timer(d)
1260 1268 fm.end()
1261 1269
1262 def _clearobsstore(repo):
1263 unfi = repo.unfiltered()
1264 if 'obsstore' in vars(unfi):
1265 del unfi.obsstore
1266 del unfi._filecache['obsstore']
1267
1268 1270 @command('perfvolatilesets',
1269 1271 [('', 'clear-obsstore', False, 'drop obsstore between each call.'),
1270 1272 ] + formatteropts)
@@ -1279,7 +1281,7 b' def perfvolatilesets(ui, repo, *names, *'
1279 1281 def d():
1280 1282 repo.invalidatevolatilesets()
1281 1283 if opts['clear_obsstore']:
1282 _clearobsstore(repo)
1284 clearfilecache(repo, 'obsstore')
1283 1285 obsolete.getrevs(repo, name)
1284 1286 return d
1285 1287
@@ -1294,7 +1296,7 b' def perfvolatilesets(ui, repo, *names, *'
1294 1296 def d():
1295 1297 repo.invalidatevolatilesets()
1296 1298 if opts['clear_obsstore']:
1297 _clearobsstore(repo)
1299 clearfilecache(repo, 'obsstore')
1298 1300 repoview.filterrevs(repo, name)
1299 1301 return d
1300 1302
General Comments 0
You need to be logged in to leave comments. Login now