Mercurial > hg-stable
view hgweb.cgi @ 45266:13814622b3b1
commitctx: extract all the file preparation logic in a new function
Before we actually start to create a new commit we have a large block of logic
that do the necessary file and manifest commit and that determine which files
are been affected by the commit (and how).
This is a complex process on its own. It return a "simple" output that can be
fed to the next step. The output itself is not that simple as we return a lot of
individual items (files, added, removed, ...). My next step (and actual goal for
this cleanup) will be to simplify the return by returning a richer object that
will be more suited for the variation of data we want to store.
After this changeset the `commitctx` is a collection of smaller function with
limited scope. The largest one is still `_filecommit` without about 100 lines of
code.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 23 Jul 2020 23:52:31 +0200 |
parents | 47ef023d0165 |
children | d58a205d0672 |
line wrap: on
line source
#!/usr/bin/env python # # An example hgweb CGI script, edit as necessary # See also https://mercurial-scm.org/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)