/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
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
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
22
# Since we are a built-in plugin we share the breezy version
7143.11.1 by Jelmer Vernooij
Remove some unused imports.
23
from ... import version_info  # noqa: F401
5840.1.1 by Vincent Ladeuil
Use a proper version for the weave_format plugin
24
6624 by Jelmer Vernooij
Merge Python3 porting work ('py3 pokes')
25
from ... import (
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
26
    branch as _mod_branch,
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
27
    controldir,
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
28
    repository as _mod_repository,
6670.4.10 by Jelmer Vernooij
Move serializer to bzr.
29
    workingtree as _mod_workingtree,
30
    )
31
from ...bzr import (
5582.10.65 by Jelmer Vernooij
Merge working tree format registry.
32
    serializer,
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
33
    )
6695.5.1 by Jelmer Vernooij
Move bzr format registration to breezy.bzr.
34
from ...bzr import (
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
35
    BzrProber,
36
    register_metadir,
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
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).
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
43
_mod_repository.network_format_registry.register_lazy(
6855.3.1 by Jelmer Vernooij
Several more fixes.
44
    b"Bazaar-NG branch, format 5\n",
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
45
    'breezy.plugins.weave_fmt.repository',
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
46
    'RepositoryFormat5',
47
)
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
48
_mod_repository.network_format_registry.register_lazy(
6855.3.1 by Jelmer Vernooij
Several more fixes.
49
    b"Bazaar-NG branch, format 6\n",
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
50
    'breezy.plugins.weave_fmt.repository',
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
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
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
56
# all in breezy.plugins.weave_fmt.repository now.  When an instance of one of these is
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
57
# needed, it's constructed directly by the BzrDir.  Non-native formats where
58
# the repository is not separately opened are similar.
59
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
60
_mod_repository.format_registry.register_lazy(
6855.3.1 by Jelmer Vernooij
Several more fixes.
61
    b'Bazaar-NG Repository format 7',
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
62
    'breezy.plugins.weave_fmt.repository',
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
63
    'RepositoryFormat7'
64
    )
65
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
66
_mod_repository.format_registry.register_extra_lazy(
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
67
    'breezy.plugins.weave_fmt.repository',
5582.10.43 by Jelmer Vernooij
Merge extra repo branch.
68
    'RepositoryFormat4')
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
69
_mod_repository.format_registry.register_extra_lazy(
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
70
    'breezy.plugins.weave_fmt.repository',
5582.10.43 by Jelmer Vernooij
Merge extra repo branch.
71
    'RepositoryFormat5')
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
72
_mod_repository.format_registry.register_extra_lazy(
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
73
    'breezy.plugins.weave_fmt.repository',
5582.10.43 by Jelmer Vernooij
Merge extra repo branch.
74
    'RepositoryFormat6')
75
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
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',
7143.15.2 by Jelmer Vernooij
Run autopep8.
81
                                         "breezy.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)
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
86
register_metadir(controldir.format_registry, 'metaweave',
7143.15.2 by Jelmer Vernooij
Run autopep8.
87
                 'breezy.plugins.weave_fmt.repository.RepositoryFormat7',
88
                 'Transitional format in 0.8.  Slower than knit.',
89
                 branch_format='breezy.bzr.fullhistory.BzrBranchFormat5',
90
                 tree_format='breezy.bzr.workingtree_3.WorkingTreeFormat3',
91
                 hidden=True,
92
                 deprecated=True)
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
93
94
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
95
BzrProber.formats.register_lazy(
6855.3.1 by Jelmer Vernooij
Several more fixes.
96
    b"Bazaar-NG branch, format 0.0.4\n", "breezy.plugins.weave_fmt.bzrdir",
5582.10.90 by Jelmer Vernooij
Merge weave-bzrdir branch.
97
    "BzrDirFormat4")
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
98
BzrProber.formats.register_lazy(
6855.3.1 by Jelmer Vernooij
Several more fixes.
99
    b"Bazaar-NG branch, format 5\n", "breezy.plugins.weave_fmt.bzrdir",
5582.10.90 by Jelmer Vernooij
Merge weave-bzrdir branch.
100
    "BzrDirFormat5")
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
101
BzrProber.formats.register_lazy(
6855.3.1 by Jelmer Vernooij
Several more fixes.
102
    b"Bazaar-NG branch, format 6\n", "breezy.plugins.weave_fmt.bzrdir",
5582.10.90 by Jelmer Vernooij
Merge weave-bzrdir branch.
103
    "BzrDirFormat6")
104
5582.10.1 by Jelmer Vernooij
Move weave formats into bzrlib.plugins.weave_fmt.
105
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
106
_mod_branch.format_registry.register_extra_lazy(
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
107
    'breezy.plugins.weave_fmt.branch', 'BzrBranchFormat4')
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
108
_mod_branch.network_format_registry.register_lazy(
6855.3.1 by Jelmer Vernooij
Several more fixes.
109
    b"Bazaar-NG branch, format 6\n",
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
110
    'breezy.plugins.weave_fmt.branch', "BzrBranchFormat4")
5582.10.70 by Jelmer Vernooij
merge bzr.dev.
111
5582.10.83 by Jelmer Vernooij
merge weave-branch branch.
112
5718.2.2 by Jelmer Vernooij
Avoid name clashes.
113
_mod_workingtree.format_registry.register_extra_lazy(
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
114
    'breezy.plugins.weave_fmt.workingtree',
5582.10.65 by Jelmer Vernooij
Merge working tree format registry.
115
    'WorkingTreeFormat2')
5582.10.39 by Jelmer Vernooij
Merge extra wt formats.
116
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
117
serializer.format_registry.register_lazy('4', 'breezy.plugins.weave_fmt.xml4',
7143.15.2 by Jelmer Vernooij
Run autopep8.
118
                                         'serializer_v4')
119
5582.10.56 by Jelmer Vernooij
move xml4 to weave plugin.
120
6625.1.5 by Martin
Drop custom load_tests implementation and use unittest signature
121
def load_tests(loader, basic_tests, pattern):
5582.10.2 by Jelmer Vernooij
Move weave repository tests.
122
    testmod_names = [
5582.10.4 by Jelmer Vernooij
Fix a bunch of tests.
123
        'test_bzrdir',
5582.10.2 by Jelmer Vernooij
Move weave repository tests.
124
        'test_repository',
6686.2.1 by Jelmer Vernooij
Move breezy.store to breezy.plugins.weave_fmt, its only user.
125
        'test_store',
5582.10.15 by Jelmer Vernooij
Move workingtree tests.
126
        'test_workingtree',
5582.10.2 by Jelmer Vernooij
Move weave repository tests.
127
        ]
128
    basic_tests.addTest(loader.loadTestsFromModuleNames(
7143.15.2 by Jelmer Vernooij
Run autopep8.
129
        ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
5582.10.2 by Jelmer Vernooij
Move weave repository tests.
130
    return basic_tests