2006-06-02 19:05:01 +04:00
|
|
|
# hgweb/__init__.py - web interface to a mercurial repository
|
2005-05-12 05:11:10 +04:00
|
|
|
#
|
2005-06-04 01:43:17 +04:00
|
|
|
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
|
2005-07-03 01:40:15 +04:00
|
|
|
# Copyright 2005 Matt Mackall <mpm@selenic.com>
|
2005-05-12 05:11:10 +04:00
|
|
|
#
|
2009-04-26 03:08:54 +04:00
|
|
|
# This software may be used and distributed according to the terms of the
|
2010-01-20 07:20:08 +03:00
|
|
|
# GNU General Public License version 2 or any later version.
|
2005-05-12 05:11:10 +04:00
|
|
|
|
2010-04-26 20:03:40 +04:00
|
|
|
import os
|
2006-12-13 22:27:09 +03:00
|
|
|
import hgweb_mod, hgwebdir_mod
|
|
|
|
|
2010-04-26 20:03:40 +04:00
|
|
|
def hgweb(config, name=None, baseui=None):
|
|
|
|
'''create an hgweb wsgi object
|
|
|
|
|
|
|
|
config can be one of:
|
|
|
|
- repo object (single repo view)
|
|
|
|
- path to repo (single repo view)
|
|
|
|
- path to config file (multi-repo view)
|
|
|
|
- dict of virtual:real pairs (multi-repo view)
|
|
|
|
- list of virtual:real tuples (multi-repo view)
|
|
|
|
'''
|
|
|
|
|
|
|
|
if ((isinstance(config, str) and not os.path.isdir(config)) or
|
|
|
|
isinstance(config, dict) or isinstance(config, list)):
|
|
|
|
# create a multi-dir interface
|
|
|
|
return hgwebdir_mod.hgwebdir(config, baseui=baseui)
|
|
|
|
return hgweb_mod.hgweb(config, name=name, baseui=baseui)
|
2006-12-13 22:27:09 +03:00
|
|
|
|
2010-04-26 20:03:40 +04:00
|
|
|
def hgwebdir(config, baseui=None):
|
|
|
|
return hgwebdir_mod.hgwebdir(config, baseui=baseui)
|
2006-12-13 22:27:09 +03:00
|
|
|
|