mercurial/hgweb/common.py
branchstable
changeset 13958 71f51cc71652
parent 13444 75f5f312df5f
child 13959 141f88ae5276
equal deleted inserted replaced
13957:044e1356327d 13958:71f51cc71652
    84     return responses.get(code, ('Error', 'Unknown error'))[0]
    84     return responses.get(code, ('Error', 'Unknown error'))[0]
    85 
    85 
    86 def statusmessage(code, message=None):
    86 def statusmessage(code, message=None):
    87     return '%d %s' % (code, message or _statusmessage(code))
    87     return '%d %s' % (code, message or _statusmessage(code))
    88 
    88 
    89 def get_mtime(spath):
    89 def get_stat(spath):
       
    90     """stat changelog if it exists, spath otherwise"""
    90     cl_path = os.path.join(spath, "00changelog.i")
    91     cl_path = os.path.join(spath, "00changelog.i")
    91     if os.path.exists(cl_path):
    92     if os.path.exists(cl_path):
    92         return os.stat(cl_path).st_mtime
    93         return os.stat(cl_path)
    93     else:
    94     else:
    94         return os.stat(spath).st_mtime
    95         return os.stat(spath)
       
    96 
       
    97 def get_mtime(spath):
       
    98     return get_stat(spath).st_mtime
    95 
    99 
    96 def staticfile(directory, fname, req):
   100 def staticfile(directory, fname, req):
    97     """return a file inside directory with guessed Content-Type header
   101     """return a file inside directory with guessed Content-Type header
    98 
   102 
    99     fname always uses '/' as directory separator and isn't allowed to
   103     fname always uses '/' as directory separator and isn't allowed to