equal
deleted
inserted
replaced
7 |
7 |
8 mkdir -p /srv/hg |
8 mkdir -p /srv/hg |
9 chown user:user /srv/hg |
9 chown user:user /srv/hg |
10 |
10 |
11 cat <<EOF >/srv/hg/hgweb.cgi |
11 cat <<EOF >/srv/hg/hgweb.cgi |
12 #!/usr/bin/env python |
12 #!/usr/bin/env python3 |
13 # See also https://mercurial-scm.org/wiki/PublishingRepositories |
13 # See also https://mercurial-scm.org/wiki/PublishingRepositories |
14 |
14 |
15 # Path to repo or hgweb config to serve (see 'hg help hgweb') |
15 # Path to repo or hgweb config to serve (see 'hg help hgweb') |
16 config = "/srv/hg/hgweb.config" |
16 config = b"/srv/hg/hgweb.config" |
17 |
17 |
18 from mercurial import demandimport; demandimport.enable() |
18 # Uncomment to send python tracebacks to the browser if an error occurs: |
|
19 # import cgitb; cgitb.enable() |
|
20 |
|
21 from mercurial import demandimport |
|
22 demandimport.enable() |
|
23 |
19 from mercurial.hgweb import hgweb, wsgicgi |
24 from mercurial.hgweb import hgweb, wsgicgi |
|
25 |
20 application = hgweb(config) |
26 application = hgweb(config) |
21 wsgicgi.launch(application) |
27 wsgicgi.launch(application) |
22 EOF |
28 EOF |
23 chmod a+xr /srv/hg/hgweb.cgi |
29 chmod a+xr /srv/hg/hgweb.cgi |
24 |
30 |