Rev 3875: (jam) Ensure that repo_fmt.matching_bzrdir.repository_format matches. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Dec 1 19:07:26 GMT 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3875
revision-id: pqm at pqm.ubuntu.com-20081201190721-auckake4i6ws048z
parent: pqm at pqm.ubuntu.com-20081201071425-al48chdg4wlkbm31
parent: john at arbash-meinel.com-20081121215519-vwv3wcmzybz57bvx
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2008-12-01 19:07:21 +0000
message:
(jam) Ensure that repo_fmt.matching_bzrdir.repository_format matches.
modified:
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
------------------------------------------------------------
revno: 3845.1.1
revision-id: john at arbash-meinel.com-20081121215519-vwv3wcmzybz57bvx
parent: pqm at pqm.ubuntu.com-20081121044450-xgyehkv3u1da37wg
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: repo_matching_bzrdir
timestamp: Fri 2008-11-21 15:55:19 -0600
message:
Ensure that RepositoryFormat._matchingbzrdir.repository_format matches.
modified:
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py 2008-11-07 23:17:05 +0000
+++ b/bzrlib/bzrdir.py 2008-12-01 19:07:21 +0000
@@ -2650,6 +2650,11 @@
return False
return self.get_format_description() == other.get_format_description()
+ @property
+ def repository_format(self):
+ # Using a property to avoid early loading of remote
+ return remote.RemoteRepositoryFormat()
+
BzrDirFormat.register_control_server_format(RemoteBzrDirFormat)
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py 2008-11-27 09:00:45 +0000
+++ b/bzrlib/repofmt/pack_repo.py 2008-12-01 19:07:21 +0000
@@ -2313,8 +2313,10 @@
return xml7.serializer_v7
def _get_matching_bzrdir(self):
- return bzrdir.format_registry.make_bzrdir(
+ matching = bzrdir.format_registry.make_bzrdir(
'1.6.1-rich-root')
+ matching.repository_format = self
+ return matching
def _ignore_setting_bzrdir(self, format):
pass
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2008-11-28 02:33:04 +0000
+++ b/bzrlib/repository.py 2008-12-01 19:07:21 +0000
@@ -2258,7 +2258,12 @@
rich_root_data = False
supports_tree_reference = False
supports_external_lookups = False
- _matchingbzrdir = bzrdir.BzrDirMetaFormat1()
+
+ @property
+ def _matchingbzrdir(self):
+ matching = bzrdir.BzrDirMetaFormat1()
+ matching.repository_format = self
+ return matching
def __init__(self):
super(MetaDirRepositoryFormat, self).__init__()
=== modified file 'bzrlib/tests/per_repository/test_repository.py'
--- a/bzrlib/tests/per_repository/test_repository.py 2008-11-28 01:42:05 +0000
+++ b/bzrlib/tests/per_repository/test_repository.py 2008-12-01 19:07:21 +0000
@@ -291,6 +291,12 @@
self.assertEqual(self.repository_format,
repository.RepositoryFormat.find_format(opened_control))
+ def test_format_matchingbzrdir(self):
+ self.assertEqual(self.repository_format,
+ self.repository_format._matchingbzrdir.repository_format)
+ self.assertEqual(self.repository_format,
+ self.bzrdir_format.repository_format)
+
def test_create_repository(self):
# bzrdir can construct a repository for itself.
if not self.bzrdir_format.is_supported():
More information about the bazaar-commits
mailing list