Пример #1
0
 def make_handler():
     if webdir_conf:
         hgwebobj = hgwebdir(webdir_conf, ui)
     elif repo is not None:
         hgwebobj = hgweb(hg.repository(repo.ui, repo.root))
     else:
         raise error.RepoError(_("There is no Mercurial repository" " here (.hg not found)"))
     return hgwebobj
Пример #2
0
 def make_handler():
     if webdir_conf:
         hgwebobj = hgwebdir(webdir_conf, ui)
     elif repo is not None:
         hgwebobj = hgweb(hg.repository(repo.ui, repo.root))
     else:
         raise error.RepoError(_("There is no Mercurial repository"
                                 " here (.hg not found)"))
     return hgwebobj
Пример #3
0
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)
Пример #4
0
def hgwebdir(*args, **kwargs):
    return hgwebdir_mod.hgwebdir(*args, **kwargs)
Пример #5
0
def hgwebdir(config, baseui=None):
    return hgwebdir_mod.hgwebdir(config, baseui=baseui)