1
# Copyright (C) 2006, Michael Ellerman
1
# Copyright (C) 2006 Canonical Ltd
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
36
36
def _check_revision_history(self, location=''):
37
rh = self.capture('revision-history ' + location)
37
rh = self.run_bzr(['revision-history', location])[0]
38
38
self.assertEqual(rh, 'revision_1\nrevision_2\nrevision_3\n')
40
40
def test_revision_history(self):
52
52
"""Tests 'revision_history' command with a location that is a
53
53
repository branch."""
54
54
self._build_branch()
55
self.run_bzr('init-repo', 'repo')
56
self.run_bzr('branch', 'test', 'repo/test')
55
self.run_bzr('init-repo repo')
56
self.run_bzr('branch test repo/test')
57
57
self._check_revision_history('repo/test')
59
59
def test_revision_history_with_checkout(self):
60
60
"""Tests 'revision_history' command with a location that is a
61
61
checkout of a repository branch."""
62
62
self._build_branch()
63
self.run_bzr('init-repo', 'repo')
64
self.run_bzr('branch', 'test', 'repo/test')
65
self.run_bzr('checkout', 'repo/test', 'test-checkout')
63
self.run_bzr('init-repo repo')
64
self.run_bzr('branch test repo/test')
65
self.run_bzr('checkout repo/test test-checkout')
66
66
self._check_revision_history('test-checkout')
68
68
def test_revision_history_with_lightweight_checkout(self):
69
69
"""Tests 'revision_history' command with a location that is a
70
70
lightweight checkout of a repository branch."""
71
71
self._build_branch()
72
self.run_bzr('init-repo', 'repo')
73
self.run_bzr('branch', 'test', 'repo/test')
74
self.run_bzr('checkout', '--lightweight', 'repo/test', 'test-checkout')
72
self.run_bzr('init-repo repo')
73
self.run_bzr('branch test repo/test')
74
self.run_bzr('checkout --lightweight repo/test test-checkout')
75
75
self._check_revision_history('test-checkout')