Rev 3026: Lock correctness in test_versioning in http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks
Robert Collins
robertc at robertcollins.net
Thu Nov 22 02:34:08 GMT 2007
At http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks
------------------------------------------------------------
revno: 3026
revision-id:robertc at robertcollins.net-20071122023349-i0nc5or8vpvdu84q
parent: robertc at robertcollins.net-20071122022357-17rpgugyooepb30y
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pack.read-locks
timestamp: Thu 2007-11-22 13:33:49 +1100
message:
Lock correctness in test_versioning
modified:
bzrlib/tests/blackbox/test_versioning.py versioning.py-20050622071821-3ddf5e2e5e93c602
=== modified file 'bzrlib/tests/blackbox/test_versioning.py'
--- a/bzrlib/tests/blackbox/test_versioning.py 2007-06-28 12:26:11 +0000
+++ b/bzrlib/tests/blackbox/test_versioning.py 2007-11-22 02:33:49 +0000
@@ -148,24 +148,30 @@
old = b.repository.revision_tree(b.get_rev_id(1))
new = b.repository.revision_tree(b.get_rev_id(2))
+ new.lock_read()
eq(new.get_file_by_path('b/two').read(), 'old contents')
eq(new.get_file_by_path('top').read(), 'old contents')
eq(new.get_file_by_path('a/one').read(), 'new contents')
+ new.unlock()
os.chdir('a')
# commit from here should do nothing
run_bzr(['commit', '.', '-m', 'commit subdir only', '--unchanged'])
v3 = b.repository.revision_tree(b.get_rev_id(3))
+ v3.lock_read()
eq(v3.get_file_by_path('b/two').read(), 'old contents')
eq(v3.get_file_by_path('top').read(), 'old contents')
eq(v3.get_file_by_path('a/one').read(), 'new contents')
+ v3.unlock()
# commit in subdirectory commits whole tree
run_bzr(['commit', '-m', 'commit whole tree from subdir'])
v4 = b.repository.revision_tree(b.get_rev_id(4))
+ v4.lock_read()
eq(v4.get_file_by_path('b/two').read(), 'new contents')
eq(v4.get_file_by_path('top').read(), 'new contents')
+ v4.unlock()
# TODO: factor out some kind of assert_tree_state() method
More information about the bazaar-commits
mailing list