232
235
t = _mod_transport.get_transport(url)
236
def find_bzrdirs(transport, evaluate=None, list_current=None):
237
"""Find bzrdirs recursively from current location.
239
This is intended primarily as a building block for more sophisticated
240
functionality, like finding trees under a directory, or finding
241
branches that use a given repository.
243
:param evaluate: An optional callable that yields recurse, value,
244
where recurse controls whether this bzrdir is recursed into
245
and value is the value to yield. By default, all bzrdirs
246
are recursed into, and the return value is the bzrdir.
247
:param list_current: if supplied, use this function to list the current
248
directory, instead of Transport.list_dir
249
:return: a generator of found bzrdirs, or whatever evaluate returns.
251
if list_current is None:
252
def list_current(transport):
253
return transport.list_dir('')
255
def evaluate(bzrdir):
258
pending = [transport]
259
while len(pending) > 0:
260
current_transport = pending.pop()
263
bzrdir = BzrDir.open_from_transport(current_transport)
264
except (errors.NotBranchError, errors.PermissionDenied):
267
recurse, value = evaluate(bzrdir)
270
subdirs = list_current(current_transport)
271
except (errors.NoSuchFile, errors.PermissionDenied):
274
for subdir in sorted(subdirs, reverse=True):
275
pending.append(current_transport.clone(subdir))
278
def find_branches(transport):
279
"""Find all branches under a transport.
281
This will find all branches below the transport, including branches
282
inside other branches. Where possible, it will use
283
Repository.find_branches.
285
To list all the branches that use a particular Repository, see
286
Repository.find_branches
288
def evaluate(bzrdir):
290
repository = bzrdir.open_repository()
291
except errors.NoRepositoryPresent:
294
return False, ([], repository)
295
return True, (bzrdir.list_branches(), None)
297
for branches, repo in BzrDir.find_bzrdirs(transport,
300
ret.extend(repo.find_branches())
301
if branches is not None:
306
def create_branch_and_repo(base, force_new_repo=False, format=None):
307
"""Create a new BzrDir, Branch and Repository at the url 'base'.
309
This will use the current default BzrDirFormat unless one is
310
specified, and use whatever
311
repository format that that uses via bzrdir.create_branch and
312
create_repository. If a shared repository is available that is used
315
The created Branch object is returned.
317
:param base: The URL to create the branch at.
318
:param force_new_repo: If True a new repository is always created.
319
:param format: If supplied, the format of branch to create. If not
320
supplied, the default is used.
322
bzrdir = BzrDir.create(base, format)
323
bzrdir._find_or_create_repository(force_new_repo)
324
return bzrdir.create_branch()
326
238
def determine_repository_policy(self, force_new_repo=False, stack_on=None,
327
239
stack_on_pwd=None, require_stacking=False):
328
240
"""Return an object representing a policy to use.
549
def create_branch_convenience(base, force_new_repo=False,
550
force_new_tree=None, format=None,
551
possible_transports=None):
552
"""Create a new BzrDir, Branch and Repository at the url 'base'.
554
This is a convenience function - it will use an existing repository
555
if possible, can be told explicitly whether to create a working tree or
558
This will use the current default BzrDirFormat unless one is
559
specified, and use whatever
560
repository format that that uses via bzrdir.create_branch and
561
create_repository. If a shared repository is available that is used
562
preferentially. Whatever repository is used, its tree creation policy
565
The created Branch object is returned.
566
If a working tree cannot be made due to base not being a file:// url,
567
no error is raised unless force_new_tree is True, in which case no
568
data is created on disk and NotLocalUrl is raised.
570
:param base: The URL to create the branch at.
571
:param force_new_repo: If True a new repository is always created.
572
:param force_new_tree: If True or False force creation of a tree or
573
prevent such creation respectively.
574
:param format: Override for the bzrdir format to create.
575
:param possible_transports: An optional reusable transports list.
578
# check for non local urls
579
t = _mod_transport.get_transport(base, possible_transports)
580
if not isinstance(t, local.LocalTransport):
581
raise errors.NotLocalUrl(base)
582
bzrdir = BzrDir.create(base, format, possible_transports)
583
repo = bzrdir._find_or_create_repository(force_new_repo)
584
result = bzrdir.create_branch()
585
if force_new_tree or (repo.make_working_trees() and
586
force_new_tree is None):
588
bzrdir.create_workingtree()
589
except errors.NotLocalUrl:
594
def create_standalone_workingtree(base, format=None):
595
"""Create a new BzrDir, WorkingTree, Branch and Repository at 'base'.
597
'base' must be a local path or a file:// url.
599
This will use the current default BzrDirFormat unless one is
600
specified, and use whatever
601
repository format that that uses for bzrdirformat.create_workingtree,
602
create_branch and create_repository.
604
:param format: Override for the bzrdir format to create.
605
:return: The WorkingTree object.
607
t = _mod_transport.get_transport(base)
608
if not isinstance(t, local.LocalTransport):
609
raise errors.NotLocalUrl(base)
610
bzrdir = BzrDir.create_branch_and_repo(base,
612
format=format).bzrdir
613
return bzrdir.create_workingtree()
615
467
@deprecated_method(deprecated_in((2, 3, 0)))
616
468
def generate_backup_name(self, base):
617
469
return self._available_backup_name(base)
814
666
# add new tests for it to the appropriate place.
815
667
return filename == '.bzr' or filename.startswith('.bzr/')
818
def open_unsupported(base):
819
"""Open a branch which is not supported."""
820
return BzrDir.open(base, _unsupported=True)
823
def open(base, _unsupported=False, possible_transports=None):
824
"""Open an existing bzrdir, rooted at 'base' (url).
826
:param _unsupported: a private parameter to the BzrDir class.
828
t = _mod_transport.get_transport(base, possible_transports)
829
return BzrDir.open_from_transport(t, _unsupported=_unsupported)
832
def open_from_transport(transport, _unsupported=False,
833
_server_formats=True):
834
"""Open a bzrdir within a particular directory.
836
:param transport: Transport containing the bzrdir.
837
:param _unsupported: private.
839
for hook in BzrDir.hooks['pre_open']:
841
# Keep initial base since 'transport' may be modified while following
843
base = transport.base
844
def find_format(transport):
845
return transport, controldir.ControlDirFormat.find_format(
846
transport, _server_formats=_server_formats)
848
def redirected(transport, e, redirection_notice):
849
redirected_transport = transport._redirected_to(e.source, e.target)
850
if redirected_transport is None:
851
raise errors.NotBranchError(base)
852
note('%s is%s redirected to %s',
853
transport.base, e.permanently, redirected_transport.base)
854
return redirected_transport
857
transport, format = do_catching_redirections(find_format,
860
except errors.TooManyRedirections:
861
raise errors.NotBranchError(base)
863
format.check_support_status(_unsupported)
864
return format.open(transport, _found=True)
867
def open_containing(url, possible_transports=None):
868
"""Open an existing branch which contains url.
870
:param url: url to search from.
872
See open_containing_from_transport for more detail.
874
transport = _mod_transport.get_transport(url, possible_transports)
875
return BzrDir.open_containing_from_transport(transport)
878
def open_containing_from_transport(a_transport):
879
"""Open an existing branch which contains a_transport.base.
881
This probes for a branch at a_transport, and searches upwards from there.
883
Basically we keep looking up until we find the control directory or
884
run into the root. If there isn't one, raises NotBranchError.
885
If there is one and it is either an unrecognised format or an unsupported
886
format, UnknownFormatError or UnsupportedFormatError are raised.
887
If there is one, it is returned, along with the unused portion of url.
889
:return: The BzrDir that contains the path, and a Unicode path
890
for the rest of the URL.
892
# this gets the normalised url back. I.e. '.' -> the full path.
893
url = a_transport.base
896
result = BzrDir.open_from_transport(a_transport)
897
return result, urlutils.unescape(a_transport.relpath(url))
898
except errors.NotBranchError, e:
901
new_t = a_transport.clone('..')
902
except errors.InvalidURLJoin:
903
# reached the root, whatever that may be
904
raise errors.NotBranchError(path=url)
905
if new_t.base == a_transport.base:
906
# reached the root, whatever that may be
907
raise errors.NotBranchError(path=url)
911
def open_tree_or_branch(klass, location):
912
"""Return the branch and working tree at a location.
914
If there is no tree at the location, tree will be None.
915
If there is no branch at the location, an exception will be
917
:return: (tree, branch)
919
bzrdir = klass.open(location)
920
return bzrdir._get_tree_branch()
923
def open_containing_tree_or_branch(klass, location):
924
"""Return the branch and working tree contained by a location.
926
Returns (tree, branch, relpath).
927
If there is no tree at containing the location, tree will be None.
928
If there is no branch containing the location, an exception will be
930
relpath is the portion of the path that is contained by the branch.
932
bzrdir, relpath = klass.open_containing(location)
933
tree, branch = bzrdir._get_tree_branch()
934
return tree, branch, relpath
937
def open_containing_tree_branch_or_repository(klass, location):
938
"""Return the working tree, branch and repo contained by a location.
940
Returns (tree, branch, repository, relpath).
941
If there is no tree containing the location, tree will be None.
942
If there is no branch containing the location, branch will be None.
943
If there is no repository containing the location, repository will be
945
relpath is the portion of the path that is contained by the innermost
948
If no tree, branch or repository is found, a NotBranchError is raised.
950
bzrdir, relpath = klass.open_containing(location)
952
tree, branch = bzrdir._get_tree_branch()
953
except errors.NotBranchError:
955
repo = bzrdir.find_repository()
956
return None, None, repo, relpath
957
except (errors.NoRepositoryPresent):
958
raise errors.NotBranchError(location)
959
return tree, branch, branch.repository, relpath
961
669
def _cloning_metadir(self):
962
670
"""Produce a metadir suitable for cloning with.
1079
769
raise NotImplementedError(self.get_workingtree_transport)
1082
class BzrDirHooks(hooks.Hooks):
1083
"""Hooks for BzrDir operations."""
1086
"""Create the default hooks."""
1087
hooks.Hooks.__init__(self, "bzrlib.bzrdir", "BzrDir.hooks")
1088
self.add_hook('pre_open',
1089
"Invoked before attempting to open a BzrDir with the transport "
1090
"that the open will use.", (1, 14))
1091
self.add_hook('post_repo_init',
1092
"Invoked after a repository has been initialized. "
1093
"post_repo_init is called with a "
1094
"bzrlib.bzrdir.RepoInitHookParams.",
1097
# install the default hooks
1098
BzrDir.hooks = BzrDirHooks()
1101
class RepoInitHookParams(object):
1102
"""Object holding parameters passed to `*_repo_init` hooks.
1104
There are 4 fields that hooks may wish to access:
1106
:ivar repository: Repository created
1107
:ivar format: Repository format
1108
:ivar bzrdir: The bzrdir for the repository
1109
:ivar shared: The repository is shared
1112
def __init__(self, repository, format, a_bzrdir, shared):
1113
"""Create a group of RepoInitHook parameters.
1115
:param repository: Repository created
1116
:param format: Repository format
1117
:param bzrdir: The bzrdir for the repository
1118
:param shared: The repository is shared
772
def create(cls, base, format=None, possible_transports=None):
773
"""Create a new BzrDir at the url 'base'.
775
:param format: If supplied, the format of branch to create. If not
776
supplied, the default is used.
777
:param possible_transports: If supplied, a list of transports that
778
can be reused to share a remote connection.
1120
self.repository = repository
1121
self.format = format
1122
self.bzrdir = a_bzrdir
1123
self.shared = shared
1125
def __eq__(self, other):
1126
return self.__dict__ == other.__dict__
780
if cls is not BzrDir:
781
raise AssertionError("BzrDir.create always creates the "
782
"default format, not one of %r" % cls)
783
return controldir.ControlDir.create(base, format=format,
784
possible_transports=possible_transports)
1128
786
def __repr__(self):
1130
return "<%s for %s>" % (self.__class__.__name__,
1133
return "<%s for %s>" % (self.__class__.__name__,
787
return "<%s at %r>" % (self.__class__.__name__, self.user_url)
789
def update_feature_flags(self, updated_flags):
790
"""Update the features required by this bzrdir.
792
:param updated_flags: Dictionary mapping feature names to necessities
793
A necessity can be None to indicate the feature should be removed
795
self.control_files.lock_write()
797
self._format._update_feature_flags(updated_flags)
798
self.transport.put_bytes('branch-format', self._format.as_string())
800
self.control_files.unlock()
1137
803
class BzrDirMeta1(BzrDir):
1297
976
def open_branch(self, name=None, unsupported=False,
1298
ignore_fallbacks=False):
1299
"""See BzrDir.open_branch."""
977
ignore_fallbacks=False, possible_transports=None):
978
"""See ControlDir.open_branch."""
980
name = self._get_selected_branch()
1300
981
format = self.find_branch_format(name=name)
1301
982
format.check_support_status(unsupported)
1302
983
return format.open(self, name=name,
1303
_found=True, ignore_fallbacks=ignore_fallbacks)
984
_found=True, ignore_fallbacks=ignore_fallbacks,
985
possible_transports=possible_transports)
1305
987
def open_repository(self, unsupported=False):
1306
988
"""See BzrDir.open_repository."""
1307
from bzrlib.repository import RepositoryFormat
1308
format = RepositoryFormat.find_format(self)
989
from bzrlib.repository import RepositoryFormatMetaDir
990
format = RepositoryFormatMetaDir.find_format(self)
1309
991
format.check_support_status(unsupported)
1310
992
return format.open(self, _found=True)
1312
994
def open_workingtree(self, unsupported=False,
1313
995
recommend_upgrade=True):
1314
996
"""See BzrDir.open_workingtree."""
1315
from bzrlib.workingtree import WorkingTreeFormat
1316
format = WorkingTreeFormat.find_format(self)
997
from bzrlib.workingtree import WorkingTreeFormatMetaDir
998
format = WorkingTreeFormatMetaDir.find_format(self)
1317
999
format.check_support_status(unsupported, recommend_upgrade,
1318
1000
basedir=self.root_transport.base)
1319
1001
return format.open(self, _found=True)
1322
1004
return config.TransportConfig(self.transport, 'control.conf')
1007
class BzrDirMeta1Colo(BzrDirMeta1):
1008
"""BzrDirMeta1 with support for colocated branches.
1010
This format is experimental, and will eventually be merged back into
1014
def _get_branch_path(self, name):
1015
"""Obtain the branch path to use.
1017
This uses the API specified branch name first, and then falls back to
1018
the branch name specified in the URL. If neither of those is specified,
1019
it uses the default branch.
1021
:param name: Optional branch name to use
1022
:return: Relative path to branch
1026
return urlutils.join('branches', name.encode("utf-8"))
1028
def _read_branch_list(self):
1029
"""Read the branch list.
1031
:return: List of utf-8 encoded branch names.
1034
f = self.control_transport.get('branch-list')
1035
except errors.NoSuchFile:
1041
ret.append(name.rstrip("\n"))
1046
def _write_branch_list(self, branches):
1047
"""Write out the branch list.
1049
:param branches: List of utf-8 branch names to write
1051
self.transport.put_bytes('branch-list',
1052
"".join([name+"\n" for name in branches]))
1054
def destroy_branch(self, name=None):
1055
"""See BzrDir.create_branch."""
1057
name = self._get_selected_branch()
1058
path = self._get_branch_path(name)
1059
if name is not None:
1060
self.control_files.lock_write()
1062
branches = self._read_branch_list()
1064
branches.remove(name.encode("utf-8"))
1066
raise errors.NotBranchError(name)
1067
self._write_branch_list(branches)
1069
self.control_files.unlock()
1070
self.transport.delete_tree(path)
1072
def get_branches(self):
1073
"""See ControlDir.get_branches."""
1076
ret[None] = self.open_branch()
1077
except (errors.NotBranchError, errors.NoRepositoryPresent):
1080
for name in self._read_branch_list():
1081
ret[name] = self.open_branch(name.decode('utf-8'))
1085
def get_branch_transport(self, branch_format, name=None):
1086
"""See BzrDir.get_branch_transport()."""
1087
path = self._get_branch_path(name)
1088
# XXX: this shouldn't implicitly create the directory if it's just
1089
# promising to get a transport -- mbp 20090727
1090
if branch_format is None:
1091
return self.transport.clone(path)
1093
branch_format.get_format_string()
1094
except NotImplementedError:
1095
raise errors.IncompatibleFormat(branch_format, self._format)
1096
if name is not None:
1098
self.transport.mkdir('branches', mode=self._get_mkdir_mode())
1099
except errors.FileExists:
1101
branches = self._read_branch_list()
1102
utf8_name = name.encode("utf-8")
1103
if not utf8_name in branches:
1104
self.control_files.lock_write()
1106
branches = self._read_branch_list()
1107
branches.append(utf8_name)
1108
self._write_branch_list(branches)
1110
self.control_files.unlock()
1112
self.transport.mkdir(path, mode=self._get_mkdir_mode())
1113
except errors.FileExists:
1115
return self.transport.clone(path)
1118
class BzrFormat(object):
1119
"""Base class for all formats of things living in metadirs.
1121
This class manages the format string that is stored in the 'format'
1122
or 'branch-format' file.
1124
All classes for (branch-, repository-, workingtree-) formats that
1125
live in meta directories and have their own 'format' file
1126
(i.e. different from .bzr/branch-format) derive from this class,
1127
as well as the relevant base class for their kind
1128
(BranchFormat, WorkingTreeFormat, RepositoryFormat).
1130
Each format is identified by a "format" or "branch-format" file with a
1131
single line containing the base format name and then an optional list of
1134
Feature flags are supported as of bzr 2.5. Setting feature flags on formats
1135
will render them inaccessible to older versions of bzr.
1137
:ivar features: Dictionary mapping feature names to their necessity
1140
_present_features = set()
1146
def register_feature(cls, name):
1147
"""Register a feature as being present.
1149
:param name: Name of the feature
1152
raise ValueError("spaces are not allowed in feature names")
1153
if name in cls._present_features:
1154
raise errors.FeatureAlreadyRegistered(name)
1155
cls._present_features.add(name)
1158
def unregister_feature(cls, name):
1159
"""Unregister a feature."""
1160
cls._present_features.remove(name)
1162
def check_support_status(self, allow_unsupported, recommend_upgrade=True,
1164
for name, necessity in self.features.iteritems():
1165
if name in self._present_features:
1167
if necessity == "optional":
1168
mutter("ignoring optional missing feature %s", name)
1170
elif necessity == "required":
1171
raise errors.MissingFeature(name)
1173
mutter("treating unknown necessity as require for %s",
1175
raise errors.MissingFeature(name)
1178
def get_format_string(cls):
1179
"""Return the ASCII format string that identifies this format."""
1180
raise NotImplementedError(cls.get_format_string)
1183
def from_string(cls, text):
1184
format_string = cls.get_format_string()
1185
if not text.startswith(format_string):
1186
raise AssertionError("Invalid format header %r for %r" % (text, cls))
1187
lines = text[len(format_string):].splitlines()
1189
for lineno, line in enumerate(lines):
1191
(necessity, feature) = line.split(" ", 1)
1193
raise errors.ParseFormatError(format=cls, lineno=lineno+2,
1194
line=line, text=text)
1195
ret.features[feature] = necessity
1198
def as_string(self):
1199
"""Return the string representation of this format.
1201
lines = [self.get_format_string()]
1202
lines.extend([("%s %s\n" % (item[1], item[0])) for item in
1203
self.features.iteritems()])
1204
return "".join(lines)
1207
def _find_format(klass, registry, kind, format_string):
1209
first_line = format_string[:format_string.index("\n")+1]
1211
first_line = format_string
1213
cls = registry.get(first_line)
1215
raise errors.UnknownFormatError(format=first_line, kind=kind)
1216
return cls.from_string(format_string)
1218
def network_name(self):
1219
"""A simple byte string uniquely identifying this format for RPC calls.
1221
Metadir branch formats use their format string.
1223
return self.as_string()
1225
def __eq__(self, other):
1226
return (self.__class__ is other.__class__ and
1227
self.features == other.features)
1229
def _update_feature_flags(self, updated_flags):
1230
"""Update the feature flags in this format.
1232
:param updated_flags: Updated feature flags
1234
for name, necessity in updated_flags.iteritems():
1235
if necessity is None:
1237
del self.features[name]
1241
self.features[name] = necessity
1325
1244
class BzrProber(controldir.Prober):
1326
1245
"""Prober for formats that use a .bzr/ control directory."""
1908
1880
return to_convert
1883
class ConvertMetaToColo(controldir.Converter):
1884
"""Add colocated branch support."""
1886
def __init__(self, target_format):
1887
"""Create a converter.that upgrades a metadir to the colo format.
1889
:param target_format: The final metadir format that is desired.
1891
self.target_format = target_format
1893
def convert(self, to_convert, pb):
1894
"""See Converter.convert()."""
1895
to_convert.transport.put_bytes('branch-format',
1896
self.target_format.as_string())
1897
return BzrDir.open_from_transport(to_convert.root_transport)
1900
class ConvertMetaRemoveColo(controldir.Converter):
1901
"""Remove colocated branch support from a bzrdir."""
1903
def __init__(self, target_format):
1904
"""Create a converter.that downgrades a colocated branch metadir
1905
to a regular metadir.
1907
:param target_format: The final metadir format that is desired.
1909
self.target_format = target_format
1911
def convert(self, to_convert, pb):
1912
"""See Converter.convert()."""
1913
to_convert.control_files.lock_write()
1915
branches = to_convert.list_branches()
1916
if len(branches) > 1:
1917
raise errors.BzrError("remove all but a single "
1918
"colocated branch when downgrading")
1920
to_convert.control_files.unlock()
1921
to_convert.transport.put_bytes('branch-format',
1922
self.target_format.as_string())
1923
return BzrDir.open_from_transport(to_convert.root_transport)
1911
1926
controldir.ControlDirFormat.register_server_prober(RemoteBzrProber)
2021
2037
require_stacking)
2022
2038
self._bzrdir = bzrdir
2024
def acquire_repository(self, make_working_trees=None, shared=False):
2040
def acquire_repository(self, make_working_trees=None, shared=False,
2041
possible_transports=None):
2025
2042
"""Implementation of RepositoryAcquisitionPolicy.acquire_repository
2027
2044
Creates the desired repository in the bzrdir we already have.
2046
if possible_transports is None:
2047
possible_transports = []
2049
possible_transports = list(possible_transports)
2050
possible_transports.append(self._bzrdir.root_transport)
2029
2051
stack_on = self._get_full_stack_on()
2031
2053
format = self._bzrdir._format
2032
2054
format.require_stacking(stack_on=stack_on,
2033
possible_transports=[self._bzrdir.root_transport])
2055
possible_transports=possible_transports)
2034
2056
if not self._require_stacking:
2035
2057
# We have picked up automatic stacking somewhere.
2036
note('Using default stacking branch %s at %s', self._stack_on,
2058
note(gettext('Using default stacking branch {0} at {1}').format(
2059
self._stack_on, self._stack_on_pwd))
2038
2060
repository = self._bzrdir.create_repository(shared=shared)
2039
2061
self._add_fallback(repository,
2040
possible_transports=[self._bzrdir.transport])
2062
possible_transports=possible_transports)
2041
2063
if make_working_trees is not None:
2042
2064
repository.set_make_working_trees(make_working_trees)
2043
2065
return repository, True
2122
2152
deprecated=True)
2123
2153
register_metadir(controldir.format_registry, 'dirstate',
2124
2154
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2125
help='New in 0.15: Fast local operations. Compatible with bzr 0.8 and '
2126
'above when accessed over the network.',
2155
help='Format using dirstate for working trees. '
2156
'Compatible with bzr 0.8 and '
2157
'above when accessed over the network. Introduced in bzr 0.15.',
2127
2158
branch_format='bzrlib.branch.BzrBranchFormat5',
2128
2159
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2130
2161
deprecated=True)
2131
2162
register_metadir(controldir.format_registry, 'dirstate-tags',
2132
2163
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2133
help='New in 0.15: Fast local operations and improved scaling for '
2134
'network operations. Additionally adds support for tags.'
2135
' Incompatible with bzr < 0.15.',
2164
help='Variant of dirstate with support for tags. '
2165
'Introduced in bzr 0.15.',
2136
2166
branch_format='bzrlib.branch.BzrBranchFormat6',
2137
2167
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2139
2169
deprecated=True)
2140
2170
register_metadir(controldir.format_registry, 'rich-root',
2141
2171
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit4',
2142
help='New in 1.0. Better handling of tree roots. Incompatible with'
2172
help='Variant of dirstate with better handling of tree roots. '
2173
'Introduced in bzr 1.0',
2144
2174
branch_format='bzrlib.branch.BzrBranchFormat6',
2145
2175
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2147
2177
deprecated=True)
2148
2178
register_metadir(controldir.format_registry, 'dirstate-with-subtree',
2149
2179
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit3',
2150
help='New in 0.15: Fast local operations and improved scaling for '
2151
'network operations. Additionally adds support for versioning nested '
2152
'bzr branches. Incompatible with bzr < 0.15.',
2180
help='Variant of dirstate with support for nested trees. '
2181
'Introduced in 0.15.',
2153
2182
branch_format='bzrlib.branch.BzrBranchFormat6',
2154
2183
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2155
2184
experimental=True,
2158
2187
register_metadir(controldir.format_registry, 'pack-0.92',
2159
2188
'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack1',
2160
help='New in 0.92: Pack-based format with data compatible with '
2161
'dirstate-tags format repositories. Interoperates with '
2162
'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2189
help='Pack-based format used in 1.x series. Introduced in 0.92. '
2190
'Interoperates with bzr repositories before 0.92 but cannot be '
2191
'read by bzr < 0.92. '
2164
2193
branch_format='bzrlib.branch.BzrBranchFormat6',
2165
2194
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2167
2197
register_metadir(controldir.format_registry, 'pack-0.92-subtree',
2168
2198
'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack3',
2169
help='New in 0.92: Pack-based format with data compatible with '
2170
'dirstate-with-subtree format repositories. Interoperates with '
2199
help='Pack-based format used in 1.x series, with subtree support. '
2200
'Introduced in 0.92. Interoperates with '
2171
2201
'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2173
2203
branch_format='bzrlib.branch.BzrBranchFormat6',
2174
2204
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2176
2207
experimental=True,
2178
2209
register_metadir(controldir.format_registry, 'rich-root-pack',
2179
2210
'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack4',
2180
help='New in 1.0: A variant of pack-0.92 that supports rich-root data '
2181
'(needed for bzr-svn and bzr-git).',
2211
help='A variant of pack-0.92 that supports rich-root data '
2212
'(needed for bzr-svn and bzr-git). Introduced in 1.0.',
2182
2213
branch_format='bzrlib.branch.BzrBranchFormat6',
2183
2214
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2186
2218
register_metadir(controldir.format_registry, '1.6',
2187
2219
'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5',