~bzr-pqm/bzr/bzr.dev

2052.3.2 by John Arbash Meinel
Change Copyright .. by Canonical to Copyright ... Canonical
1
# Copyright (C) 2005 Canonical Ltd
1685.1.80 by Wouter van Heyst
more code cleanup
2
#
1185.54.23 by Aaron Bentley
Added unit tests for find_unmerged
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
1685.1.80 by Wouter van Heyst
more code cleanup
7
#
1185.54.23 by Aaron Bentley
Added unit tests for find_unmerged
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
1685.1.80 by Wouter van Heyst
more code cleanup
12
#
1185.54.23 by Aaron Bentley
Added unit tests for find_unmerged
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1534.4.26 by Robert Collins
Move working tree initialisation out from Branch.initialize, deprecated Branch.initialize to Branch.create.
16
17
import os
18
19
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
20
from bzrlib import (
21
    missing,
22
    tests,
23
    )
2490.1.2 by John Arbash Meinel
Cleanup according to PEP8 and some other small whitespace fixes
24
from bzrlib.missing import (
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
25
    iter_log_revisions,
26
    )
1534.4.26 by Robert Collins
Move working tree initialisation out from Branch.initialize, deprecated Branch.initialize to Branch.create.
27
from bzrlib.tests import TestCaseWithTransport
28
from bzrlib.workingtree import WorkingTree
29
1534.4.28 by Robert Collins
first cut at merge from integration.
30
1534.4.26 by Robert Collins
Move working tree initialisation out from Branch.initialize, deprecated Branch.initialize to Branch.create.
31
class TestMissing(TestCaseWithTransport):
32
3677.1.8 by Vincent Ladeuil
Fixed as per jam's review.
33
    def assertUnmerged(self, expected, source, target, restrict='all',
34
                       backward=False):
35
        unmerged = missing.find_unmerged(source, target, restrict=restrict,
36
                                         backward=backward)
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
37
        self.assertEqual(expected, unmerged)
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
38
1185.54.23 by Aaron Bentley
Added unit tests for find_unmerged
39
    def test_find_unmerged(self):
1534.4.26 by Robert Collins
Move working tree initialisation out from Branch.initialize, deprecated Branch.initialize to Branch.create.
40
        original_tree = self.make_branch_and_tree('original')
41
        original = original_tree.branch
42
        puller_tree = self.make_branch_and_tree('puller')
43
        puller = puller_tree.branch
44
        merger_tree = self.make_branch_and_tree('merger')
45
        merger = merger_tree.branch
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
46
        self.assertUnmerged(([], []), original, puller)
1534.4.26 by Robert Collins
Move working tree initialisation out from Branch.initialize, deprecated Branch.initialize to Branch.create.
47
        original_tree.commit('a', rev_id='a')
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
48
        self.assertUnmerged(([('1', 'a')], []), original, puller)
1666.1.4 by Robert Collins
* 'Metadir' is now the default disk format. This improves behaviour in
49
        puller_tree.pull(original)
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
50
        self.assertUnmerged(([], []), original, puller)
1666.1.4 by Robert Collins
* 'Metadir' is now the default disk format. This improves behaviour in
51
        merger_tree.pull(original)
1534.4.26 by Robert Collins
Move working tree initialisation out from Branch.initialize, deprecated Branch.initialize to Branch.create.
52
        original_tree.commit('b', rev_id='b')
53
        original_tree.commit('c', rev_id='c')
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
54
        self.assertUnmerged(([('2', 'b'), ('3', 'c')], []),
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
55
                            original, puller)
3677.1.8 by Vincent Ladeuil
Fixed as per jam's review.
56
        self.assertUnmerged(([('3', 'c'), ('2', 'b')], []),
57
                            original, puller, backward=True)
1185.54.23 by Aaron Bentley
Added unit tests for find_unmerged
58
1666.1.4 by Robert Collins
* 'Metadir' is now the default disk format. This improves behaviour in
59
        puller_tree.pull(original)
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
60
        self.assertUnmerged(([], []), original, puller)
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
61
        self.assertUnmerged(([('2', 'b'), ('3', 'c')], []),
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
62
                            original, merger)
1551.15.70 by Aaron Bentley
Avoid using builtins.merge
63
        merger_tree.merge_from_branch(original)
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
64
        self.assertUnmerged(([('2', 'b'), ('3', 'c')], []),
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
65
                            original, merger)
