view hgweb.cgi @ 26251:5c0f5db65c6b

localrepo: refresh filecache stats only if transaction finished successfully If commit is aborted by pretxncommit hook, in-memory changelog and manifest have entries that would be added. So they must be discarded on invalidate(). But the mechanism introduced by a710936c3037 doesn't handle this case well. It tries to mitigate the penalty of invalidate() by marking in-memory cache as "clean" on unlock assuming that they are identical to the stored data. But this assumption is wrong if stored data are rolled back by tr.abort(). This patch moves the hook to post-close action so that it will never be triggered on abort. This bug was originally reported to thg, which is only reproducible in command-server process on unix, evolve disabled. https://bitbucket.org/tortoisehg/thg/issues/4285/
author Yuya Nishihara <yuya@tcha.org>
date Tue, 15 Sep 2015 00:32:39 +0900
parents 85cba926cb59
children 4b0fc75f9403
line wrap: on
line source

#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"

# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)