22
22
from sha import sha
25
from bzrlib.tests import TestCaseInTempDir
25
from bzrlib.selftest import TestCaseInTempDir
26
from bzrlib.selftest.treeshape import build_tree_contents
26
27
from bzrlib.branch import Branch
27
28
from bzrlib.testament import Testament
28
29
from bzrlib.trace import mutter
35
36
super(TestamentTests, self).setUp()
36
b = self.b = Branch.initialize(u'.')
37
b.nick = "test branch"
38
b.working_tree().commit(message='initial null commit',
37
b = self.b = Branch.initialize('.')
38
b.commit(message='initial null commit',
39
39
committer='test@user',
40
40
timestamp=1129025423, # 'Tue Oct 11 20:10:23 2005'
42
42
rev_id='test@user-1')
43
self.build_tree_contents([('hello', 'contents of hello file'),
43
build_tree_contents([('hello', 'contents of hello file'),
45
45
('src/foo.c', 'int main()\n{\n}\n')])
46
b.working_tree().add(['hello', 'src', 'src/foo.c'],
47
['hello-id', 'src-id', 'foo.c-id'])
48
b.working_tree().commit(message='add files and directories',
46
b.add(['hello', 'src', 'src/foo.c'],
47
['hello-id', 'src-id', 'foo.c-id'])
48
b.commit(message='add files and directories',
49
49
timestamp=1129025483,
51
51
rev_id='test@user-2',
95
95
if not has_symlinks():
97
97
os.symlink('wibble/linktarget', 'link')
98
self.b.working_tree().add(['link'], ['link-id'])
99
self.b.working_tree().commit(message='add symlink',
98
self.b.add(['link'], ['link-id'])
99
self.b.commit(message='add symlink',
100
100
timestamp=1129025493,
102
102
rev_id='test@user-3',
108
108
"""Testament to revision with extra properties"""
109
109
props = dict(flavor='sour cherry\ncream cheese',
111
self.b.working_tree().commit(message='revision with properties',
111
self.b.commit(message='revision with properties',
112
112
timestamp=1129025493,
114
114
rev_id='test@user-3',