~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Merge orphan-non-versioned-files into deprecate-get-backup-name resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
2341
2341
 
2342
2342
class TestTransformMissingParent(tests.TestCaseWithTransport):
2343
2343
 
2344
 
    def get_tree_transform_with_unversioned_dir(self):
 
2344
    def make_tt_with_versioned_dir(self):
2345
2345
        wt = self.make_branch_and_tree('.')
2346
2346
        self.build_tree(['dir/',])
2347
2347
        wt.add(['dir'], ['dir-id'])
2351
2351
        return wt, tt
2352
2352
 
2353
2353
    def test_resolve_create_parent_for_versioned_file(self):
2354
 
        wt, tt = self.get_tree_transform_with_unversioned_dir()
 
2354
        wt, tt = self.make_tt_with_versioned_dir()
2355
2355
        dir_tid = tt.trans_id_tree_file_id('dir-id')
2356
2356
        file_tid = tt.new_file('file', dir_tid, 'Contents', file_id='file-id')
2357
2357
        tt.delete_contents(dir_tid)
2362
2362
        self.assertLength(2, conflicts)
2363
2363
 
2364
2364
    def test_resolve_orphan_non_versioned_file(self):
2365
 
        wt, tt = self.get_tree_transform_with_unversioned_dir()
 
2365
        wt, tt = self.make_tt_with_versioned_dir()
2366
2366
        dir_tid = tt.trans_id_tree_file_id('dir-id')
2367
2367
        tt.new_file('file', dir_tid, 'Contents')
2368
2368
        tt.delete_contents(dir_tid)
3285
3285
        # Yeah for resolved conflicts !
3286
3286
        self.assertLength(0, remaining_conflicts)
3287
3287
        # We have a new orphan
3288
 
        self.assertEndsWith('foo.~1~', tt.final_name(foo_tid))
 
3288
        self.assertEquals('foo.~1~', tt.final_name(foo_tid))
 
3289
        self.assertEquals('bzr-orphans',
 
3290
                          tt.final_name(tt.final_parent(foo_tid)))