~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_testament.py

Merge from integration

Show diffs side-by-side

added added

removed removed

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