1534.4.26 by Robert Collins
Move working tree initialisation out from Branch.initialize, deprecated Branch.initialize to Branch.create.
66
        merger_tree.commit('d', rev_id='d')
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
67
        self.assertUnmerged(([], [('2', 'd')]), original, merger)
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
68
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
69
    def test_iter_log_revisions(self):
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
70
        base_tree = self.make_branch_and_tree('base')
71
        self.build_tree(['base/a'])
72
        base_tree.add(['a'], ['a-id'])
73
        base_tree.commit('add a', rev_id='b-1')
74
75
        child_tree = base_tree.bzrdir.sprout('child').open_workingtree()
76
77
        self.build_tree(['child/b'])
78
        child_tree.add(['b'], ['b-id'])
79
        child_tree.commit('adding b', rev_id='c-2')
80
81
        child_tree.remove(['a'])
82
        child_tree.commit('removing a', rev_id='c-3')
83
84
        self.build_tree_contents([('child/b', 'new contents for b\n')])
85
        child_tree.commit('modifying b', rev_id='c-4')
86
87
        child_tree.rename_one('b', 'c')
88
        child_tree.commit('rename b=>c', rev_id='c-5')
89
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
90
        base_extra, child_extra = missing.find_unmerged(base_tree.branch,
3677.1.4 by Vincent Ladeuil
Replace 'reverse' by 'backward' when talking about revision order.
91
                                                        child_tree.branch)
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
92
        results = list(iter_log_revisions(base_extra,
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
93
                            base_tree.branch.repository,
94
                            verbose=True))
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
95
        self.assertEqual([], results)
96
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
97
        results = list(iter_log_revisions(child_extra,
98
                            child_tree.branch.repository,
99
                            verbose=True))
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
100
        self.assertEqual(4, len(results))
101
102
        r0,r1,r2,r3 = results
103
3677.1.2 by Vincent Ladeuil
Fix tests broken by previous commit.
104
        self.assertEqual([('2', 'c-2'), ('3', 'c-3'),
105
                          ('4', 'c-4'), ('5', 'c-5'),],
106
                         [(r.revno, r.rev.revision_id) for r in results])
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
107
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
108
        delta0 = r0.delta
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
109
        self.assertNotEqual(None, delta0)
110
        self.assertEqual([('b', 'b-id', 'file')], delta0.added)
111
        self.assertEqual([], delta0.removed)
112
        self.assertEqual([], delta0.renamed)
113
        self.assertEqual([], delta0.modified)
114
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
115
        delta1 = r1.delta
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
116
        self.assertNotEqual(None, delta1)
117
        self.assertEqual([], delta1.added)
118
        self.assertEqual([('a', 'a-id', 'file')], delta1.removed)
119
        self.assertEqual([], delta1.renamed)
120
        self.assertEqual([], delta1.modified)
121
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
122
        delta2 = r2.delta
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
123
        self.assertNotEqual(None, delta2)
124
        self.assertEqual([], delta2.added)
125
        self.assertEqual([], delta2.removed)
126
        self.assertEqual([], delta2.renamed)
127
        self.assertEqual([('b', 'b-id', 'file', True, False)], delta2.modified)
128
2466.8.1 by Kent Gibson
Reworked LogFormatter API to simplify extending the attributes of the revision being logged. Added support for begin_log() and end_log() hooks in LogFormatters.
129
        delta3 = r3.delta
2204.1.1 by John Arbash Meinel
'bzr missing -v' was showing adds as deletes.
130
        self.assertNotEqual(None, delta3)
131
        self.assertEqual([], delta3.added)
132
        self.assertEqual([], delta3.removed)
133
        self.assertEqual([('b', 'c', 'b-id', 'file', False, False)],
134
                         delta3.renamed)
135
        self.assertEqual([], delta3.modified)
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
136
137
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
138
class TestFindUnmerged(tests.TestCaseWithTransport):
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
139
140
    def assertUnmerged(self, local, remote, local_branch, remote_branch,
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
141
            restrict='all', include_merges=False, backward=False,
142
            local_revid_range=None, remote_revid_range=None):
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
143
        """Check the output of find_unmerged_mainline_revisions"""
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
144
        local_extra, remote_extra = missing.find_unmerged(
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
145
            local_branch, remote_branch, restrict,
146
            include_merges=include_merges, backward=backward,
147
            local_revid_range=local_revid_range,
148
            remote_revid_range=remote_revid_range)
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
149
        self.assertEqual(local, local_extra)
150
        self.assertEqual(remote, remote_extra)
151
152
    def test_same_branch(self):
153
        tree = self.make_branch_and_tree('tree')
154
        rev1 = tree.commit('one')
155
        tree.lock_read()
