~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

Start addressing Andrew's concerns.

* bzrlib/tests/test_conflicts.py:
(TestParametrizedResolveConflicts): Add a docstring.
(TestResolvePathConflictBefore531967.assertPathConflict): Really
inject the old fashioned conflict object.

* bzrlib/merge.py:
(Merge3Merger._merge_names): Better explain why we shouldn't
generate helpers at this point.
(Merge3Merger.cook_conflicts): Be more verbose when failing.

* bzrlib/conflicts.py:
(PathConflict._resolve): Be more verbose when failing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
# FIXME: Get rid of parametrized (in the class name) once we delete
219
219
# TestResolveConflicts -- vila 20100308
220
220
class TestParametrizedResolveConflicts(tests.TestCaseWithTransport):
 
221
    """This class provides a base to test single conflict resolution.
 
222
 
 
223
    The aim is to define scenarios in daughter classes (one for each conflict
 
224
    type) that create a single conflict object when one branch is merged in
 
225
    another (and vice versa). Each class can define as many scenarios as
 
226
    needed. Each scenario should define a couple of actions that will be
 
227
    swapped to define the sibling scenarios.
 
228
 
 
229
    From there, both resolutions are tested (--take-this and --take-other).
 
230
 
 
231
    Each conflict type use its attributes in a specific way, so each class 
 
232
    should define a specific _assert_conflict method.
 
233
 
 
234
    Since the resolution change the working tree state, each action should
 
235
    define an associated check.
 
236
    """
221
237
 
222
238
    # Set by daughter classes
223
239
    _conflict_type = None
459
475
        # compatibility code.
460
476
        old_c = conflicts.PathConflict('<deleted>', self._item_path,
461
477
                                       file_id=None)
462
 
        wt.set_conflicts(conflicts.ConflictList([c]))
 
478
        wt.set_conflicts(conflicts.ConflictList([old_c]))
463
479
 
464
480
 
465
481
class TestResolveDuplicateEntry(TestResolveConflicts):