Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/common.py @ 13959:141f88ae5276
merge with stable
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Tue, 19 Apr 2011 15:19:54 +0200 |
parents | 19f8629ea107 71f51cc71652 |
children | 3233b39d756f |
line wrap: on
line diff
--- a/mercurial/hgweb/common.py Tue Apr 19 12:04:44 2011 +0200 +++ b/mercurial/hgweb/common.py Tue Apr 19 15:19:54 2011 +0200 @@ -105,12 +105,16 @@ def statusmessage(code, message=None): return '%d %s' % (code, message or _statusmessage(code)) -def get_mtime(spath): +def get_stat(spath): + """stat changelog if it exists, spath otherwise""" cl_path = os.path.join(spath, "00changelog.i") if os.path.exists(cl_path): - return os.stat(cl_path).st_mtime + return os.stat(cl_path) else: - return os.stat(spath).st_mtime + return os.stat(spath) + +def get_mtime(spath): + return get_stat(spath).st_mtime def staticfile(directory, fname, req): """return a file inside directory with guessed Content-Type header