~bzr/bzr/bzr.1.5

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_missing.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-07 07:27:16 UTC
  • mfrom: (3408.2.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080507072716-lr54bdt55km4feso
(mbp) Remove code deprecated prior to 1.1 and its tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from bzrlib.missing import (
21
21
    find_unmerged,
22
 
    iter_log_data,
23
22
    iter_log_revisions,
24
23
    )
25
 
from bzrlib.symbol_versioning import zero_seventeen
26
24
from bzrlib.tests import TestCaseWithTransport
27
25
from bzrlib.workingtree import WorkingTree
28
26
 
57
55
        merger_tree.commit('d', rev_id='d')
58
56
        self.assertEqual(find_unmerged(original, merger), ([], [(2, 'd')]))
59
57
 
60
 
    def test_iter_log_data(self):
61
 
        base_tree = self.make_branch_and_tree('base')
62
 
        self.build_tree(['base/a'])
63
 
        base_tree.add(['a'], ['a-id'])
64
 
        base_tree.commit('add a', rev_id='b-1')
65
 
 
66
 
        child_tree = base_tree.bzrdir.sprout('child').open_workingtree()
67
 
 
68
 
        self.build_tree(['child/b'])
69
 
        child_tree.add(['b'], ['b-id'])
70
 
        child_tree.commit('adding b', rev_id='c-2')
71
 
 
72
 
        child_tree.remove(['a'])
73
 
        child_tree.commit('removing a', rev_id='c-3')
74
 
 
75
 
        self.build_tree_contents([('child/b', 'new contents for b\n')])
76
 
        child_tree.commit('modifying b', rev_id='c-4')
77
 
 
78
 
        child_tree.rename_one('b', 'c')
79
 
        child_tree.commit('rename b=>c', rev_id='c-5')
80
 
 
81
 
        base_extra, child_extra = find_unmerged(base_tree.branch,
82
 
                                                child_tree.branch)
83
 
        results = list(self.applyDeprecated(zero_seventeen, iter_log_data,
84
 
                            base_extra,
85
 
                            base_tree.branch.repository,
86
 
                            verbose=True))
87
 
        self.assertEqual([], results)
88
 
 
89
 
        results = list(self.applyDeprecated(zero_seventeen, iter_log_data,
90
 
                            child_extra,
91
 
                            child_tree.branch.repository,
92
 
                            verbose=True))
93
 
        self.assertEqual(4, len(results))
94
 
 
95
 
        r0,r1,r2,r3 = results
96
 
 
97
 
        self.assertEqual((2, 'c-2'), (r0[0], r0[1].revision_id))
98
 
        self.assertEqual((3, 'c-3'), (r1[0], r1[1].revision_id))
99
 
        self.assertEqual((4, 'c-4'), (r2[0], r2[1].revision_id))
100
 
        self.assertEqual((5, 'c-5'), (r3[0], r3[1].revision_id))
101
 
 
102
 
        delta0 = r0[2]
103
 
        self.assertNotEqual(None, delta0)
104
 
        self.assertEqual([('b', 'b-id', 'file')], delta0.added)
105
 
        self.assertEqual([], delta0.removed)
106
 
        self.assertEqual([], delta0.renamed)
107
 
        self.assertEqual([], delta0.modified)
108
 
 
109
 
        delta1 = r1[2]
110
 
        self.assertNotEqual(None, delta1)
111
 
        self.assertEqual([], delta1.added)
112
 
        self.assertEqual([('a', 'a-id', 'file')], delta1.removed)
113
 
        self.assertEqual([], delta1.renamed)
114
 
        self.assertEqual([], delta1.modified)
115
 
 
116
 
        delta2 = r2[2]
117
 
        self.assertNotEqual(None, delta2)
118
 
        self.assertEqual([], delta2.added)
119
 
        self.assertEqual([], delta2.removed)
120
 
        self.assertEqual([], delta2.renamed)
121
 
        self.assertEqual([('b', 'b-id', 'file', True, False)], delta2.modified)
122
 
 
123
 
        delta3 = r3[2]
124
 
        self.assertNotEqual(None, delta3)
125
 
        self.assertEqual([], delta3.added)
126
 
        self.assertEqual([], delta3.removed)
127
 
        self.assertEqual([('b', 'c', 'b-id', 'file', False, False)],
128
 
                         delta3.renamed)
129
 
        self.assertEqual([], delta3.modified)
130
 
 
131
58
    def test_iter_log_revisions(self):
132
59
        base_tree = self.make_branch_and_tree('base')
133
60
        self.build_tree(['base/a'])