##// END OF EJS Templates
hgweb: drop the default argument for get_stat...
Pierre-Yves David -
r25717:46e2c570 default
parent child Browse files
Show More
@@ -112,8 +112,8 b' def _statusmessage(code):'
112 def statusmessage(code, message=None):
112 def statusmessage(code, message=None):
113 return '%d %s' % (code, message or _statusmessage(code))
113 return '%d %s' % (code, message or _statusmessage(code))
114
114
115 def get_stat(spath, fn="00changelog.i"):
115 def get_stat(spath, fn):
116 """stat fn (00changelog.i by default) if it exists, spath otherwise"""
116 """stat fn if it exists, spath otherwise"""
117 cl_path = os.path.join(spath, fn)
117 cl_path = os.path.join(spath, fn)
118 if os.path.exists(cl_path):
118 if os.path.exists(cl_path):
119 return os.stat(cl_path)
119 return os.stat(cl_path)
@@ -121,7 +121,7 b' def get_stat(spath, fn="00changelog.i"):'
121 return os.stat(spath)
121 return os.stat(spath)
122
122
123 def get_mtime(spath):
123 def get_mtime(spath):
124 return get_stat(spath).st_mtime
124 return get_stat(spath, "00changelog.i").st_mtime
125
125
126 def staticfile(directory, fname, req):
126 def staticfile(directory, fname, req):
127 """return a file inside directory with guessed Content-Type header
127 """return a file inside directory with guessed Content-Type header
@@ -120,7 +120,7 b' class hgweb(object):'
120 return repo.filtered('served')
120 return repo.filtered('served')
121
121
122 def refresh(self, request=None):
122 def refresh(self, request=None):
123 st = get_stat(self.repo.spath)
123 st = get_stat(self.repo.spath, '00changelog.i')
124 pst = get_stat(self.repo.spath, 'phaseroots')
124 pst = get_stat(self.repo.spath, 'phaseroots')
125 # changelog mtime and size, phaseroots mtime and size
125 # changelog mtime and size, phaseroots mtime and size
126 repostate = ((st.st_mtime, st.st_size), (pst.st_mtime, pst.st_size))
126 repostate = ((st.st_mtime, st.st_size), (pst.st_mtime, pst.st_size))
General Comments 0
You need to be logged in to leave comments. Login now