156
        self.addCleanup(tree.unlock)
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
157
        self.assertUnmerged([], [], tree.branch, tree.branch)
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
158
        self.assertUnmerged([], [], tree.branch, tree.branch,
3921.3.8 by Marius Kruger
* _filter_revs can now handle None and len=3 revs
159
            local_revid_range=(rev1, rev1))
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
160
161
    def test_one_ahead(self):
162
        tree = self.make_branch_and_tree('tree')
163
        rev1 = tree.commit('one')
164
        tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
165
        rev2 = tree2.commit('two')
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
166
        self.assertUnmerged([], [('2', rev2)], tree.branch, tree2.branch)
167
        self.assertUnmerged([('2', rev2)], [], tree2.branch, tree.branch)
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
168
169
    def test_restrict(self):
170
        tree = self.make_branch_and_tree('tree')
171
        rev1 = tree.commit('one')
172
        tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
173
        rev2 = tree2.commit('two')
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
174
        self.assertUnmerged([], [('2', rev2)], tree.branch, tree2.branch)
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
175
        self.assertUnmerged([], None, tree.branch, tree2.branch, 'local')
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
176
        self.assertUnmerged(None, [('2', rev2)], tree.branch, tree2.branch,
3427.3.1 by John Arbash Meinel
Add bzrlib.missing.find_unmerged_mainline_revisions
177
                                               'remote')
178
3427.3.2 by John Arbash Meinel
switch find_unmerged to use the new function
179
    def test_merged(self):
180
        tree = self.make_branch_and_tree('tree')
181
        rev1 = tree.commit('one')
182
        tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
183
        rev2 = tree2.commit('two')
184
        rev3 = tree2.commit('three')
185
        tree.merge_from_branch(tree2.branch)
186
        rev4 = tree.commit('four')
187
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
188
        self.assertUnmerged([('2', rev4)], [], tree.branch, tree2.branch)
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
189
        self.assertUnmerged([('2', rev4)], [], tree.branch, tree2.branch,
3921.3.8 by Marius Kruger
* _filter_revs can now handle None and len=3 revs
190
            local_revid_range=(rev4, rev4))
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
191
        self.assertUnmerged([], [], tree.branch, tree2.branch,
3921.3.8 by Marius Kruger
* _filter_revs can now handle None and len=3 revs
192
            local_revid_range=(rev1, rev1))
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
193
194
    def test_include_merges(self):
195
        tree = self.make_branch_and_tree('tree')
196
        rev1 = tree.commit('one', rev_id='rev1')
197
198
        tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
199
        rev2 = tree2.commit('two', rev_id='rev2')
200
        rev3 = tree2.commit('three', rev_id='rev3')
201
202
        tree3 = tree2.bzrdir.sprout('tree3').open_workingtree()
203
        rev4 = tree3.commit('four', rev_id='rev4')
204
        rev5 = tree3.commit('five', rev_id='rev5')
205
206
        tree2.merge_from_branch(tree3.branch)
207
        rev6 = tree2.commit('six', rev_id='rev6')
208
3921.3.14 by Marius Kruger
put spaces after commas
209
        self.assertUnmerged([], [('2', 'rev2', 0), ('3', 'rev3', 0),
3677.1.5 by Vincent Ladeuil
Indent merge revisions correctly.
210
                                 ('4', 'rev6', 0),
211
                                 ('3.1.1', 'rev4', 1), ('3.1.2', 'rev5', 1),
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
212
                                 ],
3921.3.14 by Marius Kruger
put spaces after commas
213
                            tree.branch, tree2.branch,
3677.1.1 by Vincent Ladeuil
Begin fixing bug #233817.
214
                            include_merges=True)
215
3677.1.8 by Vincent Ladeuil
Fixed as per jam's review.
216
        self.assertUnmerged([], [('4', 'rev6', 0),
217
                                 ('3.1.2', 'rev5', 1), ('3.1.1', 'rev4', 1),
3921.3.14 by Marius Kruger
put spaces after commas
218
                                 ('3', 'rev3', 0), ('2', 'rev2', 0),
3677.1.8 by Vincent Ladeuil
Fixed as per jam's review.
219
                                 ],
3921.3.14 by Marius Kruger
put spaces after commas
220
                            tree.branch, tree2.branch,
3677.1.8 by Vincent Ladeuil
Fixed as per jam's review.
221
                            include_merges=True,
222
                            backward=True)
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
223
3921.3.8 by Marius Kruger
* _filter_revs can now handle None and len=3 revs
224
        self.assertUnmerged([], [('4', 'rev6', 0)],
3921.3.14 by Marius Kruger
put spaces after commas
225
            tree.branch, tree2.branch,
3921.3.8 by Marius Kruger
* _filter_revs can now handle None and len=3 revs
226
            include_merges=True, remote_revid_range=(rev6, rev6))
