/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2010-03-22 13:59:33 UTC
  • mfrom: (5105 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5106.
  • Revision ID: jelmer@samba.org-20100322135933-7i7vyau8mvjoqvpf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1778
1778
 
1779
1779
    def open(self, a_bzrdir, name=None, _found=False, ignore_fallbacks=False):
1780
1780
        """See BranchFormat.open()."""
1781
 
        if name is not None:
1782
 
            raise errors.NoColocatedBranchSupport(a_bzrdir)
1783
1781
        if not _found:
1784
1782
            # we are being called directly and must probe.
1785
1783
            raise NotImplementedError
1786
1784
        return BzrBranch(_format=self,
1787
1785
                         _control_files=a_bzrdir._control_files,
1788
1786
                         a_bzrdir=a_bzrdir,
 
1787
                         name=name,
1789
1788
                         _repository=a_bzrdir.open_repository())
1790
1789
 
1791
1790
    def __str__(self):
1819
1818
                                                         lockdir.LockDir)
1820
1819
            return self._branch_class()(_format=self,
1821
1820
                              _control_files=control_files,
 
1821
                              name=name,
1822
1822
                              a_bzrdir=a_bzrdir,
1823
1823
                              _repository=a_bzrdir.find_repository(),
1824
1824
                              ignore_fallbacks=ignore_fallbacks)
2119
2119
    :ivar repository: Repository for this branch.
2120
2120
    :ivar base: The url of the base directory for this branch; the one
2121
2121
        containing the .bzr directory.
 
2122
    :ivar name: Optional colocated branch name as it exists in the control
 
2123
        directory.
2122
2124
    """
2123
2125
 
2124
2126
    def __init__(self, _format=None,
2125
 
                 _control_files=None, a_bzrdir=None, _repository=None,
2126
 
                 ignore_fallbacks=False):
 
2127
                 _control_files=None, a_bzrdir=None, name=None,
 
2128
                 _repository=None, ignore_fallbacks=False):
2127
2129
        """Create new branch object at a particular location."""
2128
2130
        if a_bzrdir is None:
2129
2131
            raise ValueError('a_bzrdir must be supplied')
2130
2132
        else:
2131
2133
            self.bzrdir = a_bzrdir
2132
2134
        self._base = self.bzrdir.transport.clone('..').base
 
2135
        self.name = name
2133
2136
        # XXX: We should be able to just do
2134
2137
        #   self.base = self.bzrdir.root_transport.base
2135
2138
        # but this does not quite work yet -- mbp 20080522
2142
2145
        Branch.__init__(self)
2143
2146
 
2144
2147
    def __str__(self):
2145
 
        return '%s(%r)' % (self.__class__.__name__, self.base)
 
2148
        if self.name is None:
 
2149
            return '%s(%r)' % (self.__class__.__name__, self.base)
 
2150
        else:
 
2151
            return '%s(%r,%r)' % (self.__class__.__name__, self.base, self.name)
2146
2152
 
2147
2153
    __repr__ = __str__
2148
2154