/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/bzrdir.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from cStringIO import StringIO
31
31
import os
 
32
import sys
32
33
 
33
34
from bzrlib.lazy_import import lazy_import
34
35
lazy_import(globals(), """
48
49
    symbol_versioning,
49
50
    ui,
50
51
    urlutils,
 
52
    win32utils,
 
53
    workingtree,
 
54
    workingtree_4,
51
55
    xml4,
52
56
    xml5,
53
 
    workingtree,
54
 
    workingtree_4,
55
57
    )
56
58
from bzrlib.osutils import (
57
59
    sha_strings,
243
245
            format = BzrDirFormat.get_default_format()
244
246
        return format.initialize_on_transport(t)
245
247
 
 
248
    def destroy_repository(self):
 
249
        """Destroy the repository in this BzrDir"""
 
250
        raise NotImplementedError(self.destroy_repository)
 
251
 
246
252
    def create_branch(self):
247
253
        """Create a branch in this BzrDir.
248
254
 
929
935
            raise errors.IncompatibleFormat('shared repository', self._format)
930
936
        return self.open_repository()
931
937
 
 
938
    def destroy_repository(self):
 
939
        """See BzrDir.destroy_repository."""
 
940
        raise errors.UnsupportedOperation(self.destroy_repository, self)
 
941
 
932
942
    def create_workingtree(self, revision_id=None, from_branch=None):
933
943
        """See BzrDir.create_workingtree."""
934
944
        # this looks buggy but is not -really-
1107
1117
        """See BzrDir.create_repository."""
1108
1118
        return self._format.repository_format.initialize(self, shared)
1109
1119
 
 
1120
    def destroy_repository(self):
 
1121
        """See BzrDir.destroy_repository."""
 
1122
        self.transport.delete_tree('repository')
 
1123
 
1110
1124
    def create_workingtree(self, revision_id=None, from_branch=None):
1111
1125
        """See BzrDir.create_workingtree."""
1112
1126
        return self._format.workingtree_format.initialize(
1355
1369
                                      # FIXME: RBC 20060121 don't peek under
1356
1370
                                      # the covers
1357
1371
                                      mode=temp_control._dir_mode)
 
1372
        if sys.platform == 'win32' and isinstance(transport, LocalTransport):
 
1373
            win32utils.set_file_attr_hidden(transport._abspath('.bzr'))
1358
1374
        file_mode = temp_control._file_mode
1359
1375
        del temp_control
1360
1376
        mutter('created control directory in ' + transport.base)
1717
1733
        return RepositoryFormat.get_default_format()
1718
1734
 
1719
1735
    def __set_repository_format(self, value):
1720
 
        """Allow changint the repository format for metadir formats."""
 
1736
        """Allow changing the repository format for metadir formats."""
1721
1737
        self._repository_format = value
1722
1738
 
1723
1739
    repository_format = property(__return_repository_format, __set_repository_format)
2535
2551
        'rich-root format repositories. Interoperates with '
2536
2552
        'bzr repositories before 0.92 but cannot be read by bzr < 1.0. '
2537
2553
        'NOTE: This format is experimental. Before using it, please read '
2538
 
        'http://doc.bazaar-vcs.org/latest/developers/knitpack.html.',
 
2554
        'http://doc.bazaar-vcs.org/latest/developers/packrepo.html.',
2539
2555
    branch_format='bzrlib.branch.BzrBranchFormat6',
2540
2556
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2541
2557
    hidden=False,
2542
2558
    experimental=True,
2543
2559
    )
2544
 
format_registry.set_default('dirstate-tags')
 
2560
format_registry.set_default('pack-0.92')