#!/usr/bin/env python
from mercurial import demandimport; demandimport.enable()
import cgitb; cgitb.enable()
import os; os.environ["HGENCODING"] = "UTF-8"

from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication
import mercurial.hgweb.wsgicgi as wsgicgi
def make_web_app():
    return hgwebdir({
        'name1': '/path/to/the/repository',
        'name2': '/path/to/the/repository',
    })
wsgicgi.launch(wsgiapplication(make_web_app))

只要把這個檔存在 public_html 裡面,就可以發佈 mercurial repository 了。

如果需要 push,就再加上 .htaccess,override 掉 auth,同時建個 htpasswd 檔,再修改 repository 裡的 .hg/hgrc

Posted by yungyuc at 10:18, 0 comment, 0 trackback.
Navigate
Add a trackback
Add a comment

Your name. (required)

Your personal website. (optional)

Your email address. Will not show in page. (suggested, but optional)

Text format is "Plain Text".

Enter "yiPgB"
© hover year to navigate month: powered by django