~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: 2006-04-19 08:31:08 UTC
  • mfrom: (1666.1.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060419083108-fab2970f4575b010
Change the default branch format to be metadir. (Robert Collins, Aaron Bentley).

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
# TODO: Test commit with some added, and added-but-missing files
27
27
# RBC 20060124 is that not tested in test_commit.py ?
28
28
 
 
29
# The order of 'path' here is important - do not let it
 
30
# be a sorted list.
29
31
example_conflicts = ConflictList([ 
 
32
    MissingParent('Not deleting', 'pathg', 'idg'),
30
33
    ContentsConflict('patha', 'ida'), 
31
34
    TextConflict('patha'),
32
35
    PathConflict('pathb', 'pathc', 'idb'),
35
38
                   None),
36
39
    ParentLoop('Cancelled move', 'pathe', 'path2e', None, 'id2e'),
37
40
    UnversionedParent('Versioned directory', 'pathf', 'idf'),
38
 
    MissingParent('Not deleting', 'pathg', 'idg'),
39
41
])
40
42
 
41
43
 
43
45
 
44
46
    def test_conflicts(self):
45
47
        """Conflicts are detected properly"""
46
 
        tree = self.make_branch_and_tree('.')
 
48
        tree = self.make_branch_and_tree('.',
 
49
            format=bzrlib.bzrdir.BzrDirFormat6())
47
50
        b = tree.branch
48
51
        file('hello', 'w').write('hello world4')
49
52
        file('hello.THIS', 'w').write('hello world2')
77
80
 
78
81
 
79
82
class TestConflictStanzas(TestCase):
 
83
 
80
84
    def test_stanza_roundtrip(self):
 
85
        # write and read our example stanza.
81
86
        stanza_iter = example_conflicts.to_stanzas()
82
87
        processed = ConflictList.from_stanzas(stanza_iter)
83
88
        for o,p in zip(processed, example_conflicts):