227
3921.3.14 by Marius Kruger
put spaces after commas
228
        self.assertUnmerged([], [('3', 'rev3', 0), ('3.1.1', 'rev4', 1)],
229
                    tree.branch, tree2.branch,
3921.3.8 by Marius Kruger
* _filter_revs can now handle None and len=3 revs
230
                    include_merges=True, remote_revid_range=(rev3, rev4))
231
3921.3.14 by Marius Kruger
put spaces after commas
232
        self.assertUnmerged([], [('4', 'rev6', 0), ('3.1.2', 'rev5', 1)],
233
                    tree.branch, tree2.branch,
3921.3.8 by Marius Kruger
* _filter_revs can now handle None and len=3 revs
234
                    include_merges=True, remote_revid_range=(rev5, rev6))
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
235
236
    def test_revision_range(self):
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
237
        local = self.make_branch_and_tree('local')
238
        lrevid1 = local.commit('one')
239
        remote = local.bzrdir.sprout('remote').open_workingtree()
240
        rrevid2 = remote.commit('two')
241
        rrevid3 = remote.commit('three')
242
        rrevid4 = remote.commit('four')
243
        lrevid2 = local.commit('two')
244
        lrevid3 = local.commit('three')
245
        lrevid4 = local.commit('four')
246
        local_extra = [('2', lrevid2), ('3', lrevid3), ('4', lrevid4)]
247
        remote_extra = [('2', rrevid2), ('3', rrevid3), ('4', rrevid4)]
248
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
249
        # control
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
250
        self.assertUnmerged(local_extra, remote_extra,
251
            local.branch, remote.branch)
252
        self.assertUnmerged(local_extra, remote_extra,
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
253
            local.branch, remote.branch, local_revid_range=(None, None),
254
            remote_revid_range=(None, None))
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
255
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
256
        # exclude local revisions
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
257
        self.assertUnmerged([('2', lrevid2)], remote_extra,
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
258
            local.branch, remote.branch, local_revid_range=(lrevid2, lrevid2))
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
259
        self.assertUnmerged([('2', lrevid2), ('3', lrevid3)], remote_extra,
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
260
            local.branch, remote.branch, local_revid_range=(lrevid2, lrevid3))
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
261
        self.assertUnmerged([('2', lrevid2), ('3', lrevid3)], None,
262
            local.branch, remote.branch, 'local',
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
263
            local_revid_range=(lrevid2, lrevid3))
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
264
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
265
        # exclude remote revisions
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
266
        self.assertUnmerged(local_extra, [('2', rrevid2)],
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
267
            local.branch, remote.branch, remote_revid_range=(None, rrevid2))
268
        self.assertUnmerged(local_extra, [('2', rrevid2)],
269
            local.branch, remote.branch, remote_revid_range=(lrevid1, rrevid2))
270
        self.assertUnmerged(local_extra, [('2', rrevid2)],
271
            local.branch, remote.branch, remote_revid_range=(rrevid2, rrevid2))
3921.3.1 by Marius Kruger
* add support for specifying a revision range to missing.find_unmerged
272
        self.assertUnmerged(local_extra, [('2', rrevid2), ('3', rrevid3)],
3921.3.9 by Marius Kruger
* add some blackbox tests and another whitebox test
273
            local.branch, remote.branch, remote_revid_range=(None, rrevid3))
274
        self.assertUnmerged(local_extra, [('2', rrevid2), ('3', rrevid3)],
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
275
            local.branch, remote.branch, remote_revid_range=(rrevid2, rrevid3))
276
        self.assertUnmerged(local_extra, [('3', rrevid3)],
277
            local.branch, remote.branch, remote_revid_range=(rrevid3, rrevid3))
3921.3.2 by Marius Kruger
* rename _get_revid_in_bounds() -> _get_revid_in_range()
278
        self.assertUnmerged(None, [('2', rrevid2), ('3', rrevid3)],
279
            local.branch, remote.branch, 'remote',
3921.3.7 by Marius Kruger
just filter the missing revisions once all have been calculated.
280
            remote_revid_range=(rrevid2, rrevid3))
281
282
        # exclude local and remote revisions
283
        self.assertUnmerged([('3', lrevid3)], [('3', rrevid3)],
284
            local.branch, remote.branch, local_revid_range=(lrevid3, lrevid3),
285
            remote_revid_range=(rrevid3, rrevid3))