~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_versioning.py

  • Committer: Robert Collins
  • Date: 2007-11-22 02:33:49 UTC
  • mto: This revision was merged to the branch mainline in revision 3014.
  • Revision ID: robertc@robertcollins.net-20071122023349-i0nc5or8vpvdu84q
Lock correctness in test_versioning

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
 
149
149
        old = b.repository.revision_tree(b.get_rev_id(1))
150
150
        new = b.repository.revision_tree(b.get_rev_id(2))
 
151
        new.lock_read()
151
152
 
152
153
        eq(new.get_file_by_path('b/two').read(), 'old contents')
153
154
        eq(new.get_file_by_path('top').read(), 'old contents')
154
155
        eq(new.get_file_by_path('a/one').read(), 'new contents')
 
156
        new.unlock()
155
157
 
156
158
        os.chdir('a')
157
159
        # commit from here should do nothing
158
160
        run_bzr(['commit', '.', '-m', 'commit subdir only', '--unchanged'])
159
161
        v3 = b.repository.revision_tree(b.get_rev_id(3))
 
162
        v3.lock_read()
160
163
        eq(v3.get_file_by_path('b/two').read(), 'old contents')
161
164
        eq(v3.get_file_by_path('top').read(), 'old contents')
162
165
        eq(v3.get_file_by_path('a/one').read(), 'new contents')
 
166
        v3.unlock()
163
167
 
164
168
        # commit in subdirectory commits whole tree
165
169
        run_bzr(['commit', '-m', 'commit whole tree from subdir'])
166
170
        v4 = b.repository.revision_tree(b.get_rev_id(4))
 
171
        v4.lock_read()
167
172
        eq(v4.get_file_by_path('b/two').read(), 'new contents')
168
173
        eq(v4.get_file_by_path('top').read(), 'new contents')
 
174
        v4.unlock()
169
175
 
170
176
        # TODO: factor out some kind of assert_tree_state() method
171
177