~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testtestament.py

Update news and readme

- better explanation of dependencies

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.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
33
34
 
34
35
    def setUp(self):
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'
41
41
                 timezone=0,
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'),
44
44
                             ('src/', ),
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,
50
50
                 timezone=36000,
51
51
                 rev_id='test@user-2',
95
95
        if not has_symlinks():
96
96
            return
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,
101
101
                 timezone=36000,
102
102
                 rev_id='test@user-3',
108
108
        """Testament to revision with extra properties"""
109
109
        props = dict(flavor='sour cherry\ncream cheese',
110
110
                     size='medium')
111
 
        self.b.working_tree().commit(message='revision with properties',
 
111
        self.b.commit(message='revision with properties',
112
112
                      timestamp=1129025493,
113
113
                      timezone=36000,
114
114
                      rev_id='test@user-3',
136
136
message:
137
137
  initial null commit
138
138
inventory:
139
 
properties:
140
 
  branch-nick:
141
 
    test branch
142
139
"""
143
140
 
144
141
REV_1_SHORT = """\
162
159
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73
163
160
  directory src src-id
164
161
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
165
 
properties:
166
 
  branch-nick:
167
 
    test branch
168
162
"""
169
163
 
170
164
 
190
184
  directory src src-id
191
185
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
192
186
properties:
193
 
  branch-nick:
194
 
    test branch
195
187
  flavor:
196
188
    sour cherry
197
189
    cream cheese
215
207
  symlink link link-id wibble/linktarget
216
208
  directory src src-id
217
209
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
218
 
properties:
219
 
  branch-nick:
220
 
    test branch
221
210
"""