~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-15 20:19:43 UTC
  • mfrom: (5614.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110115201943-es5zdz223vtgweyf
(vila) Merge 2.3 into trunk including fix for bug #660935 (Vincent
        Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
427
427
              dict(actions='modify_file', check='file_has_more_content')),
428
428
             ('file_deleted',
429
429
              dict(actions='delete_file', check='file_doesnt_exist')),),
 
430
            # File modified/deleted in dir
 
431
            (dict(_base_actions='create_file_in_dir',
 
432
                  _path='dir/file', _file_id='file-id'),
 
433
             ('file_modified_in_dir',
 
434
              dict(actions='modify_file_in_dir',
 
435
                   check='file_in_dir_has_more_content')),
 
436
             ('file_deleted_in_dir',
 
437
              dict(actions='delete_file',
 
438
                   check='file_in_dir_doesnt_exist')),),
430
439
            ])
431
440
 
432
441
    def do_create_file(self):
444
453
    def check_file_doesnt_exist(self):
445
454
        self.failIfExists('branch/file')
446
455
 
 
456
    def do_create_file_in_dir(self):
 
457
        return [('add', ('dir', 'dir-id', 'directory', '')),
 
458
                ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
 
459
 
 
460
    def do_modify_file_in_dir(self):
 
461
        return [('modify', ('file-id', 'trunk content\nmore content\n'))]
 
462
 
 
463
    def check_file_in_dir_has_more_content(self):
 
464
        self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file')
 
465
 
 
466
    def check_file_in_dir_doesnt_exist(self):
 
467
        self.failIfExists('branch/dir/file')
 
468
 
447
469
    def _get_resolve_path_arg(self, wt, action):
448
470
        return self._path
449
471
 
475
497
                   # PathConflicts deletion handling requires a special
476
498
                   # hard-coded value
477
499
                   path='<deleted>', file_id='file-id')),),
 
500
            # File renamed/deleted in dir
 
501
            (dict(_base_actions='create_file_in_dir'),
 
502
             ('file_renamed_in_dir',
 
503
              dict(actions='rename_file_in_dir', check='file_in_dir_renamed',
 
504
                   path='dir/new-file', file_id='file-id')),
 
505
             ('file_deleted',
 
506
              dict(actions='delete_file', check='file_in_dir_doesnt_exist',
 
507
                   # PathConflicts deletion handling requires a special
 
508
                   # hard-coded value
 
509
                   path='<deleted>', file_id='file-id')),),
478
510
            # File renamed/renamed differently
479
511
            (dict(_base_actions='create_file'),
480
512
             ('file_renamed',
549
581
    def check_dir_doesnt_exist(self):
550
582
        self.failIfExists('branch/dir')
551
583
 
 
584
    def do_create_file_in_dir(self):
 
585
        return [('add', ('dir', 'dir-id', 'directory', '')),
 
586
                ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
 
587
 
 
588
    def do_rename_file_in_dir(self):
 
589
        return [('rename', ('dir/file', 'dir/new-file'))]
 
590
 
 
591
    def check_file_in_dir_renamed(self):
 
592
        self.failIfExists('branch/dir/file')
 
593
        self.failUnlessExists('branch/dir/new-file')
 
594
 
 
595
    def check_file_in_dir_doesnt_exist(self):
 
596
        self.failIfExists('branch/dir/file')
 
597
 
552
598
    def _get_resolve_path_arg(self, wt, action):
553
599
        tpath = self._this['path']
554
600
        opath = self._other['path']