Mercurial > hg
changeset 25717:46e2c57026bc
hgweb: drop the default argument for get_stat
This default argument is used twice and is making things confusing. Making it
explicit helps to clarify coming changesets
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 03 Jul 2015 10:07:51 -0700 |
parents | d50677c3bf44 |
children | 2e32f0897bcf |
files | mercurial/hgweb/common.py mercurial/hgweb/hgweb_mod.py |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/common.py Thu Jul 02 23:46:18 2015 -0700 +++ b/mercurial/hgweb/common.py Fri Jul 03 10:07:51 2015 -0700 @@ -112,8 +112,8 @@ def statusmessage(code, message=None): return '%d %s' % (code, message or _statusmessage(code)) -def get_stat(spath, fn="00changelog.i"): - """stat fn (00changelog.i by default) if it exists, spath otherwise""" +def get_stat(spath, fn): + """stat fn if it exists, spath otherwise""" cl_path = os.path.join(spath, fn) if os.path.exists(cl_path): return os.stat(cl_path) @@ -121,7 +121,7 @@ return os.stat(spath) def get_mtime(spath): - return get_stat(spath).st_mtime + return get_stat(spath, "00changelog.i").st_mtime def staticfile(directory, fname, req): """return a file inside directory with guessed Content-Type header
--- a/mercurial/hgweb/hgweb_mod.py Thu Jul 02 23:46:18 2015 -0700 +++ b/mercurial/hgweb/hgweb_mod.py Fri Jul 03 10:07:51 2015 -0700 @@ -120,7 +120,7 @@ return repo.filtered('served') def refresh(self, request=None): - st = get_stat(self.repo.spath) + st = get_stat(self.repo.spath, '00changelog.i') pst = get_stat(self.repo.spath, 'phaseroots') # changelog mtime and size, phaseroots mtime and size repostate = ((st.st_mtime, st.st_size), (pst.st_mtime, pst.st_size))