~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_missing.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005-2009, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
import os
18
 
 
19
 
 
20
17
from bzrlib import (
21
18
    missing,
22
19
    tests,
25
22
    iter_log_revisions,
26
23
    )
27
24
from bzrlib.tests import TestCaseWithTransport
28
 
from bzrlib.workingtree import WorkingTree
29
25
 
30
26
 
31
27
class TestMissing(TestCaseWithTransport):
138
134
class TestFindUnmerged(tests.TestCaseWithTransport):
139
135
 
140
136
    def assertUnmerged(self, local, remote, local_branch, remote_branch,
141
 
            restrict='all', include_merges=False, backward=False,
 
137
            restrict='all', include_merged=False, backward=False,
142
138
            local_revid_range=None, remote_revid_range=None):
143
139
        """Check the output of find_unmerged_mainline_revisions"""
144
140
        local_extra, remote_extra = missing.find_unmerged(
145
141
            local_branch, remote_branch, restrict,
146
 
            include_merges=include_merges, backward=backward,
 
142
            include_merged=include_merged, backward=backward,
147
143
            local_revid_range=local_revid_range,
148
144
            remote_revid_range=remote_revid_range)
149
145
        self.assertEqual(local, local_extra)
191
187
        self.assertUnmerged([], [], tree.branch, tree2.branch,
192
188
            local_revid_range=(rev1, rev1))
193
189
 
194
 
    def test_include_merges(self):
 
190
    def test_include_merged(self):
195
191
        tree = self.make_branch_and_tree('tree')
196
192
        rev1 = tree.commit('one', rev_id='rev1')
197
193
 
211
207
                                 ('3.1.1', 'rev4', 1), ('3.1.2', 'rev5', 1),
212
208
                                 ],
213
209
                            tree.branch, tree2.branch,
214
 
                            include_merges=True)
 
210
                            include_merged=True)
215
211
 
216
212
        self.assertUnmerged([], [('4', 'rev6', 0),
217
213
                                 ('3.1.2', 'rev5', 1), ('3.1.1', 'rev4', 1),
218
214
                                 ('3', 'rev3', 0), ('2', 'rev2', 0),
219
215
                                 ],
220
216
                            tree.branch, tree2.branch,
221
 
                            include_merges=True,
 
217
                            include_merged=True,
222
218
                            backward=True)
223
219
 
224
220
        self.assertUnmerged([], [('4', 'rev6', 0)],
225
221
            tree.branch, tree2.branch,
226
 
            include_merges=True, remote_revid_range=(rev6, rev6))
 
222
            include_merged=True, remote_revid_range=(rev6, rev6))
227
223
 
228
224
        self.assertUnmerged([], [('3', 'rev3', 0), ('3.1.1', 'rev4', 1)],
229
225
                    tree.branch, tree2.branch,
230
 
                    include_merges=True, remote_revid_range=(rev3, rev4))
 
226
                    include_merged=True, remote_revid_range=(rev3, rev4))
231
227
 
232
228
        self.assertUnmerged([], [('4', 'rev6', 0), ('3.1.2', 'rev5', 1)],
233
229
                    tree.branch, tree2.branch,
234
 
                    include_merges=True, remote_revid_range=(rev5, rev6))
 
230
                    include_merged=True, remote_revid_range=(rev5, rev6))
235
231
 
236
232
    def test_revision_range(self):
237
233
        local = self.make_branch_and_tree('local')