1
# Copyright (C) 2007, 2009 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
# there might be either one file, or two, depending on whether the
40
self.assertContainsRe(info, 'file: [12] .0 multiparent.')
41
self.assertContainsRe(info, 'nicks: source')
42
self.assertNotContainsRe(info, 'foo')
43
self.run_bzr_error(['--verbose requires a merge directive'],
44
'bundle-info -v bundle')
45
target = self.make_branch('target')
46
md = merge_directive.MergeDirective2.from_objects(
47
source.branch.repository, 'rev1', 0, 0, 'target',
48
base_revision_id='null:')
49
directive = open('directive', 'wb')
51
directive.writelines(md.to_lines())
54
info = self.run_bzr('bundle-info -v directive')[0]
55
self.assertContainsRe(info, 'foo')