# HG changeset patch # User Pierre-Yves David # Date 2015-07-03 17:07:51 # Node ID 46e2c57026bcef81f5f8fc1b5a253e8497103393 # Parent d50677c3bf44db9738231278504bc2ee2642dc82 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 diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -112,8 +112,8 @@ def _statusmessage(code): 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 @@ def get_stat(spath, fn="00changelog.i"): 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 diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -120,7 +120,7 @@ class hgweb(object): 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))