Rev 3032: Remove the unneeded ExperimentalBranch class. in http://people.ubuntu.com/~robertc/baz2.0/branch-formats
Robert Collins
robertc at robertcollins.net
Tue Nov 27 00:44:35 GMT 2007
At http://people.ubuntu.com/~robertc/baz2.0/branch-formats
------------------------------------------------------------
revno: 3032
revision-id:robertc at robertcollins.net-20071127004420-ktt8r1716pm4xq80
parent: pqm at pqm.ubuntu.com-20071126224137-gnhd7r5hx7f0064k
committer: Robert Collins <robertc at robertcollins.net>
branch nick: branch-formats
timestamp: Tue 2007-11-27 11:44:20 +1100
message:
Remove the unneeded ExperimentalBranch class.
modified:
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/tests/test_revisionnamespaces.py testrevisionnamespaces.py-20050711050225-8b4af89e6b1efe84
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2007-11-16 01:35:31 +0000
+++ b/bzrlib/branch.py 2007-11-27 00:44:20 +0000
@@ -1806,107 +1806,6 @@
return None
-class BzrBranchExperimental(BzrBranch5):
- """Bzr experimental branch format
-
- This format has:
- - a revision-history file.
- - a format string
- - a lock dir guarding the branch itself
- - all of this stored in a branch/ subdirectory
- - works with shared repositories.
- - a tag dictionary in the branch
-
- This format is new in bzr 0.15, but shouldn't be used for real data,
- only for testing.
-
- This class acts as it's own BranchFormat.
- """
-
- _matchingbzrdir = bzrdir.BzrDirMetaFormat1()
-
- @classmethod
- def get_format_string(cls):
- """See BranchFormat.get_format_string()."""
- return "Bazaar-NG branch format experimental\n"
-
- @classmethod
- def get_format_description(cls):
- """See BranchFormat.get_format_description()."""
- return "Experimental branch format"
-
- @classmethod
- def get_reference(cls, a_bzrdir):
- """Get the target reference of the branch in a_bzrdir.
-
- format probing must have been completed before calling
- this method - it is assumed that the format of the branch
- in a_bzrdir is correct.
-
- :param a_bzrdir: The bzrdir to get the branch data from.
- :return: None if the branch is not a reference branch.
- """
- return None
-
- @classmethod
- def _initialize_control_files(cls, a_bzrdir, utf8_files, lock_filename,
- lock_class):
- branch_transport = a_bzrdir.get_branch_transport(cls)
- control_files = lockable_files.LockableFiles(branch_transport,
- lock_filename, lock_class)
- control_files.create_lock()
- control_files.lock_write()
- try:
- for filename, content in utf8_files:
- control_files.put_utf8(filename, content)
- finally:
- control_files.unlock()
-
- @classmethod
- def initialize(cls, a_bzrdir):
- """Create a branch of this format in a_bzrdir."""
- utf8_files = [('format', cls.get_format_string()),
- ('revision-history', ''),
- ('branch-name', ''),
- ('tags', ''),
- ]
- cls._initialize_control_files(a_bzrdir, utf8_files,
- 'lock', lockdir.LockDir)
- return cls.open(a_bzrdir, _found=True)
-
- @classmethod
- def open(cls, a_bzrdir, _found=False):
- """Return the branch object for a_bzrdir
-
- _found is a private parameter, do not use it. It is used to indicate
- if format probing has already be done.
- """
- if not _found:
- format = BranchFormat.find_format(a_bzrdir)
- assert format.__class__ == cls
- transport = a_bzrdir.get_branch_transport(None)
- control_files = lockable_files.LockableFiles(transport, 'lock',
- lockdir.LockDir)
- return cls(_format=cls,
- _control_files=control_files,
- a_bzrdir=a_bzrdir,
- _repository=a_bzrdir.find_repository())
-
- @classmethod
- def is_supported(cls):
- return True
-
- def _make_tags(self):
- return BasicTags(self)
-
- @classmethod
- def supports_tags(cls):
- return True
-
-
-BranchFormat.register_format(BzrBranchExperimental)
-
-
class BzrBranch6(BzrBranch5):
@needs_read_lock
=== modified file 'bzrlib/tests/test_revisionnamespaces.py'
--- a/bzrlib/tests/test_revisionnamespaces.py 2007-08-06 22:26:54 +0000
+++ b/bzrlib/tests/test_revisionnamespaces.py 2007-11-27 00:44:20 +0000
@@ -350,10 +350,8 @@
def make_branch_and_tree(self, relpath):
# override format as the default one may not support tags
- control = bzrdir.BzrDir.create(relpath)
- control.create_repository()
- branch.BzrBranchExperimental.initialize(control)
- return control.create_workingtree()
+ return TestRevisionSpec.make_branch_and_tree(
+ self, relpath, format='dirstate-tags')
def test_from_string_tag(self):
spec = RevisionSpec.from_string('tag:bzr-0.14')
More information about the bazaar-commits
mailing list