~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_commit.py

  • Committer: Martin Pool
  • Date: 2005-09-15 06:23:39 UTC
  • Revision ID: mbp@sourcefrog.net-20050915062339-27c63835abb60840
- more tests for selective commit of deletion

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
        b = Branch('.', init=True)
96
96
        file('hello', 'w').write('hello')
97
97
        file('buongia', 'w').write('buongia')
98
 
        b.add(['hello', 'buongia'])
99
 
        b.commit(message='add files')
 
98
        b.add(['hello', 'buongia'],
 
99
              ['hello-id', 'buongia-id'])
 
100
        b.commit(message='add files',
 
101
                 rev_id='test@rev-1')
100
102
        
101
103
        os.remove('hello')
102
104
        file('buongia', 'w').write('new text')
103
105
        b.commit(message='update text',
104
106
                 specific_files=['buongia'],
105
 
                 allow_pointless=False)
 
107
                 allow_pointless=False,
 
108
                 rev_id='test@rev-2')
106
109
 
107
110
        b.commit(message='remove hello',
108
111
                 specific_files=['hello'],
109
 
                 allow_pointless=False)
 
112
                 allow_pointless=False,
 
113
                 rev_id='test@rev-3')
110
114
 
111
115
        eq = self.assertEquals
112
116
        eq(b.revno(), 3)
 
117
 
 
118
        tree2 = b.revision_tree('test@rev-2')
 
119
        self.assertTrue(tree2.has_filename('hello'))
 
120
        self.assertEquals(tree2.get_file_text('hello-id'), 'hello')
 
121
        self.assertEquals(tree2.get_file_text('buongia-id'), 'new text')
 
122
        
 
123
        tree3 = b.revision_tree('test@rev-3')
 
124
        self.assertFalse(tree3.has_filename('hello'))
 
125
        self.assertEquals(tree3.get_file_text('buongia-id'), 'new text')
113
126
        
114
127
 
115
128