/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

  • Committer: Martin Pool
  • Date: 2005-07-25 21:54:01 UTC
  • Revision ID: mbp@sourcefrog.net-20050725215401-0bed2682b7fee8b5
- fix bugs and add tests for doing commit of selected directories

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
        self.assertRaises(OSError, run_bzr, ['mkdir', 'foo'])
39
39
 
40
 
        from bzrlib.diff import compare_trees
 
40
        from bzrlib.diff import compare_trees, TreeDelta
41
41
        from bzrlib.branch import Branch
42
42
        b = Branch('.')
43
43
        
44
44
        delta = compare_trees(b.basis_tree(), b.working_tree())
45
45
 
46
 
        self.log('delta.added = %r' % delta.added)
47
 
 
48
46
        self.assertEquals(len(delta.added), 1)
49
47
        self.assertEquals(delta.added[0][0], 'foo')
50
48
        self.failIf(delta.modified)
102
100
        
103
101
        os.chdir('a')
104
102
        # commit from here should do nothing
105
 
        run_bzr('commit', '.', '-m', 'commit subdir only', '--unchanged')
 
103
        run_bzr('commit', '.', '-m', 'commit subdir again', '--unchanged')
106
104
        v3 = b.revision_tree(b.lookup_revision(3))
107
105
        eq(v3.get_file_by_path('b/two').read(), 'old contents')
108
106
        eq(v3.get_file_by_path('top').read(), 'old contents')
109
107
        eq(v3.get_file_by_path('a/one').read(), 'new contents')
110
108
                
111
109
        # commit in subdirectory commits whole tree
112
 
        run_bzr('commit', '-m', 'commit whole tree from subdir')
 
110
        run_bzr('commit', '-m', 'commit in subdir')
113
111
        v4 = b.revision_tree(b.lookup_revision(4))
114
112
        eq(v4.get_file_by_path('b/two').read(), 'new contents')        
115
113
        eq(v4.get_file_by_path('top').read(), 'new contents')
149
147
        chdir('..')
150
148
        eq(run_bzr(['add']), 0)
151
149
        eq(list(b.unknowns()), [])
152
 
        
 
150
        
 
 
b'\\ No newline at end of file'