/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/tests/__init__.py

Test only fixes from the ported-to-bzr.dev test-correctness branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1608
1608
        then the self.get_vfs_server is returned.
1609
1609
        """
1610
1610
        if self.__server is None:
1611
 
            if self.transport_server is None:
 
1611
            if self.transport_server is None or self.transport_server is self.vfs_transport_factory:
1612
1612
                return self.get_vfs_only_server()
1613
1613
            else:
1614
1614
                # bring up a decorated means of access to the vfs only server.
1615
1615
                self.__server = self.transport_server()
1616
 
                self.__server.setUp(self.get_vfs_only_server())
 
1616
                try:
 
1617
                    self.__server.setUp(self.get_vfs_only_server())
 
1618
                except TypeError, e:
 
1619
                    # This should never happen; the try:Except here is to assist
 
1620
                    # developers having to update code rather than seeing an
 
1621
                    # uninformative TypeError.
 
1622
                    raise Exception, "Old server API in use: %s, %s" % (self.__server, e)
1617
1623
            self.addCleanup(self.__server.tearDown)
1618
1624
        return self.__server
1619
1625
 
1923
1929
            # We can only make working trees locally at the moment.  If the
1924
1930
            # transport can't support them, then we keep the non-disk-backed
1925
1931
            # branch and create a local checkout.
1926
 
            return b.create_checkout(relpath, lightweight=True)
 
1932
            if self.vfs_transport_factory is LocalURLServer:
 
1933
                # the branch is colocated on disk, we cannot create a checkout.
 
1934
                # hopefully callers will expect this.
 
1935
                local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url(relpath))
 
1936
                return local_controldir.create_workingtree()
 
1937
            else:
 
1938
                return b.create_checkout(relpath, lightweight=True)
1927
1939
 
1928
1940
    def assertIsDirectory(self, relpath, transport):
1929
1941
        """Assert that relpath within transport is a directory.