Skip to content

Instantly share code, notes, and snippets.

@kamawanu
Last active September 10, 2021 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamawanu/1bffae3b1283d0e31cf2a638c323bbce to your computer and use it in GitHub Desktop.
Save kamawanu/1bffae3b1283d0e31cf2a638c323bbce to your computer and use it in GitHub Desktop.
[subrepos]
git:allowed=true
[web]
push_ssl=False
allow_push=*
#!/usr/bin/python3
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories
from mercurial import demandimport
import cgitb
from mercurial.hgweb import hgweb, wsgicgi
import os.path
import glob
import os
import sys
os.environ["HGENCODING"] = "UTF-8"
syms = [
xx for xx in glob.glob("*")
if os.path.islink(xx) and os.path.isdir(xx)
]
##print(syms)
dirs = []
for ROOT in syms:
dir0 = [
( ( ROOT + "@" + os.path.basename(xx)).encode(), xx.encode())
for xx in glob.glob(ROOT + "/*")
if os.path.isdir(xx + "/.hg")
]
dirs += dir0
config = dirs
demandimport.enable()
app = hgweb(config)
#print(dir(app))
app.run()
#!/usr/bin/python3
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories
from mercurial import demandimport
import cgitb
from mercurial.hgweb import hgweb, wsgicgi
from mercurial.hgweb.hgwebdir_mod import hgwebdir
import os.path
import glob
import os
import sys
os.environ["HGENCODING"] = "UTF-8"
config = "hgweb.config"
demandimport.enable()
app = hgwebdir(config.encode())
#print(dir(app))
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment