~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Improve message when OTHER deletes an in-use tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib import tests
20
20
from bzrlib.bzrdir import BzrDir
21
21
from bzrlib.conflicts import (DuplicateEntry, DuplicateID, MissingParent,
22
 
                              UnversionedParent, ParentLoop)
 
22
                              UnversionedParent, ParentLoop, DeletingParent,)
23
23
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
24
24
                           ReusingTransform, CantMoveRoot, 
25
25
                           PathsNotVersionedError, ExistingLimbo,
388
388
                                         'dorothy-id')
389
389
        old_dorothy = conflicts.trans_id_tree_file_id('dorothy-id')
390
390
        oz = conflicts.trans_id_tree_file_id('oz-id')
391
 
        # set up missing, unversioned parent
 
391
        # set up DeletedParent parent conflict
392
392
        conflicts.delete_versioned(oz)
393
393
        emerald = conflicts.trans_id_tree_file_id('emerald-id')
 
394
        # set up MissingParent conflict
 
395
        munchkincity = conflicts.trans_id_file_id('munchkincity-id')
 
396
        conflicts.adjust_path('munchkincity', root, munchkincity)
 
397
        conflicts.new_directory('auntem', munchkincity, 'auntem-id')
394
398
        # set up parent loop
395
399
        conflicts.adjust_path('emeraldcity', emerald, emerald)
396
400
        return conflicts, emerald, oz, old_dorothy, new_dorothy
417
421
                                   'dorothy.moved', 'dorothy', None,
418
422
                                   'dorothy-id')
419
423
        self.assertEqual(cooked_conflicts[1], duplicate_id)
420
 
        missing_parent = MissingParent('Not deleting', 'oz', 'oz-id')
 
424
        missing_parent = MissingParent('Created directory', 'munchkincity',
 
425
                                       'munchkincity-id')
 
426
        deleted_parent = DeletingParent('Not deleting', 'oz', 'oz-id')
421
427
        self.assertEqual(cooked_conflicts[2], missing_parent)
422
 
        unversioned_parent = UnversionedParent('Versioned directory', 'oz',
 
428
        unversioned_parent = UnversionedParent('Versioned directory',
 
429
                                               'munchkincity',
 
430
                                               'munchkincity-id')
 
431
        unversioned_parent2 = UnversionedParent('Versioned directory', 'oz',
423
432
                                               'oz-id')
424
433
        self.assertEqual(cooked_conflicts[3], unversioned_parent)
425
434
        parent_loop = ParentLoop('Cancelled move', 'oz/emeraldcity', 
426
435
                                 'oz/emeraldcity', 'emerald-id', 'emerald-id')
427
 
        self.assertEqual(cooked_conflicts[4], parent_loop)
428
 
        self.assertEqual(len(cooked_conflicts), 5)
 
436
        self.assertEqual(cooked_conflicts[4], deleted_parent)
 
437
        self.assertEqual(cooked_conflicts[5], unversioned_parent2)
 
438
        self.assertEqual(cooked_conflicts[6], parent_loop)
 
439
        self.assertEqual(len(cooked_conflicts), 7)
429
440
        tt.finalize()
430
441
 
431
442
    def test_string_conflicts(self):
441
452
        self.assertEqual(conflicts_s[1], 'Conflict adding id to dorothy.  '
442
453
                                         'Unversioned existing file '
443
454
                                         'dorothy.moved.')
444
 
        self.assertEqual(conflicts_s[2], 'Conflict adding files to oz.  '
 
455
        self.assertEqual(conflicts_s[2], 'Conflict adding files to'
 
456
                                         ' munchkincity.  Created directory.')
 
457
        self.assertEqual(conflicts_s[3], 'Conflict because munchkincity is not'
 
458
                                         ' versioned, but has versioned'
 
459
                                         ' children.  Versioned directory.')
 
460
        self.assertEqual(conflicts_s[4], 'Conflict deleting parent directory'
 
461
                                         ' oz because it has children.  '
445
462
                                         'Not deleting.')
446
 
        self.assertEqual(conflicts_s[3], 'Conflict adding versioned files to '
447
 
                                         'oz.  Versioned directory.')
448
 
        self.assertEqual(conflicts_s[4], 'Conflict moving oz/emeraldcity into'
 
463
        self.assertEqual(conflicts_s[5], 'Conflict because oz is not'
 
464
                                         ' versioned, but has versioned'
 
465
                                         ' children.  Versioned directory.')
 
466
        self.assertEqual(conflicts_s[6], 'Conflict moving oz/emeraldcity into'
449
467
                                         ' oz/emeraldcity.  Cancelled move.')
450
468
 
451
469
    def test_moving_versioned_directories(self):