~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_missing.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-29 22:03:03 UTC
  • mfrom: (5416.2.6 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100929220303-cr95h8iwtggco721
(mbp) Add 'break-lock --force'

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2009, 2011 Canonical Ltd
 
1
# Copyright (C) 2005 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
 
17
20
from bzrlib import (
18
21
    missing,
19
22
    tests,
22
25
    iter_log_revisions,
23
26
    )
24
27
from bzrlib.tests import TestCaseWithTransport
 
28
from bzrlib.workingtree import WorkingTree
25
29
 
26
30
 
27
31
class TestMissing(TestCaseWithTransport):
134
138
class TestFindUnmerged(tests.TestCaseWithTransport):
135
139
 
136
140
    def assertUnmerged(self, local, remote, local_branch, remote_branch,
137
 
            restrict='all', include_merged=False, backward=False,
 
141
            restrict='all', include_merges=False, backward=False,
138
142
            local_revid_range=None, remote_revid_range=None):
139
143
        """Check the output of find_unmerged_mainline_revisions"""
140
144
        local_extra, remote_extra = missing.find_unmerged(
141
145
            local_branch, remote_branch, restrict,
142
 
            include_merged=include_merged, backward=backward,
 
146
            include_merges=include_merges, backward=backward,
143
147
            local_revid_range=local_revid_range,
144
148
            remote_revid_range=remote_revid_range)
145
149
        self.assertEqual(local, local_extra)
187
191
        self.assertUnmerged([], [], tree.branch, tree2.branch,
188
192
            local_revid_range=(rev1, rev1))
189
193
 
190
 
    def test_include_merged(self):
 
194
    def test_include_merges(self):
191
195
        tree = self.make_branch_and_tree('tree')
192
196
        rev1 = tree.commit('one', rev_id='rev1')
193
197
 
207
211
                                 ('3.1.1', 'rev4', 1), ('3.1.2', 'rev5', 1),
208
212
                                 ],
209
213
                            tree.branch, tree2.branch,
210
 
                            include_merged=True)
 
214
                            include_merges=True)
211
215
 
212
216
        self.assertUnmerged([], [('4', 'rev6', 0),
213
217
                                 ('3.1.2', 'rev5', 1), ('3.1.1', 'rev4', 1),
214
218
                                 ('3', 'rev3', 0), ('2', 'rev2', 0),
215
219
                                 ],
216
220
                            tree.branch, tree2.branch,
217
 
                            include_merged=True,
 
221
                            include_merges=True,
218
222
                            backward=True)
219
223
 
220
224
        self.assertUnmerged([], [('4', 'rev6', 0)],
221
225
            tree.branch, tree2.branch,
222
 
            include_merged=True, remote_revid_range=(rev6, rev6))
 
226
            include_merges=True, remote_revid_range=(rev6, rev6))
223
227
 
224
228
        self.assertUnmerged([], [('3', 'rev3', 0), ('3.1.1', 'rev4', 1)],
225
229
                    tree.branch, tree2.branch,
226
 
                    include_merged=True, remote_revid_range=(rev3, rev4))
 
230
                    include_merges=True, remote_revid_range=(rev3, rev4))
227
231
 
228
232
        self.assertUnmerged([], [('4', 'rev6', 0), ('3.1.2', 'rev5', 1)],
229
233
                    tree.branch, tree2.branch,
230
 
                    include_merged=True, remote_revid_range=(rev5, rev6))
 
234
                    include_merges=True, remote_revid_range=(rev5, rev6))
231
235
 
232
236
    def test_revision_range(self):
233
237
        local = self.make_branch_and_tree('local')