~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_log.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-02 15:23:15 UTC
  • mfrom: (4996.3.1 trivial)
  • Revision ID: pqm@pqm.ubuntu.com-20100202152315-dzbzbhpwun9xpnj6
(mbp) remove contrib/fortune

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2009 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
23
23
 
24
24
from bzrlib import (
25
25
    branchbuilder,
26
 
    errors,
27
26
    log,
28
27
    osutils,
29
28
    tests,
159
158
        self.assertLogRevnos(['-c1'], ['1'])
160
159
 
161
160
 
162
 
class TestLogMergedLinearAncestry(TestLogWithLogCatcher):
 
161
class TestBug474807(TestLogWithLogCatcher):
163
162
 
164
163
    def setUp(self):
165
 
        super(TestLogMergedLinearAncestry, self).setUp()
 
164
        super(TestBug474807, self).setUp()
166
165
        # FIXME: Using a MemoryTree would be even better here (but until we
167
166
        # stop calling run_bzr, there is no point) --vila 100118.
168
167
        builder = branchbuilder.BranchBuilder(self.get_transport())
203
202
                             ['1.1.1', '1.1.2', '1.1.3', '1.1.4'])
204
203
 
205
204
 
206
 
class Test_GenerateAllRevisions(TestLogWithLogCatcher):
207
 
 
208
 
    def make_branch_with_many_merges(self, path='.', format=None):
209
 
        builder = branchbuilder.BranchBuilder(self.get_transport())
210
 
        builder.start_series()
211
 
        # The graph below may look a bit complicated (and it may be but I've
212
 
        # banged my head enough on it) but the bug requires at least dotted
213
 
        # revnos *and* merged revisions below that.
214
 
        builder.build_snapshot('1', None, [
215
 
            ('add', ('', 'root-id', 'directory', ''))])
216
 
        builder.build_snapshot('2', ['1'], [])
217
 
        builder.build_snapshot('1.1.1', ['1'], [])
218
 
        builder.build_snapshot('2.1.1', ['2'], [])
219
 
        builder.build_snapshot('3', ['2', '1.1.1'], [])
220
 
        builder.build_snapshot('2.1.2', ['2.1.1'], [])
221
 
        builder.build_snapshot('2.2.1', ['2.1.1'], [])
222
 
        builder.build_snapshot('2.1.3', ['2.1.2', '2.2.1'], [])
223
 
        builder.build_snapshot('4', ['3', '2.1.3'], [])
224
 
        builder.build_snapshot('5', ['4', '2.1.2'], [])
225
 
        builder.finish_series()
226
 
        return builder
227
 
 
228
 
    def test_not_an_ancestor(self):
229
 
        builder = self.make_branch_with_many_merges()
230
 
        b = builder.get_branch()
231
 
        b.lock_read()
232
 
        self.addCleanup(b.unlock)
233
 
        self.assertRaises(errors.BzrCommandError,
234
 
                          log._generate_all_revisions,
235
 
                          b, '1.1.1', '2.1.3', 'reverse',
236
 
                          delayed_graph_generation=True)
237
 
 
238
 
    def test_wrong_order(self):
239
 
        builder = self.make_branch_with_many_merges()
240
 
        b = builder.get_branch()
241
 
        b.lock_read()
242
 
        self.addCleanup(b.unlock)
243
 
        self.assertRaises(errors.BzrCommandError,
244
 
                          log._generate_all_revisions,
245
 
                          b, '5', '2.1.3', 'reverse',
246
 
                          delayed_graph_generation=True)
247
 
 
248
 
 
249
205
class TestLogRevSpecsWithPaths(TestLogWithLogCatcher):
250
206
 
251
207
    def test_log_revno_n_path_wrong_namespace(self):
254
210
        # There is no guarantee that a path exist between two arbitrary
255
211
        # revisions.
256
212
        self.run_bzr("log -r revno:2:branch1..revno:3:branch2", retcode=3)
 
213
        # But may be it's worth trying though ? -- vila 100115
257
214
 
258
215
    def test_log_revno_n_path_correct_order(self):
259
216
        self.make_linear_branch('branch2')