~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

  • Committer: Aaron Bentley
  • Date: 2007-11-23 20:19:57 UTC
  • mto: This revision was merged to the branch mainline in revision 3021.
  • Revision ID: abentley@panoramicfeedback.com-20071123201957-xntyi59nfugfz2u1
Revert now resolves conflicts recursively (#102739)

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 (MissingParent, ContentsConflict, TextConflict,
24
 
        PathConflict, DuplicateID, DuplicateEntry, ParentLoop, UnversionedParent,
25
 
        ConflictList, 
26
 
        restore)
 
23
from bzrlib.conflicts import (
 
24
    ConflictList,
 
25
    ContentsConflict,
 
26
    DuplicateID,
 
27
    DuplicateEntry,
 
28
    MissingParent,
 
29
    ParentLoop,
 
30
    PathConflict,
 
31
    TextConflict,
 
32
    UnversionedParent,
 
33
    resolve,
 
34
    restore,
 
35
    )
27
36
from bzrlib.errors import NotConflicted
28
37
 
29
38
 
115
124
                         tree_conflicts.select_conflicts(tree, ['foo'],
116
125
                                                         ignore_misses=True))
117
126
 
 
127
    def test_resolve_conflicts_recursive(self):
 
128
        tree = self.make_branch_and_tree('.')
 
129
        self.build_tree(['dir/', 'dir/hello'])
 
130
        tree.add(['dir', 'dir/hello'])
 
131
        tree.set_conflicts(ConflictList([TextConflict('dir/hello')]))
 
132
        resolve(tree, ['dir'], recursive=False, ignore_misses=True)
 
133
        self.assertEqual(ConflictList([TextConflict('dir/hello')]),
 
134
                         tree.conflicts())
 
135
        resolve(tree, ['dir'], recursive=True, ignore_misses=True)
 
136
        self.assertEqual(ConflictList([]),
 
137
                         tree.conflicts())
 
138
 
118
139
 
119
140
class TestConflictStanzas(TestCase):
120
141