~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

MergeĀ fromĀ jam-integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from bzrlib.tests import BzrTestBase, TestCaseInTempDir
26
26
from bzrlib.branch import Branch
27
27
from bzrlib.trace import mutter
 
28
from bzrlib.osutils import pathjoin
28
29
 
29
30
 
30
31
class TestVersioning(TestCaseInTempDir):
73
74
 
74
75
        self.assertEquals(len(delta.added), 2)
75
76
        self.assertEquals(delta.added[0][0], 'dir')
76
 
        self.assertEquals(delta.added[1][0], os.path.join('dir','subdir'))
 
77
        self.assertEquals(delta.added[1][0], pathjoin('dir','subdir'))
77
78
        self.failIf(delta.modified)
78
79
 
79
80
    def test_mkdir_w_nested_trees(self):
170
171
        mutter('start selective subdir commit')
171
172
        run_bzr('commit', 'a', '-m', 'commit a only')
172
173
        
173
 
        old = b.revision_tree(b.get_rev_id(1))
174
 
        new = b.revision_tree(b.get_rev_id(2))
 
174
        old = b.repository.revision_tree(b.get_rev_id(1))
 
175
        new = b.repository.revision_tree(b.get_rev_id(2))
175
176
        
176
177
        eq(new.get_file_by_path('b/two').read(), 'old contents')
177
178
        eq(new.get_file_by_path('top').read(), 'old contents')
180
181
        os.chdir('a')
181
182
        # commit from here should do nothing
182
183
        run_bzr('commit', '.', '-m', 'commit subdir only', '--unchanged')
183
 
        v3 = b.revision_tree(b.get_rev_id(3))
 
184
        v3 = b.repository.revision_tree(b.get_rev_id(3))
184
185
        eq(v3.get_file_by_path('b/two').read(), 'old contents')
185
186
        eq(v3.get_file_by_path('top').read(), 'old contents')
186
187
        eq(v3.get_file_by_path('a/one').read(), 'new contents')
187
188
                
188
189
        # commit in subdirectory commits whole tree
189
190
        run_bzr('commit', '-m', 'commit whole tree from subdir')
190
 
        v4 = b.revision_tree(b.get_rev_id(4))
 
191
        v4 = b.repository.revision_tree(b.get_rev_id(4))
191
192
        eq(v4.get_file_by_path('b/two').read(), 'new contents')        
192
193
        eq(v4.get_file_by_path('top').read(), 'new contents')
193
194