~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: 2007-11-04 18:51:39 UTC
  • mfrom: (2961.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20071104185139-kaio3sneodg2kp71
Authentication ring implementation (read-only)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib import bzrdir
21
21
from bzrlib.tests import TestCaseWithTransport, TestCase
22
22
from bzrlib.branch import Branch
23
 
from bzrlib.conflicts import (
24
 
    ConflictList,
25
 
    ContentsConflict,
26
 
    DuplicateID,
27
 
    DuplicateEntry,
28
 
    MissingParent,
29
 
    NonDirectoryParent,
30
 
    ParentLoop,
31
 
    PathConflict,
32
 
    TextConflict,
33
 
    UnversionedParent,
34
 
    resolve,
35
 
    restore,
36
 
    )
 
23
from bzrlib.conflicts import (MissingParent, ContentsConflict, TextConflict,
 
24
        PathConflict, DuplicateID, DuplicateEntry, ParentLoop, UnversionedParent,
 
25
        ConflictList, 
 
26
        restore)
37
27
from bzrlib.errors import NotConflicted
38
28
 
39
29
 
57
47
    ParentLoop('Cancelled move', u'p\xe5the', u'p\xe5th2e',
58
48
               None, '\xc3\xaed2e'),
59
49
    UnversionedParent('Versioned directory', u'p\xe5thf', '\xc3\xaedf'),
60
 
    NonDirectoryParent('Created directory', u'p\xe5thg', '\xc3\xaedg'),
61
50
])
62
51
 
63
52
 
85
74
        restore('hello.sploo')
86
75
        self.assertEqual(len(tree.conflicts()), 0)
87
76
        self.assertFileEqual('hello world2', 'hello')
88
 
        self.assertFalse(os.path.lexists('hello.sploo'))
 
77
        assert not os.path.lexists('hello.sploo')
89
78
        self.assertRaises(NotConflicted, restore, 'hello')
90
79
        self.assertRaises(NotConflicted, restore, 'hello.sploo')
91
80
 
126
115
                         tree_conflicts.select_conflicts(tree, ['foo'],
127
116
                                                         ignore_misses=True))
128
117
 
129
 
    def test_resolve_conflicts_recursive(self):
130
 
        tree = self.make_branch_and_tree('.')
131
 
        self.build_tree(['dir/', 'dir/hello'])
132
 
        tree.add(['dir', 'dir/hello'])
133
 
        tree.set_conflicts(ConflictList([TextConflict('dir/hello')]))
134
 
        resolve(tree, ['dir'], recursive=False, ignore_misses=True)
135
 
        self.assertEqual(ConflictList([TextConflict('dir/hello')]),
136
 
                         tree.conflicts())
137
 
        resolve(tree, ['dir'], recursive=True, ignore_misses=True)
138
 
        self.assertEqual(ConflictList([]),
139
 
                         tree.conflicts())
140
 
 
141
118
 
142
119
class TestConflictStanzas(TestCase):
143
120