~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_parents.py

(robertc) Deprecate WorkingTree.pending_merges.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib import errors
 
21
from bzrlib import errors, symbol_versioning
22
22
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
23
23
from bzrlib.uncommit import uncommit
24
24
 
26
26
class TestParents(TestCaseWithWorkingTree):
27
27
 
28
28
    def assertConsistentParents(self, expected, tree):
 
29
        """Check that the parents found are as expected.
 
30
 
 
31
        This test helper also checks that they are consistent with
 
32
        the pre-get_parent_ids() api - which is now deprecated.
 
33
        """
29
34
        self.assertEqual(expected, tree.get_parent_ids())
30
35
        if expected == []:
31
36
            self.assertEqual(None, tree.last_revision())
32
37
        else:
33
38
            self.assertEqual(expected[0], tree.last_revision())
34
 
        self.assertEqual(expected[1:], tree.pending_merges())
 
39
        self.assertEqual(expected[1:],
 
40
            self.applyDeprecated(symbol_versioning.zero_eleven,
 
41
                tree.pending_merges))
35
42
 
36
43
 
37
44
class TestSetParents(TestParents):