~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

Merge in format-5 work - release bzr 0.1rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
                          b.add,
73
73
                          'foo/hello')
74
74
        
75
 
        self.check_and_upgrade()
 
75
        self.check_branch()
76
76
 
77
77
 
78
78
    def test_add_in_unversioned(self):
117
117
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
118
118
        eq(list(b.unknowns()), ['inertiatic'])
119
119
        run_bzr(['add', '--no-recurse', 'inertiatic'])
120
 
        eq(list(b.unknowns()), ['inertiatic/esp'])
 
120
        eq(list(b.unknowns()), ['inertiatic'+os.sep+'esp'])
121
121
        run_bzr(['add', 'inertiatic/esp'])
122
122
        eq(list(b.unknowns()), [])
123
123
 
152
152
        eq(run_bzr(['add']), 0)
153
153
        eq(list(b.unknowns()), [])
154
154
 
155
 
        self.check_and_upgrade()
156
 
 
157
 
 
158
 
    def check_and_upgrade(self):
 
155
        self.check_branch()
 
156
 
 
157
 
 
158
    def check_branch(self):
159
159
        """After all the above changes, run the check and upgrade commands.
160
160
 
161
161
        The upgrade should be a no-op."""
166
166
        from bzrlib.check import check
167
167
        check(b)
168
168
        
169
 
        debug('upgrade branch...')
170
 
        from bzrlib.upgrade import upgrade
171
 
        upgrade(b)
172
 
        
173
 
        debug('check branch...')
174
 
        from bzrlib.check import check
175
 
        check(b)
176
 
        
177
169
 
178
170
        
179
171
class SubdirCommit(TestCaseInTempDir):
197
189
        for fn in ('a/one', 'b/two', 'top'):
198
190
            file(fn, 'w').write('new contents')
199
191
            
 
192
        debug('start selective subdir commit')
200
193
        run_bzr('commit', 'a', '-m', 'commit a only')
201
194
        
202
195
        old = b.revision_tree(b.get_rev_id(1))
222
215
        
223
216
        # TODO: factor out some kind of assert_tree_state() method
224
217
        
 
218
 
 
219
if __name__ == '__main__':
 
220
    import unittest
 
221
    unittest.main()
 
222