~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/weave_fmt/__init__.py

  • Committer: John Arbash Meinel
  • Author(s): Mark Hammond
  • Date: 2008-09-09 17:02:21 UTC
  • mto: This revision was merged to the branch mainline in revision 3697.
  • Revision ID: john@arbash-meinel.com-20080909170221-svim3jw2mrz0amp3
An updated transparent icon for bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010 Canonical Ltd
2
 
#
3
 
# This program is free software; you can redistribute it and/or modify
4
 
# it under the terms of the GNU General Public License as published by
5
 
# the Free Software Foundation; either version 2 of the License, or
6
 
# (at your option) any later version.
7
 
#
8
 
# This program is distributed in the hope that it will be useful,
9
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
# GNU General Public License for more details.
12
 
#
13
 
# You should have received a copy of the GNU General Public License
14
 
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
 
 
17
 
"""Weave formats.
18
 
 
19
 
These were formats present in pre-1.0 version of Bazaar.
20
 
"""
21
 
 
22
 
from __future__ import absolute_import
23
 
 
24
 
# Since we are a built-in plugin we share the bzrlib version
25
 
from bzrlib import version_info
26
 
 
27
 
from bzrlib import (
28
 
    branch as _mod_branch,
29
 
    controldir,
30
 
    repository as _mod_repository,
31
 
    serializer,
32
 
    workingtree as _mod_workingtree,
33
 
    )
34
 
from bzrlib.bzrdir import (
35
 
    BzrProber,
36
 
    register_metadir,
37
 
    )
38
 
 
39
 
# Pre-0.8 formats that don't have a disk format string (because they are
40
 
# versioned by the matching control directory). We use the control directories
41
 
# disk format string as a key for the network_name because they meet the
42
 
# constraints (simple string, unique, immutable).
43
 
_mod_repository.network_format_registry.register_lazy(
44
 
    "Bazaar-NG branch, format 5\n",
45
 
    'bzrlib.plugins.weave_fmt.repository',
46
 
    'RepositoryFormat5',
47
 
)
48
 
_mod_repository.network_format_registry.register_lazy(
49
 
    "Bazaar-NG branch, format 6\n",
50
 
    'bzrlib.plugins.weave_fmt.repository',
51
 
    'RepositoryFormat6',
52
 
)
53
 
 
54
 
# weave formats which has no format string and are not discoverable or independently
55
 
# creatable on disk, so are not registered in format_registry.  They're
56
 
# all in bzrlib.plugins.weave_fmt.repository now.  When an instance of one of these is
57
 
# needed, it's constructed directly by the BzrDir.  Non-native formats where
58
 
# the repository is not separately opened are similar.
59
 
 
60
 
_mod_repository.format_registry.register_lazy(
61
 
    'Bazaar-NG Repository format 7',
62
 
    'bzrlib.plugins.weave_fmt.repository',
63
 
    'RepositoryFormat7'
64
 
    )
65
 
 
66
 
_mod_repository.format_registry.register_extra_lazy(
67
 
    'bzrlib.plugins.weave_fmt.repository',
68
 
    'RepositoryFormat4')
69
 
_mod_repository.format_registry.register_extra_lazy(
70
 
    'bzrlib.plugins.weave_fmt.repository',
71
 
    'RepositoryFormat5')
72
 
_mod_repository.format_registry.register_extra_lazy(
73
 
    'bzrlib.plugins.weave_fmt.repository',
74
 
    'RepositoryFormat6')
75
 
 
76
 
 
77
 
# The pre-0.8 formats have their repository format network name registered in
78
 
# repository.py. MetaDir formats have their repository format network name
79
 
# inferred from their disk format string.
80
 
controldir.format_registry.register_lazy('weave',
81
 
    "bzrlib.plugins.weave_fmt.bzrdir", "BzrDirFormat6",
82
 
    'Pre-0.8 format.  Slower than knit and does not'
83
 
    ' support checkouts or shared repositories.',
84
 
    hidden=True,
85
 
    deprecated=True)
86
 
register_metadir(controldir.format_registry, 'metaweave',
87
 
    'bzrlib.plugins.weave_fmt.repository.RepositoryFormat7',
88
 
    'Transitional format in 0.8.  Slower than knit.',
89
 
    branch_format='bzrlib.branchfmt.fullhistory.BzrBranchFormat5',
90
 
    tree_format='bzrlib.workingtree_3.WorkingTreeFormat3',
91
 
    hidden=True,
92
 
    deprecated=True)
93
 
 
94
 
 
95
 
BzrProber.formats.register_lazy(
96
 
    "Bazaar-NG branch, format 0.0.4\n", "bzrlib.plugins.weave_fmt.bzrdir",
97
 
    "BzrDirFormat4")
98
 
BzrProber.formats.register_lazy(
99
 
    "Bazaar-NG branch, format 5\n", "bzrlib.plugins.weave_fmt.bzrdir",
100
 
    "BzrDirFormat5")
101
 
BzrProber.formats.register_lazy(
102
 
    "Bazaar-NG branch, format 6\n", "bzrlib.plugins.weave_fmt.bzrdir",
103
 
    "BzrDirFormat6")
104
 
 
105
 
 
106
 
_mod_branch.format_registry.register_extra_lazy(
107
 
    'bzrlib.plugins.weave_fmt.branch', 'BzrBranchFormat4')
108
 
_mod_branch.network_format_registry.register_lazy(
109
 
    "Bazaar-NG branch, format 6\n",
110
 
    'bzrlib.plugins.weave_fmt.branch', "BzrBranchFormat4")
111
 
 
112
 
 
113
 
_mod_workingtree.format_registry.register_extra_lazy(
114
 
    'bzrlib.plugins.weave_fmt.workingtree',
115
 
    'WorkingTreeFormat2')
116
 
 
117
 
serializer.format_registry.register_lazy('4', 'bzrlib.plugins.weave_fmt.xml4',
118
 
    'serializer_v4')
119
 
 
120
 
def load_tests(basic_tests, module, loader):
121
 
    testmod_names = [
122
 
        'test_bzrdir',
123
 
        'test_repository',
124
 
        'test_workingtree',
125
 
        ]
126
 
    basic_tests.addTest(loader.loadTestsFromModuleNames(
127
 
            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
128
 
    return basic_tests