Rev 3552: (mbp, mwh) #249256 fix branching from hpss in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Jul 17 08:03:07 BST 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3552
revision-id:pqm at pqm.ubuntu.com-20080717070254-h8qltle17foj2pao
parent: pqm at pqm.ubuntu.com-20080717064451-za459i23yr9zwbul
parent: mbp at sourcefrog.net-20080717062818-h721wix3vsbz7nh1
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2008-07-17 08:02:54 +0100
message:
(mbp,mwh) #249256 fix branching from hpss
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/tests/repository_implementations/__init__.py __init__.py-20060131092037-9564957a7d4a841b
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
bzrlib/tests/tree_implementations/__init__.py __init__.py-20060717075546-420s7b0bj9hzeowi-2
bzrlib/tests/workingtree_implementations/__init__.py __init__.py-20060203003124-b2aa5aca21a8bfad
------------------------------------------------------------
revno: 3543.1.10
revision-id:mbp at sourcefrog.net-20080717062818-h721wix3vsbz7nh1
parent: mbp at sourcefrog.net-20080717052124-xid720zxsxmk8o53
parent: pqm at pqm.ubuntu.com-20080717023455-idnyms69oiauf7fh
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 16:28:18 +1000
message:
merge news
added:
tools/win32/run_script.py run_script.py-20080717003927-k6itvarbtnwk44o9-1
modified:
Makefile Makefile-20050805140406-d96e3498bb61c5bb
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/symbol_versioning.py symbol_versioning.py-20060105104851-9ecf8af605d15a80
bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
doc/en/user-guide/organizing_branches.txt organizing_branches.-20071123154453-dk2mjhrg1vpjm5w2-3
tools/rst2html.py rst2html.py-20060817120932-gn177u8v0008txhu-1
------------------------------------------------------------
revno: 3543.1.9
revision-id:mbp at sourcefrog.net-20080717052124-xid720zxsxmk8o53
parent: mbp at sourcefrog.net-20080717030611-x1wdjm4wm6hsertb
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 15:21:24 +1000
message:
update news
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
------------------------------------------------------------
revno: 3543.1.8
revision-id:mbp at sourcefrog.net-20080717030611-x1wdjm4wm6hsertb
parent: mbp at sourcefrog.net-20080717024932-um071rheljrlwepd
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 13:06:11 +1000
message:
Update more scenario tests to use real format objects.
modified:
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 3543.1.7
revision-id:mbp at sourcefrog.net-20080717024932-um071rheljrlwepd
parent: mbp at sourcefrog.net-20080717024921-g11vc1e6w47oiis2
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 12:49:32 +1000
message:
doc
modified:
bzrlib/tests/tree_implementations/__init__.py __init__.py-20060717075546-420s7b0bj9hzeowi-2
------------------------------------------------------------
revno: 3543.1.6
revision-id:mbp at sourcefrog.net-20080717024921-g11vc1e6w47oiis2
parent: mbp at sourcefrog.net-20080717023859-i3wv9s6po91zx5az
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 12:49:21 +1000
message:
update TestTreeProviderAdapter to pass real formats
modified:
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 3543.1.5
revision-id:mbp at sourcefrog.net-20080717023859-i3wv9s6po91zx5az
parent: mbp at sourcefrog.net-20080717023738-13o1ejb12j819ip2
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 12:38:59 +1000
message:
remove redundant test_setting_vfs_transport
modified:
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 3543.1.4
revision-id:mbp at sourcefrog.net-20080717023738-13o1ejb12j819ip2
parent: mbp at sourcefrog.net-20080717023707-oyyujrw0pllugjqs
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 12:37:38 +1000
message:
test_formats_to_scenarios uses real format objects
modified:
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 3543.1.3
revision-id:mbp at sourcefrog.net-20080717023707-oyyujrw0pllugjqs
parent: michael.hudson at canonical.com-20080717004332-aqxut6zkoi0hiyl7
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: 249256-tree-from-remote
timestamp: Thu 2008-07-17 12:37:07 +1000
message:
Better docstring for formats_to_scenarios
modified:
bzrlib/tests/repository_implementations/__init__.py __init__.py-20060131092037-9564957a7d4a841b
------------------------------------------------------------
revno: 3543.1.2
revision-id:michael.hudson at canonical.com-20080717004332-aqxut6zkoi0hiyl7
parent: michael.hudson at canonical.com-20080717004240-zgixph3tnbc9xvfd
committer: Michael Hudson <michael.hudson at canonical.com>
branch nick: create-tree-from-remote-branch-bug-249256
timestamp: Thu 2008-07-17 12:43:32 +1200
message:
the two character fix
modified:
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
------------------------------------------------------------
revno: 3543.1.1
revision-id:michael.hudson at canonical.com-20080717004240-zgixph3tnbc9xvfd
parent: pqm at pqm.ubuntu.com-20080716183624-7yu6n1raw6sa4x80
committer: Michael Hudson <michael.hudson at canonical.com>
branch nick: create-tree-from-remote-branch-bug-249256
timestamp: Thu 2008-07-17 12:42:40 +1200
message:
change the scenario multiplication to get the bzrdir format from the tree and
repository classes, even in the remote cases.
modified:
bzrlib/tests/repository_implementations/__init__.py __init__.py-20060131092037-9564957a7d4a841b
bzrlib/tests/tree_implementations/__init__.py __init__.py-20060717075546-420s7b0bj9hzeowi-2
bzrlib/tests/workingtree_implementations/__init__.py __init__.py-20060203003124-b2aa5aca21a8bfad
=== modified file 'NEWS'
--- a/NEWS 2008-07-17 06:44:51 +0000
+++ b/NEWS 2008-07-17 07:02:54 +0000
@@ -78,6 +78,9 @@
still in ``.bzr.log`` and can be shown with ``-Derror``.
(Martin Pool, #240161)
+ * Fixed problem in branching from smart server.
+ (#249256, Michael Hudson, Martin Pool)
+
* Fetch from a stacked branch copies all required data.
(Aaron Bentley, #248506)
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py 2008-07-16 07:30:18 +0000
+++ b/bzrlib/remote.py 2008-07-17 00:43:32 +0000
@@ -242,7 +242,7 @@
the class level.
"""
- _matchingbzrdir = RemoteBzrDirFormat
+ _matchingbzrdir = RemoteBzrDirFormat()
def initialize(self, a_bzrdir, shared=False):
if not isinstance(a_bzrdir, RemoteBzrDir):
=== modified file 'bzrlib/tests/repository_implementations/__init__.py'
--- a/bzrlib/tests/repository_implementations/__init__.py 2008-07-07 10:31:06 +0000
+++ b/bzrlib/tests/repository_implementations/__init__.py 2008-07-17 02:37:07 +0000
@@ -54,17 +54,20 @@
vfs_transport_factory=None):
"""Transform the input formats to a list of scenarios.
- :param formats: A list of (scenario_name_suffix, repo_format, bzrdir_format)
- where the scenario_info is a dict that controls the test.
+ :param formats: A list of (scenario_name_suffix, repo_format)
+ where the scenario_name_suffix is to be appended to the format
+ name, and the repo_format is a RepositoryFormat subclass
+ instance.
+ :returns: Scenarios of [(scenario_name, {parameter_name: value})]
"""
result = []
- for scenario_name_suffix, repository_format, bzrdir_format in formats:
+ for scenario_name_suffix, repository_format in formats:
scenario_name = repository_format.__class__.__name__
scenario_name += scenario_name_suffix
scenario = (scenario_name,
{"transport_server":transport_server,
"transport_readonly_server":transport_readonly_server,
- "bzrdir_format":bzrdir_format,
+ "bzrdir_format":repository_format._matchingbzrdir,
"repository_format":repository_format,
})
# Only override the test's vfs_transport_factory if one was
@@ -84,18 +87,18 @@
# format_scenarios is all the implementations of Repository; i.e. all disk
# formats plus RemoteRepository.
format_scenarios = formats_to_scenarios(
- [('', format, format._matchingbzrdir) for format in all_formats],
+ [('', format) for format in all_formats],
default_transport,
# None here will cause a readonly decorator to be created
# by the TestCaseWithTransport.get_readonly_transport method.
None)
format_scenarios.extend(formats_to_scenarios(
- [('-default', RemoteRepositoryFormat(), RemoteBzrDirFormat())],
+ [('-default', RemoteRepositoryFormat())],
SmartTCPServer_for_testing,
ReadonlySmartTCPServer_for_testing,
MemoryServer))
format_scenarios.extend(formats_to_scenarios(
- [('-v2', RemoteRepositoryFormat(), RemoteBzrDirFormat())],
+ [('-v2', RemoteRepositoryFormat())],
SmartTCPServer_for_testing_v2_only,
ReadonlySmartTCPServer_for_testing_v2_only,
MemoryServer))
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2008-07-08 14:55:19 +0000
+++ b/bzrlib/tests/test_selftest.py 2008-07-17 03:06:11 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007 Canonical Ltd
+# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,12 +30,17 @@
errors,
memorytree,
osutils,
+ remote,
repository,
symbol_versioning,
tests,
+ workingtree,
)
from bzrlib.progress import _BaseProgressBar
-from bzrlib.repofmt import weaverepo
+from bzrlib.repofmt import (
+ pack_repo,
+ weaverepo,
+ )
from bzrlib.symbol_versioning import (
one_zero,
zero_eleven,
@@ -244,60 +249,39 @@
class TestRepositoryParameterisation(TestCase):
"""A group of tests that test the repository implementation test adapter."""
- def test_setting_vfs_transport(self):
- """The vfs_transport_factory can be set optionally."""
- from bzrlib.tests.repository_implementations import formats_to_scenarios
- scenarios = formats_to_scenarios(
- [("(one)", "a", "b"), ("(two)", "c", "d")],
- None,
- None,
- vfs_transport_factory="vfs")
- self.assertEqual([
- ('str(one)',
- {'bzrdir_format': 'b',
- 'repository_format': 'a',
- 'transport_readonly_server': None,
- 'transport_server': None,
- 'vfs_transport_factory': 'vfs'}),
- ('str(two)',
- {'bzrdir_format': 'd',
- 'repository_format': 'c',
- 'transport_readonly_server': None,
- 'transport_server': None,
- 'vfs_transport_factory': 'vfs'})],
- scenarios)
-
def test_formats_to_scenarios(self):
"""The adapter can generate all the scenarios needed."""
from bzrlib.tests.repository_implementations import formats_to_scenarios
- formats = [("(c)", "c", "C"), ("(d)", 1, "D")]
+ formats = [("(c)", remote.RemoteRepositoryFormat()),
+ ("(d)", repository.format_registry.get(
+ 'Bazaar pack repository format 1 (needs bzr 0.92)\n'))]
no_vfs_scenarios = formats_to_scenarios(formats, "server", "readonly",
None)
vfs_scenarios = formats_to_scenarios(formats, "server", "readonly",
vfs_transport_factory="vfs")
- # no_vfs generate scenarios without vfs_transport_factor
+ # no_vfs generate scenarios without vfs_transport_factory
self.assertEqual([
- ('str(c)',
- {'bzrdir_format': 'C',
- 'repository_format': 'c',
+ ('RemoteRepositoryFormat(c)',
+ {'bzrdir_format': remote.RemoteBzrDirFormat(),
+ 'repository_format': remote.RemoteRepositoryFormat(),
'transport_readonly_server': 'readonly',
'transport_server': 'server'}),
- ('int(d)',
- {'bzrdir_format': 'D',
- 'repository_format': 1,
+ ('RepositoryFormatKnitPack1(d)',
+ {'bzrdir_format': bzrdir.BzrDirMetaFormat1(),
+ 'repository_format': pack_repo.RepositoryFormatKnitPack1(),
'transport_readonly_server': 'readonly',
'transport_server': 'server'})],
no_vfs_scenarios)
self.assertEqual([
- ('str(c)',
- {'bzrdir_format': 'C',
- 'repository_format': 'c',
+ ('RemoteRepositoryFormat(c)',
+ {'bzrdir_format': remote.RemoteBzrDirFormat(),
+ 'repository_format': remote.RemoteRepositoryFormat(),
'transport_readonly_server': 'readonly',
'transport_server': 'server',
'vfs_transport_factory': 'vfs'}),
- ('int(d)',
- {'bzrdir_format': 'D',
- 'repository_format': 1,
+ ('RepositoryFormatKnitPack1(d)',
+ {'bzrdir_format': bzrdir.BzrDirMetaFormat1(),
+ 'repository_format': pack_repo.RepositoryFormatKnitPack1(),
'transport_readonly_server': 'readonly',
'transport_server': 'server',
'vfs_transport_factory': 'vfs'})],
@@ -393,19 +377,20 @@
import WorkingTreeTestProviderAdapter
server1 = "a"
server2 = "b"
- formats = [("c", "C"), ("d", "D")]
+ formats = [workingtree.WorkingTreeFormat2(),
+ workingtree.WorkingTreeFormat3(),]
adapter = WorkingTreeTestProviderAdapter(server1, server2, formats)
self.assertEqual([
- ('str',
- {'bzrdir_format': 'C',
- 'transport_readonly_server': 'b',
- 'transport_server': 'a',
- 'workingtree_format': 'c'}),
- ('str',
- {'bzrdir_format': 'D',
- 'transport_readonly_server': 'b',
- 'transport_server': 'a',
- 'workingtree_format': 'd'})],
+ ('WorkingTreeFormat2',
+ {'bzrdir_format': formats[0]._matchingbzrdir,
+ 'transport_readonly_server': 'b',
+ 'transport_server': 'a',
+ 'workingtree_format': formats[0]}),
+ ('WorkingTreeFormat3',
+ {'bzrdir_format': formats[1]._matchingbzrdir,
+ 'transport_readonly_server': 'b',
+ 'transport_server': 'a',
+ 'workingtree_format': formats[1]})],
adapter.scenarios)
@@ -425,12 +410,12 @@
return_parameter,
revision_tree_from_workingtree
)
- from bzrlib.workingtree import WorkingTreeFormat, WorkingTreeFormat3
input_test = TestTreeProviderAdapter(
"test_adapted_tests")
server1 = "a"
server2 = "b"
- formats = [("c", "C"), ("d", "D")]
+ formats = [workingtree.WorkingTreeFormat2(),
+ workingtree.WorkingTreeFormat3(),]
adapter = TreeTestProviderAdapter(server1, server2, formats)
suite = adapter.adapt(input_test)
tests = list(iter(suite))
@@ -439,14 +424,14 @@
self.assertEqual(5, len(tests))
# this must match the default format setp up in
# TreeTestProviderAdapter.adapt
- default_format = WorkingTreeFormat3
- self.assertEqual(tests[0].workingtree_format, formats[0][0])
- self.assertEqual(tests[0].bzrdir_format, formats[0][1])
+ default_format = workingtree.WorkingTreeFormat3
+ self.assertEqual(tests[0].workingtree_format, formats[0])
+ self.assertEqual(tests[0].bzrdir_format, formats[0]._matchingbzrdir)
self.assertEqual(tests[0].transport_server, server1)
self.assertEqual(tests[0].transport_readonly_server, server2)
self.assertEqual(tests[0]._workingtree_to_test_tree, return_parameter)
- self.assertEqual(tests[1].workingtree_format, formats[1][0])
- self.assertEqual(tests[1].bzrdir_format, formats[1][1])
+ self.assertEqual(tests[1].workingtree_format, formats[1])
+ self.assertEqual(tests[1].bzrdir_format, formats[1]._matchingbzrdir)
self.assertEqual(tests[1].transport_server, server1)
self.assertEqual(tests[1].transport_readonly_server, server2)
self.assertEqual(tests[1]._workingtree_to_test_tree, return_parameter)
=== modified file 'bzrlib/tests/tree_implementations/__init__.py'
--- a/bzrlib/tests/tree_implementations/__init__.py 2008-07-02 19:51:05 +0000
+++ b/bzrlib/tests/tree_implementations/__init__.py 2008-07-17 02:49:32 +0000
@@ -304,6 +304,10 @@
"""
def __init__(self, transport_server, transport_readonly_server, formats):
+ """Create a TreeTestProviderAdapter.
+
+ :param formats: [workingtree_format]
+ """
super(TreeTestProviderAdapter, self).__init__(transport_server,
transport_readonly_server, formats)
# now adjust the scenarios and add the non-working-tree tree scenarios.
@@ -336,7 +340,7 @@
if workingtree_format is None:
workingtree_format = WorkingTreeFormat._default_format
scenario_options = WorkingTreeTestProviderAdapter.create_scenario(self,
- workingtree_format, workingtree_format._matchingbzrdir)[1]
+ workingtree_format)[1]
scenario_options["_workingtree_to_test_tree"] = converter
return name, scenario_options
@@ -366,8 +370,7 @@
# None here will cause a readonly decorator to be created
# by the TestCaseWithTransport.get_readonly_transport method.
None,
- [(format, format._matchingbzrdir) for format in
- WorkingTreeFormat._formats.values() + _legacy_formats])
+ WorkingTreeFormat._formats.values() + _legacy_formats)
# add the tests for the sub modules
adapt_modules(test_tree_implementations, adapter, loader, result)
=== modified file 'bzrlib/tests/workingtree_implementations/__init__.py'
--- a/bzrlib/tests/workingtree_implementations/__init__.py 2008-04-28 08:57:45 +0000
+++ b/bzrlib/tests/workingtree_implementations/__init__.py 2008-07-17 00:42:40 +0000
@@ -52,16 +52,15 @@
def formats_to_scenarios(self, formats):
"""Transform the input formats to a list of scenarios.
- :param formats: A list of (workingtree_format, bzrdir_format).
+ :param formats: A list [workingtree_format].
"""
result = []
- for workingtree_format, bzrdir_format in formats:
- result.append(self.create_scenario(workingtree_format,
- bzrdir_format))
+ for workingtree_format in formats:
+ result.append(self.create_scenario(workingtree_format))
return result
- def create_scenario(self, workingtree_format, bzrdir_format):
+ def create_scenario(self, workingtree_format):
"""Create a scenario for the specified converter
:param workingtree_format: The particular workingtree format to test.
@@ -72,7 +71,7 @@
scenario_options = {
"transport_server": self._transport_server,
"transport_readonly_server": self._transport_readonly_server,
- "bzrdir_format": bzrdir_format,
+ "bzrdir_format": workingtree_format._matchingbzrdir,
"workingtree_format": workingtree_format,
}
return workingtree_format.__class__.__name__, scenario_options
@@ -134,8 +133,7 @@
# None here will cause a readonly decorator to be created
# by the TestCaseWithTransport.get_readonly_transport method.
None,
- [(format, format._matchingbzrdir) for format in
- WorkingTreeFormat._formats.values() + _legacy_formats])
+ WorkingTreeFormat._formats.values() + _legacy_formats)
# add the tests for the sub modules
adapt_modules(test_workingtree_implementations, adapter, loader, result)
More information about the bazaar-commits
mailing list