~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testtestament.py

- store revprops in testaments

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
        t = Testament.from_revision(self.b, 'test@user-3')
103
103
        self.assertEqualDiff(t.as_text(), REV_3_TESTAMENT)
104
104
 
 
105
    def test_testament_revprops(self):
 
106
        """Testament to revision with extra properties"""
 
107
        props = dict(flavor='sour cherry\ncream cheese',
 
108
                     size='medium')
 
109
        self.b.commit(message='revision with properties',
 
110
                      timestamp=1129025493,
 
111
                      timezone=36000,
 
112
                      rev_id='test@user-3',
 
113
                      committer='test@user',
 
114
                      revprops=props)
 
115
        t = Testament.from_revision(self.b, 'test@user-3')
 
116
        self.assertEqualDiff(t.as_text(), REV_PROPS_TESTAMENT)
 
117
                    
105
118
 
106
119
REV_1_TESTAMENT = """\
107
120
bazaar-ng testament version 1
146
159
""" % sha(REV_2_TESTAMENT).hexdigest()
147
160
 
148
161
 
 
162
REV_PROPS_TESTAMENT = """\
 
163
bazaar-ng testament version 1
 
164
revision-id: test@user-3
 
165
committer: test@user
 
166
timestamp: 1129025493
 
167
timezone: 36000
 
168
parents:
 
169
  test@user-2
 
170
message:
 
171
  revision with properties
 
172
inventory:
 
173
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73
 
174
  directory src src-id
 
175
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
 
176
properties:
 
177
  flavor:
 
178
    sour cherry
 
179
    cream cheese
 
180
  size:
 
181
    medium
 
182
"""
 
183
 
 
184
 
149
185
REV_3_TESTAMENT = """\
150
186
bazaar-ng testament version 1
151
187
revision-id: test@user-3