112
113
"""See BzrBranchFormat.get_format_string()."""
113
114
return "Sample branch format."
115
def initialize(self, a_bzrdir, name=None):
116
def initialize(self, a_bzrdir, name=None, repository=None):
116
117
"""Format 4 branches cannot be created."""
117
118
t = a_bzrdir.get_branch_transport(self, name=name)
118
119
t.put_bytes('format', self.get_format_string())
266
267
def test_config(self):
267
268
"""Ensure that all configuration data is stored in the branch"""
268
269
branch = self.make_branch('a', format=self.get_format_name())
269
branch.set_parent('http://bazaar-vcs.org')
270
branch.set_parent('http://example.com')
270
271
self.failIfExists('a/.bzr/branch/parent')
271
self.assertEqual('http://bazaar-vcs.org', branch.get_parent())
272
branch.set_push_location('sftp://bazaar-vcs.org')
272
self.assertEqual('http://example.com', branch.get_parent())
273
branch.set_push_location('sftp://example.com')
273
274
config = branch.get_config()._get_branch_data_config()
274
self.assertEqual('sftp://bazaar-vcs.org',
275
self.assertEqual('sftp://example.com',
275
276
config.get_user_option('push_location'))
276
branch.set_bound_location('ftp://bazaar-vcs.org')
277
branch.set_bound_location('ftp://example.com')
277
278
self.failIfExists('a/.bzr/branch/bound')
278
self.assertEqual('ftp://bazaar-vcs.org', branch.get_bound_location())
279
self.assertEqual('ftp://example.com', branch.get_bound_location())
280
281
def test_set_revision_history(self):
281
282
builder = self.make_branch_builder('.', format=self.get_format_name())
622
623
# this usage of results is not recommended for new code (because it
623
624
# doesn't describe very well what happened), but for api stability
624
625
# it's still supported
625
a = "%d revisions pulled" % r
626
self.assertEqual(a, "10 revisions pulled")
626
self.assertEqual(self.applyDeprecated(
627
symbol_versioning.deprecated_in((2, 3, 0)),
628
631
def test_report_changed(self):
629
632
r = _mod_branch.PullResult()