/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_missing.py

Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        merger = merger_tree.branch
42
42
        self.assertUnmerged(([], []), original, puller)
43
43
        original_tree.commit('a', rev_id='a')
44
 
        self.assertUnmerged(([('1', 'a')], []), original, puller)
 
44
        self.assertUnmerged(([('1', 'a', 0)], []), original, puller)
45
45
        puller_tree.pull(original)
46
46
        self.assertUnmerged(([], []), original, puller)
47
47
        merger_tree.pull(original)
48
48
        original_tree.commit('b', rev_id='b')
49
49
        original_tree.commit('c', rev_id='c')
50
 
        self.assertUnmerged(([('2', 'b'), ('3', 'c')], []),
 
50
        self.assertUnmerged(([('2', 'b', 0), ('3', 'c', 0)], []),
51
51
                            original, puller)
52
 
        self.assertUnmerged(([('3', 'c'), ('2', 'b')], []),
 
52
        self.assertUnmerged(([('3', 'c', 0), ('2', 'b', 0)], []),
53
53
                            original, puller, backward=True)
54
54
 
55
55
        puller_tree.pull(original)
56
56
        self.assertUnmerged(([], []), original, puller)
57
 
        self.assertUnmerged(([('2', 'b'), ('3', 'c')], []),
 
57
        self.assertUnmerged(([('2', 'b', 0), ('3', 'c', 0)], []),
58
58
                            original, merger)
59
59
        merger_tree.merge_from_branch(original)
60
 
        self.assertUnmerged(([('2', 'b'), ('3', 'c')], []),
 
60
        self.assertUnmerged(([('2', 'b', 0), ('3', 'c', 0)], []),
61
61
                            original, merger)
62
62
        merger_tree.commit('d', rev_id='d')
63
 
        self.assertUnmerged(([], [('2', 'd')]), original, merger)
 
63
        self.assertUnmerged(([], [('2', 'd', 0)]), original, merger)
64
64
 
65
65
    def test_iter_log_revisions(self):
66
66
        base_tree = self.make_branch_and_tree('base')
159
159
        rev1 = tree.commit('one')
160
160
        tree2 = tree.controldir.sprout('tree2').open_workingtree()
161
161
        rev2 = tree2.commit('two')
162
 
        self.assertUnmerged([], [('2', rev2)], tree.branch, tree2.branch)
163
 
        self.assertUnmerged([('2', rev2)], [], tree2.branch, tree.branch)
 
162
        self.assertUnmerged([], [('2', rev2, 0)], tree.branch, tree2.branch)
 
163
        self.assertUnmerged([('2', rev2, 0)], [], tree2.branch, tree.branch)
164
164
 
165
165
    def test_restrict(self):
166
166
        tree = self.make_branch_and_tree('tree')
167
167
        rev1 = tree.commit('one')
168
168
        tree2 = tree.controldir.sprout('tree2').open_workingtree()
169
169
        rev2 = tree2.commit('two')
170
 
        self.assertUnmerged([], [('2', rev2)], tree.branch, tree2.branch)
 
170
        self.assertUnmerged([], [('2', rev2, 0)], tree.branch, tree2.branch)
171
171
        self.assertUnmerged([], None, tree.branch, tree2.branch, 'local')
172
 
        self.assertUnmerged(None, [('2', rev2)], tree.branch, tree2.branch,
 
172
        self.assertUnmerged(None, [('2', rev2, 0)], tree.branch, tree2.branch,
173
173
                                               'remote')
174
174
 
175
175
    def test_merged(self):
181
181
        tree.merge_from_branch(tree2.branch)
182
182
        rev4 = tree.commit('four')
183
183
 
184
 
        self.assertUnmerged([('2', rev4)], [], tree.branch, tree2.branch)
185
 
        self.assertUnmerged([('2', rev4)], [], tree.branch, tree2.branch,
 
184
        self.assertUnmerged([('2', rev4, 0)], [], tree.branch, tree2.branch)
 
185
        self.assertUnmerged([('2', rev4, 0)], [], tree.branch, tree2.branch,
186
186
            local_revid_range=(rev4, rev4))
187
187
        self.assertUnmerged([], [], tree.branch, tree2.branch,
188
188
            local_revid_range=(rev1, rev1))
239
239
        lrevid2 = local.commit('two')
240
240
        lrevid3 = local.commit('three')
241
241
        lrevid4 = local.commit('four')
242
 
        local_extra = [('2', lrevid2), ('3', lrevid3), ('4', lrevid4)]
243
 
        remote_extra = [('2', rrevid2), ('3', rrevid3), ('4', rrevid4)]
 
242
        local_extra = [('2', lrevid2, 0), ('3', lrevid3, 0), ('4', lrevid4, 0)]
 
243
        remote_extra = [('2', rrevid2, 0), ('3', rrevid3, 0), ('4', rrevid4, 0)]
244
244
 
245
245
        # control
246
246
        self.assertUnmerged(local_extra, remote_extra,
250
250
            remote_revid_range=(None, None))
251
251
 
252
252
        # exclude local revisions
253
 
        self.assertUnmerged([('2', lrevid2)], remote_extra,
 
253
        self.assertUnmerged([('2', lrevid2, 0)], remote_extra,
254
254
            local.branch, remote.branch, local_revid_range=(lrevid2, lrevid2))
255
 
        self.assertUnmerged([('2', lrevid2), ('3', lrevid3)], remote_extra,
 
255
        self.assertUnmerged([('2', lrevid2, 0), ('3', lrevid3, 0)], remote_extra,
256
256
            local.branch, remote.branch, local_revid_range=(lrevid2, lrevid3))
257
 
        self.assertUnmerged([('2', lrevid2), ('3', lrevid3)], None,
 
257
        self.assertUnmerged([('2', lrevid2, 0), ('3', lrevid3, 0)], None,
258
258
            local.branch, remote.branch, 'local',
259
259
            local_revid_range=(lrevid2, lrevid3))
260
260
 
261
261
        # exclude remote revisions
262
 
        self.assertUnmerged(local_extra, [('2', rrevid2)],
 
262
        self.assertUnmerged(local_extra, [('2', rrevid2, 0)],
263
263
            local.branch, remote.branch, remote_revid_range=(None, rrevid2))
264
 
        self.assertUnmerged(local_extra, [('2', rrevid2)],
 
264
        self.assertUnmerged(local_extra, [('2', rrevid2, 0)],
265
265
            local.branch, remote.branch, remote_revid_range=(lrevid1, rrevid2))
266
 
        self.assertUnmerged(local_extra, [('2', rrevid2)],
 
266
        self.assertUnmerged(local_extra, [('2', rrevid2, 0)],
267
267
            local.branch, remote.branch, remote_revid_range=(rrevid2, rrevid2))
268
 
        self.assertUnmerged(local_extra, [('2', rrevid2), ('3', rrevid3)],
 
268
        self.assertUnmerged(local_extra, [('2', rrevid2, 0), ('3', rrevid3, 0)],
269
269
            local.branch, remote.branch, remote_revid_range=(None, rrevid3))
270
 
        self.assertUnmerged(local_extra, [('2', rrevid2), ('3', rrevid3)],
 
270
        self.assertUnmerged(local_extra, [('2', rrevid2, 0), ('3', rrevid3, 0)],
271
271
            local.branch, remote.branch, remote_revid_range=(rrevid2, rrevid3))
272
 
        self.assertUnmerged(local_extra, [('3', rrevid3)],
 
272
        self.assertUnmerged(local_extra, [('3', rrevid3, 0)],
273
273
            local.branch, remote.branch, remote_revid_range=(rrevid3, rrevid3))
274
 
        self.assertUnmerged(None, [('2', rrevid2), ('3', rrevid3)],
 
274
        self.assertUnmerged(None, [('2', rrevid2, 0), ('3', rrevid3, 0)],
275
275
            local.branch, remote.branch, 'remote',
276
276
            remote_revid_range=(rrevid2, rrevid3))
277
277
 
278
278
        # exclude local and remote revisions
279
 
        self.assertUnmerged([('3', lrevid3)], [('3', rrevid3)],
 
279
        self.assertUnmerged([('3', lrevid3, 0)], [('3', rrevid3, 0)],
280
280
            local.branch, remote.branch, local_revid_range=(lrevid3, lrevid3),
281
281
            remote_revid_range=(rrevid3, rrevid3))