##// END OF EJS Templates
hgweb: make hgweb.hgweb a unified interface to hgweb/hgwebdir
Matt Mackall -
r10996:f6d41bfc default
parent child Browse files
Show More
@@ -6,10 +6,25 b''
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 import os
9 import hgweb_mod, hgwebdir_mod
10 import hgweb_mod, hgwebdir_mod
10
11
11 def hgweb(repo, name=None, baseui=None):
12 def hgweb(config, name=None, baseui=None):
12 return hgweb_mod.hgweb(repo, name=name, baseui=baseui)
13 '''create an hgweb wsgi object
14
15 config can be one of:
16 - repo object (single repo view)
17 - path to repo (single repo view)
18 - path to config file (multi-repo view)
19 - dict of virtual:real pairs (multi-repo view)
20 - list of virtual:real tuples (multi-repo view)
21 '''
22
23 if ((isinstance(config, str) and not os.path.isdir(config)) or
24 isinstance(config, dict) or isinstance(config, list)):
25 # create a multi-dir interface
26 return hgwebdir_mod.hgwebdir(config, baseui=baseui)
27 return hgweb_mod.hgweb(config, name=name, baseui=baseui)
13
28
14 def hgwebdir(config, baseui=None):
29 def hgwebdir(config, baseui=None):
15 return hgwebdir_mod.hgwebdir(config, baseui=baseui)
30 return hgwebdir_mod.hgwebdir(config, baseui=baseui)
General Comments 0
You need to be logged in to leave comments. Login now