/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

  • Committer: Alexander Belchenko
  • Date: 2011-03-28 08:27:18 UTC
  • mfrom: (5742 +trunk)
  • mto: (5759.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5760.
  • Revision ID: bialix@ukr.net-20110328082718-wb3emf38d4iffmcp
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
 
65
65
class TestConflicts(tests.TestCaseWithTransport):
66
66
 
67
 
    def test_conflicts(self):
68
 
        """Conflicts are detected properly"""
69
 
        # Use BzrDirFormat6 so we can fake conflicts
70
 
        tree = self.make_branch_and_tree('.', format=bzrdir.BzrDirFormat6())
71
 
        self.build_tree_contents([('hello', 'hello world4'),
72
 
                                  ('hello.THIS', 'hello world2'),
73
 
                                  ('hello.BASE', 'hello world1'),
74
 
                                  ('hello.OTHER', 'hello world3'),
75
 
                                  ('hello.sploo.BASE', 'yellowworld'),
76
 
                                  ('hello.sploo.OTHER', 'yellowworld2'),
77
 
                                  ])
78
 
        tree.lock_read()
79
 
        self.assertLength(6, list(tree.list_files()))
80
 
        tree.unlock()
81
 
        tree_conflicts = tree.conflicts()
82
 
        self.assertLength(2, tree_conflicts)
83
 
        self.assertTrue('hello' in tree_conflicts[0].path)
84
 
        self.assertTrue('hello.sploo' in tree_conflicts[1].path)
85
 
        conflicts.restore('hello')
86
 
        conflicts.restore('hello.sploo')
87
 
        self.assertLength(0, tree.conflicts())
88
 
        self.assertFileEqual('hello world2', 'hello')
89
 
        self.assertFalse(os.path.lexists('hello.sploo'))
90
 
        self.assertRaises(errors.NotConflicted, conflicts.restore, 'hello')
91
 
        self.assertRaises(errors.NotConflicted,
92
 
                          conflicts.restore, 'hello.sploo')
93
 
 
94
67
    def test_resolve_conflict_dir(self):
95
68
        tree = self.make_branch_and_tree('.')
96
69
        self.build_tree_contents([('hello', 'hello world4'),