1
# Copyright (C) 2007, 2008, 2009, 2011 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
17
from __future__ import absolute_import
19
from fixtures import Fixture
22
class SampleBranch(Fixture):
24
def __init__(self, testcase):
25
# Must be a bzr TestCase to hook into branch creation, unfortunately.
26
self.testcase = testcase
31
self.tree = self.testcase.make_branch_and_tree('.')
34
'some\nmultiline\ndata\n'
35
'with<htmlspecialchars\n')
36
filenames = ['myfilename', 'anotherfile<']
37
self.testcase.build_tree_contents(
38
(filename, self.filecontents) for filename in filenames)
39
for filename in filenames:
40
self.tree.add(filename, '%s-id' % filename)
41
self.fileid = self.tree.path2id('myfilename')
42
self.msg = 'a very exciting commit message <'
43
self.revid = self.tree.commit(message=self.msg)