[MERGE] Test suite overhaul from the hpss branch
John Arbash Meinel
john at arbash-meinel.com
Wed Mar 28 22:37:04 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
...
>> I'm not really sure about using tree.bzrdir.root_transport() to access
>> the "remote" working tree. Since we at least defined working trees as
>> being local only... Is this because you want to support MemoryTree?
>> At least some explanation would be good.
>
> Where is this? tree.bzrdir.root_transport() is always local [to the
> tree], not remote - tree.branch.bzrdir.root_transport() could be remote.
>
> -Rob
=== modified file bzrlib/tests/branch_implementations/test_branch.py
- --- bzrlib/tests/branch_implementations/test_branch.py
+++ bzrlib/tests/branch_implementations/test_branch.py
@@ -118,12 +118,10 @@
def test_fetch_revisions(self):
"""Test fetch-revision operation."""
- - get_transport(self.get_url()).mkdir('b1')
- - get_transport(self.get_url()).mkdir('b2')
wt = self.make_branch_and_tree('b1')
b1 = wt.branch
b2 = self.make_branch('b2')
- - file('b1/foo', 'w').write('hello')
+ wt.bzrdir.root_transport.put_bytes('foo', 'hello')
wt.add(['foo'], ['foo-id'])
wt.commit('lala!', rev_id='revision-1', allow_pointless=False)
@@ -136,10 +134,11 @@
def test_get_revision_delta(self):
tree_a = self.make_branch_and_tree('a')
- - self.build_tree(['a/foo'])
+ transport = tree_a.bzrdir.root_transport
+ self.build_tree(['foo'], transport=transport)
tree_a.add('foo', 'file1')
tree_a.commit('rev1', rev_id='rev1')
- - self.build_tree(['a/vla'])
+ self.build_tree(['vla'], transport=transport)
tree_a.add('vla', 'file2')
tree_a.commit('rev2', rev_id='rev2')
Are 2 locations. (self.build_contents() might be an alternative).
It may just be that you wanted a safe way of writing bytes, rather than
using 'file().write()'.
And I certainly support getting rid of file().write(). But using
tree.bzrdir.root_transport.put_* doesn't seems like a proper alternative.
Also:
- - self.build_tree(['a/one'])
+ self.build_tree(['one'], transport=wt_a.bzrdir.root_transport)
wt_a.add(['one'])
wt_a.commit('commit one', rev_id='1')
- - self.build_tree(['a/two'])
+ self.build_tree(['two'], transport=wt_a.bzrdir.root_transport)
I'm not sure what you are trying to do. Is it that you don't like having
'a/' there. Or is it that 'root_transport' is sometimes not a local
directory.
If so, does this mean we are trying to support having a WT that aren't
local disk? (The only one I can think of is MemoryTree).
But I know DirState won't work as a MemoryTree, since it is *very*
focused on everything being local disk.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGCt//JdeBCYSNAAMRAqBLAJ0aYhxyjSbJt3Zobw4jVa4C5O7NpwCgy9I0
EKnJN996wUgwsK+FD7Xj33s=
=vGzQ
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list