comparison mercurial/hg.py @ 2835:2ff57e3113a4

call reposetup functions of extension modules whenever repo created
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 10 Aug 2006 15:44:05 -0700
parents 49988d9f0758
children 345bac2bc4ec
comparison
equal deleted inserted replaced
2834:b8d587cfa3bb 2835:2ff57e3113a4
46 return _lookup(repo).islocal(repo) 46 return _lookup(repo).islocal(repo)
47 except AttributeError: 47 except AttributeError:
48 return False 48 return False
49 return repo.local() 49 return repo.local()
50 50
51 repo_setup_hooks = []
52
51 def repository(ui, path=None, create=False): 53 def repository(ui, path=None, create=False):
52 """return a repository object for the specified path""" 54 """return a repository object for the specified path"""
53 return _lookup(path).instance(ui, path, create) 55 repo = _lookup(path).instance(ui, path, create)
56 for hook in repo_setup_hooks:
57 hook(ui, repo)
58 return repo
54 59
55 def defaultdest(source): 60 def defaultdest(source):
56 '''return default destination of clone if none is given''' 61 '''return default destination of clone if none is given'''
57 return os.path.basename(os.path.normpath(source)) 62 return os.path.basename(os.path.normpath(source))
58 63