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

  • Committer: Jelmer Vernooij
  • Date: 2011-01-11 04:33:12 UTC
  • mto: (5582.12.2 weave-plugin)
  • mto: This revision was merged to the branch mainline in revision 5718.
  • Revision ID: jelmer@samba.org-20110111043312-g4wx6iuf9662f36d
Move weave formats into bzrlib.plugins.weave_fmt.

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 bzrlib import (
 
23
    branch,
 
24
    bzrdir,
 
25
    controldir,
 
26
    repository,
 
27
    )
 
28
 
 
29
# Pre-0.8 formats that don't have a disk format string (because they are
 
30
# versioned by the matching control directory). We use the control directories
 
31
# disk format string as a key for the network_name because they meet the
 
32
# constraints (simple string, unique, immutable).
 
33
repository.network_format_registry.register_lazy(
 
34
    "Bazaar-NG branch, format 5\n",
 
35
    'bzrlib.plugins.weave_fmt.repository',
 
36
    'RepositoryFormat5',
 
37
)
 
38
repository.network_format_registry.register_lazy(
 
39
    "Bazaar-NG branch, format 6\n",
 
40
    'bzrlib.plugins.weave_fmt.repository',
 
41
    'RepositoryFormat6',
 
42
)
 
43
 
 
44
# weave formats which has no format string and are not discoverable or independently
 
45
# creatable on disk, so are not registered in format_registry.  They're
 
46
# all in bzrlib.plugins.weave_fmt.repository now.  When an instance of one of these is
 
47
# needed, it's constructed directly by the BzrDir.  Non-native formats where
 
48
# the repository is not separately opened are similar.
 
49
 
 
50
repository.format_registry.register_lazy(
 
51
    'Bazaar-NG Repository format 7',
 
52
    'bzrlib.plugins.weave_fmt.repository',
 
53
    'RepositoryFormat7'
 
54
    )
 
55
 
 
56
 
 
57
# The pre-0.8 formats have their repository format network name registered in
 
58
# repository.py. MetaDir formats have their repository format network name
 
59
# inferred from their disk format string.
 
60
controldir.format_registry.register_lazy('weave',
 
61
    "bzrlib.plugins.weave_fmt.bzrdir", "BzrDirFormat6",
 
62
    'Pre-0.8 format.  Slower than knit and does not'
 
63
    ' support checkouts or shared repositories.',
 
64
    hidden=True,
 
65
    deprecated=True)
 
66
bzrdir.register_metadir(controldir.format_registry, 'metaweave',
 
67
    'bzrlib.plugins.weave_fmt.repository.RepositoryFormat7',
 
68
    'Transitional format in 0.8.  Slower than knit.',
 
69
    branch_format='bzrlib.branch.BzrBranchFormat5',
 
70
    tree_format='bzrlib.workingtree.WorkingTreeFormat3',
 
71
    hidden=True,
 
72
    deprecated=True)
 
73
 
 
74
 
 
75
from bzrlib.plugins.weave_fmt.bzrdir import BzrDirFormat4, BzrDirFormat5, BzrDirFormat6
 
76
bzrdir.BzrDirFormat.register_format(BzrDirFormat4())
 
77
bzrdir.BzrDirFormat.register_format(BzrDirFormat5())
 
78
bzrdir.BzrDirFormat.register_format(BzrDirFormat6())
 
79
 
 
80
branch.network_format_registry.register_lazy(
 
81
    "Bazaar-NG branch, format 6\n", "bzrlib.plugins.weave_fmt.branch",
 
82
    "BzrBranchFormat4")