1330
1330
self.create_hook(hooks.HookPoint('pre_open',
1331
1331
"Invoked before attempting to open a BzrDir with the transport "
1332
1332
"that the open will use.", (1, 14), None))
1333
self.create_hook(hooks.HookPoint('post_repo_init',
1334
"Invoked after a repository has been initialized. "
1335
"post_repo_init is called with a "
1336
"bzrlib.bzrdir.RepoInitHookParams.",
1334
1339
# install the default hooks
1335
1340
BzrDir.hooks = BzrDirHooks()
1343
class RepoInitHookParams(object):
1344
"""Object holding parameters passed to *_repo_init hooks.
1346
There are 4 fields that hooks may wish to access:
1348
:ivar repository: Repository created
1349
:ivar format: Repository format
1350
:ivar bzrdir: The bzrdir for the repository
1351
:ivar shared: The repository is shared
1354
def __init__(self, repository, format, a_bzrdir, shared):
1355
"""Create a group of RepoInitHook parameters.
1357
:param repository: Repository created
1358
:param format: Repository format
1359
:param bzrdir: The bzrdir for the repository
1360
:param shared: The repository is shared
1362
self.repository = repository
1363
self.format = format
1364
self.bzrdir = a_bzrdir
1365
self.shared = shared
1367
def __eq__(self, other):
1368
return self.__dict__ == other.__dict__
1372
return "<%s for %s>" % (self.__class__.__name__,
1375
return "<%s for %s>" % (self.__class__.__name__,
1338
1379
class BzrDirPreSplitOut(BzrDir):
1339
1380
"""A common class for the all-in-one formats."""