view hgweb.cgi @ 20477:2607a21bb40b

pull: move transaction logic into the pull object Most local change that occurs during a pull are doing within a `transaction`. Currently this mean (1) adding new changeset (2) adding obsolescence markers. We want the two operations to be done in the same transaction. However we do not want to create a transaction if nothing is added to the repo. Creating an empty transaction would drop the previous transaction data and confuse tool and people who are still using rollback. So the current pull code has some logic to create and handle this transaction on demand. We are moving this logic in to the `pulloperation` object itself to simplify this lazy creation logic through all different par of the push. Note that, in the future, other part of pull (phases, bookmark) will probably want to be part of the transaction too.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Fri, 31 Jan 2014 01:04:05 -0800
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)