Include the repository in log_times() output.
Thu Feb 23 19:47:31 UTC 2006 Alberto Bertogli <albertogli@telpin.com.ar>
* Include the repository in log_times() output.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2015-10-27 02:32:07.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2015-10-27 02:32:07.000000000 +0000
@@ -241,7 +241,7 @@
realf = filter_file(config.repodir + '/' + fname)
return realf
-def log_times(cache_hit, event = None):
+def log_times(cache_hit, repo = None, event = None):
if not config.logtimes:
return
@@ -251,11 +251,15 @@
event = action
if cache_hit:
event = event + " (hit)"
- s = """\
-%s
+ s = '%s\n' % event
+
+ if repo:
+ s += '\trepo: %s\n' % repo
+
+ s += """\
total: %.3f
processing: %.3f
- imports: %.3f\n""" % (event, time_total, processing, time_imports)
+ imports: %.3f\n""" % (time_total, processing, time_imports)
if darcs_runs:
s += "\truns:\n"
@@ -2298,7 +2302,7 @@
# we have a hit, dump and run
cache.dump()
cache.close()
- log_times(cache_hit = 1)
+ log_times(cache_hit = 1, repo = config.reponame)
sys.exit(0)
# if there is a miss, the cache will step over stdout, intercepting
# all "print"s and writing them to the cache file automatically
@@ -2451,6 +2455,6 @@
if config.cachedir:
cache.close()
-log_times(cache_hit = 0)
+log_times(cache_hit = 0, repo = config.reponame)