~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: jelmer at samba
  • Date: 2011-10-11 12:01:51 UTC
  • mto: This revision was merged to the branch mainline in revision 6214.
  • Revision ID: jelmer@samba.org-20111011120151-l1aa35zasaocrev3
Fix tests and the like.

Show diffs side-by-side

added added

removed removed

Lines of Context:
767
767
            can be reused to share a remote connection.
768
768
        """
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)
774
774
 
775
775
 
776
 
class RepoInitHookParams(object):
777
 
    """Object holding parameters passed to `*_repo_init` hooks.
778
 
 
779
 
    There are 4 fields that hooks may wish to access:
780
 
 
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
785
 
    """
786
 
 
787
 
    def __init__(self, repository, format, a_bzrdir, shared):
788
 
        """Create a group of RepoInitHook parameters.
789
 
 
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
794
 
        """
795
 
        self.repository = repository
796
 
        self.format = format
797
 
        self.bzrdir = a_bzrdir
798
 
        self.shared = shared
799
 
 
800
 
    def __eq__(self, other):
801
 
        return self.__dict__ == other.__dict__
802
 
 
803
 
    def __repr__(self):
804
 
        if self.repository:
805
 
            return "<%s for %s>" % (self.__class__.__name__,
806
 
                self.repository)
807
 
        else:
808
 
            return "<%s for %s>" % (self.__class__.__name__,
809
 
                self.bzrdir)
810
 
 
811
 
 
812
776
class BzrDirMeta1(BzrDir):
813
777
    """A .bzr meta version 1 control object.
814
778