1
# Copyright (C) 2007 Canonical Ltd
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
class TestBundleInfo(tests.TestCaseWithTransport):
26
def test_bundle_info(self):
27
source = self.make_branch_and_tree('source')
28
self.build_tree(['source/foo'])
30
source.commit('added file', rev_id='rev1')
31
bundle = open('bundle', 'wb')
33
source.branch.repository.create_bundle('rev1', 'null:', bundle,
37
info = self.run_bzr('bundle-info bundle')[0]
38
self.assertContainsRe(info, 'file: 1 .0 multiparent.')
39
self.assertContainsRe(info, 'nicks: source')
40
self.assertNotContainsRe(info, 'foo')
41
self.run_bzr_error(['Verbose requires a merge directive'],
42
'bundle-info -v bundle')
43
target = self.make_branch('target')
44
md = merge_directive.MergeDirective2.from_objects(
45
source.branch.repository, 'rev1', 0, 0, 'target',
46
base_revision_id='null:')
47
directive = open('directive', 'wb')
49
directive.writelines(md.to_lines())
52
info = self.run_bzr('bundle-info -v directive')[0]
53
self.assertContainsRe(info, 'foo')