~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2010-04-01 04:41:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5128.
  • Revision ID: mbp@sourcefrog.net-20100401044118-shyctqc02ob08ngz
ignore .testrepository

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
        self.make_linear_branch()
159
159
        self.assertLogRevnos(['-c1'], ['1'])
160
160
 
161
 
    def test_branch_revspec(self):
162
 
        foo = self.make_branch_and_tree('foo')
163
 
        bar = self.make_branch_and_tree('bar')
164
 
        self.build_tree(['foo/foo.txt', 'bar/bar.txt'])
165
 
        foo.add('foo.txt')
166
 
        bar.add('bar.txt')
167
 
        foo.commit(message='foo')
168
 
        bar.commit(message='bar')
169
 
        self.run_bzr('log -r branch:../bar', working_dir='foo')
170
 
        self.assertEqual([bar.branch.get_rev_id(1)],
171
 
                         [r.rev.revision_id
172
 
                          for r in self.get_captured_revisions()])
173
 
 
174
 
 
175
 
class TestLogExcludeCommonAncestry(TestLogWithLogCatcher):
176
 
 
177
 
    def test_exclude_common_ancestry_simple_revnos(self):
178
 
        self.make_linear_branch()
179
 
        self.assertLogRevnos(['-r1..3', '--exclude-common-ancestry'],
180
 
                             ['3', '2'])
181
 
 
182
161
 
183
162
class TestLogMergedLinearAncestry(TestLogWithLogCatcher):
184
163
 
188
167
        # stop calling run_bzr, there is no point) --vila 100118.
189
168
        builder = branchbuilder.BranchBuilder(self.get_transport())
190
169
        builder.start_series()
191
 
        # 1
192
 
        # | \
193
 
        # 2  1.1.1
194
 
        # | / |
195
 
        # 3  1.1.2
196
 
        # |   |
197
 
        # |  1.1.3
198
 
        # | / |
199
 
        # 4  1.1.4
200
 
        # | /
201
 
        # 5
202
 
 
203
170
        # mainline
204
171
        builder.build_snapshot('1', None, [
205
172
            ('add', ('', 'root-id', 'directory', ''))])
381
348
 
382
349
    def test_log_bad_message_re(self):
383
350
        """Bad --message argument gives a sensible message
384
 
 
 
351
        
385
352
        See https://bugs.launchpad.net/bzr/+bug/251352
386
353
        """
387
354
        self.make_minimal_branch()
388
355
        out, err = self.run_bzr(['log', '-m', '*'], retcode=3)
389
 
        self.assertContainsRe(err, "ERROR.*Invalid pattern.*nothing to repeat")
390
 
        self.assertNotContainsRe(err, "Unprintable exception")
391
 
        self.assertEqual(out, '')
 
356
        self.assertEqual("bzr: ERROR: Invalid regular expression"
 
357
            " in log message filter"
 
358
            ": '*'"
 
359
            ": nothing to repeat\n", err)
 
360
        self.assertEqual('', out)
392
361
 
393
362
    def test_log_unsupported_timezone(self):
394
363
        self.make_linear_branch()
396
365
                            'options are "utc", "original", "local".'],
397
366
                           ['log', '--timezone', 'foo'])
398
367
 
399
 
    def test_log_exclude_ancestry_no_range(self):
400
 
        self.make_linear_branch()
401
 
        self.run_bzr_error(['bzr: ERROR: --exclude-common-ancestry'
402
 
                            ' requires -r with two revisions'],
403
 
                           ['log', '--exclude-common-ancestry'])
404
 
 
405
 
    def test_log_exclude_ancestry_single_revision(self):
406
 
        self.make_merged_branch()
407
 
        self.run_bzr_error(['bzr: ERROR: --exclude-common-ancestry'
408
 
                            ' requires two different revisions'],
409
 
                           ['log', '--exclude-common-ancestry',
410
 
                            '-r1.1.1..1.1.1'])
411
368
 
412
369
class TestLogTags(TestLog):
413
370