# HG changeset patch # User Vadim Gelfer # Date 1155249845 25200 # Node ID 2ff57e3113a4db0b67b4f48b01674910a9ba6865 # Parent b8d587cfa3bbfe8c8e2e619f810048a60c4930eb call reposetup functions of extension modules whenever repo created diff -r b8d587cfa3bb -r 2ff57e3113a4 mercurial/commands.py --- a/mercurial/commands.py Thu Aug 10 15:02:18 2006 -0700 +++ b/mercurial/commands.py Thu Aug 10 15:44:05 2006 -0700 @@ -3545,6 +3545,7 @@ mod = sys.modules[name] if hasattr(mod, 'reposetup'): mod.reposetup(u, repo) + hg.repo_setup_hooks.append(mod.reposetup) except hg.RepoError: if cmd not in optionalrepo.split(): raise diff -r b8d587cfa3bb -r 2ff57e3113a4 mercurial/hg.py --- a/mercurial/hg.py Thu Aug 10 15:02:18 2006 -0700 +++ b/mercurial/hg.py Thu Aug 10 15:44:05 2006 -0700 @@ -48,9 +48,14 @@ return False return repo.local() +repo_setup_hooks = [] + def repository(ui, path=None, create=False): """return a repository object for the specified path""" - return _lookup(path).instance(ui, path, create) + repo = _lookup(path).instance(ui, path, create) + for hook in repo_setup_hooks: + hook(ui, repo) + return repo def defaultdest(source): '''return default destination of clone if none is given'''