767
767
can be reused to share a remote connection.
769
769
if cls is not BzrDir:
770
raise AssertionError("BzrDir.create always creates the"
770
raise AssertionError("BzrDir.create always creates the "
771
771
"default format, not one of %r" % cls)
772
772
return controldir.ControlDir.create(base, format=format,
773
773
possible_transports=possible_transports)
776
class RepoInitHookParams(object):
777
"""Object holding parameters passed to `*_repo_init` hooks.
779
There are 4 fields that hooks may wish to access:
781
:ivar repository: Repository created
782
:ivar format: Repository format
783
:ivar bzrdir: The bzrdir for the repository
784
:ivar shared: The repository is shared
787
def __init__(self, repository, format, a_bzrdir, shared):
788
"""Create a group of RepoInitHook parameters.
790
:param repository: Repository created
791
:param format: Repository format
792
:param bzrdir: The bzrdir for the repository
793
:param shared: The repository is shared
795
self.repository = repository
797
self.bzrdir = a_bzrdir
800
def __eq__(self, other):
801
return self.__dict__ == other.__dict__
805
return "<%s for %s>" % (self.__class__.__name__,
808
return "<%s for %s>" % (self.__class__.__name__,
812
776
class BzrDirMeta1(BzrDir):
813
777
"""A .bzr meta version 1 control object.