diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -86,15 +86,12 @@ def _statusmessage(code): def statusmessage(code, message=None): return '%d %s' % (code, message or _statusmessage(code)) -def get_mtime(repo_path): - store_path = os.path.join(repo_path, ".hg") - if not os.path.isdir(os.path.join(store_path, "data")): - store_path = os.path.join(store_path, "store") - cl_path = os.path.join(store_path, "00changelog.i") +def get_mtime(spath): + cl_path = os.path.join(spath, "00changelog.i") if os.path.exists(cl_path): return os.stat(cl_path).st_mtime else: - return os.stat(store_path).st_mtime + return os.stat(spath).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 @@ -57,7 +57,7 @@ class hgweb(object): def refresh(self, request=None): if request: self.repo.ui.environ = request.env - mtime = get_mtime(self.repo.root) + mtime = get_mtime(self.repo.spath) if mtime != self.mtime: self.mtime = mtime self.repo = hg.repository(self.repo.ui, self.repo.root) diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -235,7 +235,8 @@ class hgwebdir(object): # update time with local timezone try: - d = (get_mtime(path), util.makedate()[1]) + r = hg.repository(self.ui, path) + d = (get_mtime(r.spath), util.makedate()[1]) except OSError: continue diff --git a/tests/test-share b/tests/test-share --- a/tests/test-share +++ b/tests/test-share @@ -41,3 +41,8 @@ hg log hg update cat b # should exist with one "b" +echo % hg serve shared clone +hg serve -n test -p $HGPORT -d --pid-file=hg.pid +cat hg.pid >> $DAEMON_PIDS + +"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-file/' diff --git a/tests/test-share.out b/tests/test-share.out --- a/tests/test-share.out +++ b/tests/test-share.out @@ -43,3 +43,11 @@ summary: init 1 files updated, 0 files merged, 0 files removed, 0 files unresolved b +% hg serve shared clone +200 Script output follows + + +-rw-r--r-- 4 a +-rw-r--r-- 2 b + +