Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/common.py @ 3853:c0b449154a90
switch to the .hg/store layout, fix the tests
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 01 Dec 2006 13:34:09 +0100 |
parents | db9d2a624521 |
children | abaee83ce0a6 |
comparison
equal
deleted
inserted
replaced
3852:8a9a1a7e1698 | 3853:c0b449154a90 |
---|---|
8 | 8 |
9 import os, mimetypes | 9 import os, mimetypes |
10 import os.path | 10 import os.path |
11 | 11 |
12 def get_mtime(repo_path): | 12 def get_mtime(repo_path): |
13 hg_path = os.path.join(repo_path, ".hg") | 13 store_path = os.path.join(repo_path, ".hg") |
14 cl_path = os.path.join(hg_path, "00changelog.i") | 14 if not os.path.isdir(os.path.join(store_path, "data")): |
15 if os.path.exists(os.path.join(cl_path)): | 15 store_path = os.path.join(store_path, "store") |
16 cl_path = os.path.join(store_path, "00changelog.i") | |
17 if os.path.exists(cl_path): | |
16 return os.stat(cl_path).st_mtime | 18 return os.stat(cl_path).st_mtime |
17 else: | 19 else: |
18 return os.stat(hg_path).st_mtime | 20 return os.stat(store_path).st_mtime |
19 | 21 |
20 def staticfile(directory, fname, req): | 22 def staticfile(directory, fname, req): |
21 """return a file inside directory with guessed content-type header | 23 """return a file inside directory with guessed content-type header |
22 | 24 |
23 fname always uses '/' as directory separator and isn't allowed to | 25 fname always uses '/' as directory separator and isn't allowed to |