mercurial/hg.py
changeset 3188 705e30c0a230
parent 3069 bc3fe3b5b785
child 3323 39fd6e82ea38
equal deleted inserted replaced
3187:182bdd589cbe 3188:705e30c0a230
    12 from i18n import gettext as _
    12 from i18n import gettext as _
    13 demandload(globals(), "localrepo bundlerepo httprepo sshrepo statichttprepo")
    13 demandload(globals(), "localrepo bundlerepo httprepo sshrepo statichttprepo")
    14 demandload(globals(), "errno lock os shutil util merge@_merge verify@_verify")
    14 demandload(globals(), "errno lock os shutil util merge@_merge verify@_verify")
    15 
    15 
    16 def _local(path):
    16 def _local(path):
    17     return (os.path.isfile(path and util.drop_scheme('file', path)) and
    17     return (os.path.isfile(util.drop_scheme('file', path)) and
    18             bundlerepo or localrepo)
    18             bundlerepo or localrepo)
    19 
    19 
    20 schemes = {
    20 schemes = {
    21     'bundle': bundlerepo,
    21     'bundle': bundlerepo,
    22     'file': _local,
    22     'file': _local,
    49             return False
    49             return False
    50     return repo.local()
    50     return repo.local()
    51 
    51 
    52 repo_setup_hooks = []
    52 repo_setup_hooks = []
    53 
    53 
    54 def repository(ui, path=None, create=False):
    54 def repository(ui, path='', create=False):
    55     """return a repository object for the specified path"""
    55     """return a repository object for the specified path"""
    56     repo = _lookup(path).instance(ui, path, create)
    56     repo = _lookup(path).instance(ui, path, create)
    57     for hook in repo_setup_hooks:
    57     for hook in repo_setup_hooks:
    58         hook(ui, repo)
    58         hook(ui, repo)
    59     return repo
    59     return repo