/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_testament.py

  • Committer: Jelmer Vernooij
  • Date: 2019-02-15 17:41:17 UTC
  • mto: (7290.1.2 work)
  • mto: This revision was merged to the branch mainline in revision 7295.
  • Revision ID: jelmer@jelmer.uk-20190215174117-o9w1am2z88mg9g1q
Update references to home location.

~/.config/breezy rather than ~/.bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
 
21
21
import os
22
22
 
23
 
from bzrlib import osutils
24
 
from bzrlib.tests import SymlinkFeature, TestCaseWithTransport
25
 
from bzrlib.testament import Testament, StrictTestament, StrictTestament3
26
 
from bzrlib.transform import TreeTransform
 
23
from breezy import osutils
 
24
from breezy.tests import TestCaseWithTransport
 
25
from breezy.bzr.testament import (
 
26
    Testament,
 
27
    StrictTestament,
 
28
    StrictTestament3,
 
29
    )
 
30
from breezy.transform import TreeTransform
 
31
from breezy.tests.features import (
 
32
    SymlinkFeature,
 
33
    )
27
34
 
28
35
 
29
36
class TestamentSetup(TestCaseWithTransport):
30
37
 
31
38
    def setUp(self):
32
39
        super(TestamentSetup, self).setUp()
33
 
        self.wt = self.make_branch_and_tree('.', format='dirstate-with-subtree')
34
 
        self.wt.set_root_id('TREE_ROT')
 
40
        self.wt = self.make_branch_and_tree('.', format='development-subtree')
 
41
        self.wt.set_root_id(b'TREE_ROT')
35
42
        b = self.b = self.wt.branch
36
43
        b.nick = "test branch"
37
44
        self.wt.commit(message='initial null commit',
38
 
                 committer='test@user',
39
 
                 timestamp=1129025423, # 'Tue Oct 11 20:10:23 2005'
40
 
                 timezone=0,
41
 
                 rev_id='test@user-1')
42
 
        self.build_tree_contents([('hello', 'contents of hello file'),
43
 
                             ('src/', ),
44
 
                             ('src/foo.c', 'int main()\n{\n}\n')])
 
45
                       committer='test@user',
 
46
                       timestamp=1129025423,  # 'Tue Oct 11 20:10:23 2005'
 
47
                       timezone=0,
 
48
                       rev_id=b'test@user-1')
 
49
        self.build_tree_contents([('hello', b'contents of hello file'),
 
50
                                  ('src/', ),
 
51
                                  ('src/foo.c', b'int main()\n{\n}\n')])
45
52
        self.wt.add(['hello', 'src', 'src/foo.c'],
46
 
                             ['hello-id', 'src-id', 'foo.c-id'])
 
53
                    [b'hello-id', b'src-id', b'foo.c-id'])
47
54
        tt = TreeTransform(self.wt)
48
55
        trans_id = tt.trans_id_tree_path('hello')
49
56
        tt.set_executability(True, trans_id)
50
57
        tt.apply()
51
58
        self.wt.commit(message='add files and directories',
52
 
                 timestamp=1129025483,
53
 
                 timezone=36000,
54
 
                 rev_id='test@user-2',
55
 
                 committer='test@user')
 
59
                       timestamp=1129025483,
 
60
                       timezone=36000,
 
61
                       rev_id=b'test@user-2',
 
62
                       committer='test@user')
56
63
 
57
64
 
58
65
class TestamentTests(TestamentSetup):
68
75
 
69
76
    def test_null_testament(self):
70
77
        """Testament for a revision with no contents."""
71
 
        t = self.from_revision(self.b.repository, 'test@user-1')
 
78
        t = self.from_revision(self.b.repository, b'test@user-1')
72
79
        ass = self.assertTrue
73
80
        eq = self.assertEqual
74
81
        ass(isinstance(t, Testament))
75
 
        eq(t.revision_id, 'test@user-1')
 
82
        eq(t.revision_id, b'test@user-1')
76
83
        eq(t.committer, 'test@user')
77
84
        eq(t.timestamp, 1129025423)
78
85
        eq(t.timezone, 0)
79
86
 
80
87
    def test_testment_text_form(self):
81
88
        """Conversion of testament to canonical text form."""
82
 
        t = self.from_revision(self.b.repository, 'test@user-1')
 
89
        t = self.from_revision(self.b.repository, b'test@user-1')
83
90
        text_form = t.as_text()
84
 
        self.log('testament text form:\n' + text_form)
 
91
        self.log('testament text form:\n%s' % text_form)
85
92
        self.assertEqualDiff(text_form, self.expected('rev_1'))
86
93
        short_text_form = t.as_short_text()
87
94
        self.assertEqualDiff(short_text_form, self.expected('rev_1_short'))
88
95
 
89
96
    def test_testament_with_contents(self):
90
97
        """Testament containing a file and a directory."""
91
 
        t = self.from_revision(self.b.repository, 'test@user-2')
 
98
        t = self.from_revision(self.b.repository, b'test@user-2')
92
99
        text_form = t.as_text()
93
 
        self.log('testament text form:\n' + text_form)
 
100
        self.log('testament text form:\n%s' % text_form)
94
101
        self.assertEqualDiff(text_form, self.expected('rev_2'))
95
102
        actual_short = t.as_short_text()
96
103
        self.assertEqualDiff(actual_short, self.expected('rev_2_short'))
99
106
        """Testament containing symlink (where possible)"""
100
107
        self.requireFeature(SymlinkFeature)
101
108
        os.symlink('wibble/linktarget', 'link')
102
 
        self.wt.add(['link'], ['link-id'])
 
109
        self.wt.add(['link'], [b'link-id'])
103
110
        self.wt.commit(message='add symlink',
104
 
                 timestamp=1129025493,
105
 
                 timezone=36000,
106
 
                 rev_id='test@user-3',
107
 
                 committer='test@user')
108
 
        t = self.from_revision(self.b.repository, 'test@user-3')
 
111
                       timestamp=1129025493,
 
112
                       timezone=36000,
 
113
                       rev_id=b'test@user-3',
 
114
                       committer='test@user')
 
115
        t = self.from_revision(self.b.repository, b'test@user-3')
109
116
        self.assertEqualDiff(t.as_text(), self.expected('rev_3'))
110
117
 
111
118
    def test_testament_revprops(self):
112
119
        """Testament to revision with extra properties"""
113
 
        props = dict(flavor='sour cherry\ncream cheese',
114
 
                     size='medium',
115
 
                     empty='',
116
 
                    )
 
120
        props = {u'flavor': 'sour cherry\ncream cheese',
 
121
                 u'size': 'medium',
 
122
                 u'empty': '',
 
123
                 }
117
124
        self.wt.commit(message='revision with properties',
118
 
                      timestamp=1129025493,
119
 
                      timezone=36000,
120
 
                      rev_id='test@user-3',
121
 
                      committer='test@user',
122
 
                      revprops=props)
123
 
        t = self.from_revision(self.b.repository, 'test@user-3')
 
125
                       timestamp=1129025493,
 
126
                       timezone=36000,
 
127
                       rev_id=b'test@user-3',
 
128
                       committer='test@user',
 
129
                       revprops=props)
 
130
        t = self.from_revision(self.b.repository, b'test@user-3')
124
131
        self.assertEqualDiff(t.as_text(), self.expected('rev_props'))
125
132
 
126
133
    def test_testament_unicode_commit_message(self):
128
135
            message=u'non-ascii commit \N{COPYRIGHT SIGN} me',
129
136
            timestamp=1129025493,
130
137
            timezone=36000,
131
 
            rev_id='test@user-3',
132
 
            committer='Erik B\xe5gfors <test@user>',
133
 
            revprops={'uni':u'\xb5'}
 
138
            rev_id=b'test@user-3',
 
139
            committer=u'Erik B\xe5gfors <test@user>',
 
140
            revprops={u'uni': u'\xb5'}
134
141
            )
135
 
        t = self.from_revision(self.b.repository, 'test@user-3')
 
142
        t = self.from_revision(self.b.repository, b'test@user-3')
136
143
        self.assertEqualDiff(
137
144
            self.expected('sample_unicode').encode('utf-8'), t.as_text())
138
145
 
 
146
    def test_from_tree(self):
 
147
        tree = self.b.repository.revision_tree(b'test@user-2')
 
148
        testament = self.testament_class().from_revision_tree(tree)
 
149
        text_1 = testament.as_short_text()
 
150
        text_2 = self.from_revision(self.b.repository,
 
151
                                    b'test@user-2').as_short_text()
 
152
        self.assertEqual(text_1, text_2)
 
153
 
139
154
    def test___init__(self):
140
 
        revision = self.b.repository.get_revision('test@user-2')
141
 
        inventory = self.b.repository.get_inventory('test@user-2')
142
 
        testament_1 = self.testament_class()(revision, inventory)
 
155
        revision = self.b.repository.get_revision(b'test@user-2')
 
156
        tree = self.b.repository.revision_tree(b'test@user-2')
 
157
        testament_1 = self.testament_class()(revision, tree)
143
158
        text_1 = testament_1.as_short_text()
144
159
        text_2 = self.from_revision(self.b.repository,
145
 
                                    'test@user-2').as_short_text()
 
160
                                    b'test@user-2').as_short_text()
146
161
        self.assertEqual(text_1, text_2)
147
162
 
148
163
 
158
173
        return StrictTestament3
159
174
 
160
175
 
161
 
REV_1_TESTAMENT = """\
162
 
bazaar-ng testament version 1
163
 
revision-id: test@user-1
164
 
committer: test@user
165
 
timestamp: 1129025423
166
 
timezone: 0
167
 
parents:
168
 
message:
169
 
  initial null commit
170
 
inventory:
171
 
properties:
172
 
  branch-nick:
173
 
    test branch
174
 
"""
175
 
 
176
 
 
177
 
REV_1_STRICT_TESTAMENT = """\
178
 
bazaar-ng testament version 2.1
179
 
revision-id: test@user-1
180
 
committer: test@user
181
 
timestamp: 1129025423
182
 
timezone: 0
183
 
parents:
184
 
message:
185
 
  initial null commit
186
 
inventory:
187
 
properties:
188
 
  branch-nick:
189
 
    test branch
190
 
"""
191
 
 
192
 
 
193
 
REV_1_STRICT_TESTAMENT3 = """\
194
 
bazaar testament version 3 strict
195
 
revision-id: test@user-1
196
 
committer: test@user
197
 
timestamp: 1129025423
198
 
timezone: 0
199
 
parents:
200
 
message:
201
 
  initial null commit
202
 
inventory:
203
 
  directory . TREE_ROT test@user-1 no
204
 
properties:
205
 
  branch-nick:
206
 
    test branch
207
 
"""
208
 
 
209
 
 
210
 
REV_1_SHORT = """\
211
 
bazaar-ng testament short form 1
212
 
revision-id: test@user-1
213
 
sha1: %s
214
 
""" % osutils.sha(REV_1_TESTAMENT).hexdigest()
215
 
 
216
 
 
217
 
REV_1_SHORT_STRICT = """\
218
 
bazaar-ng testament short form 2.1
219
 
revision-id: test@user-1
220
 
sha1: %s
221
 
""" % osutils.sha(REV_1_STRICT_TESTAMENT).hexdigest()
222
 
 
223
 
 
224
 
REV_1_SHORT_STRICT3 = """\
225
 
bazaar testament short form 3 strict
226
 
revision-id: test@user-1
227
 
sha1: %s
228
 
""" % osutils.sha(REV_1_STRICT_TESTAMENT3).hexdigest()
229
 
 
230
 
 
231
 
REV_2_TESTAMENT = """\
232
 
bazaar-ng testament version 1
233
 
revision-id: test@user-2
234
 
committer: test@user
235
 
timestamp: 1129025483
236
 
timezone: 36000
237
 
parents:
238
 
  test@user-1
239
 
message:
240
 
  add files and directories
241
 
inventory:
242
 
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73
243
 
  directory src src-id
244
 
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
245
 
properties:
246
 
  branch-nick:
247
 
    test branch
248
 
"""
249
 
 
250
 
 
251
 
REV_2_STRICT_TESTAMENT = """\
252
 
bazaar-ng testament version 2.1
253
 
revision-id: test@user-2
254
 
committer: test@user
255
 
timestamp: 1129025483
256
 
timezone: 36000
257
 
parents:
258
 
  test@user-1
259
 
message:
260
 
  add files and directories
261
 
inventory:
262
 
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
263
 
  directory src src-id test@user-2 no
264
 
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
265
 
properties:
266
 
  branch-nick:
267
 
    test branch
268
 
"""
269
 
 
270
 
 
271
 
REV_2_STRICT_TESTAMENT3 = """\
272
 
bazaar testament version 3 strict
273
 
revision-id: test@user-2
274
 
committer: test@user
275
 
timestamp: 1129025483
276
 
timezone: 36000
277
 
parents:
278
 
  test@user-1
279
 
message:
280
 
  add files and directories
281
 
inventory:
282
 
  directory . TREE_ROT test@user-1 no
283
 
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
284
 
  directory src src-id test@user-2 no
285
 
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
286
 
properties:
287
 
  branch-nick:
288
 
    test branch
289
 
"""
290
 
 
291
 
 
292
 
REV_2_SHORT = """\
293
 
bazaar-ng testament short form 1
294
 
revision-id: test@user-2
295
 
sha1: %s
296
 
""" % osutils.sha(REV_2_TESTAMENT).hexdigest()
297
 
 
298
 
 
299
 
REV_2_SHORT_STRICT = """\
300
 
bazaar-ng testament short form 2.1
301
 
revision-id: test@user-2
302
 
sha1: %s
303
 
""" % osutils.sha(REV_2_STRICT_TESTAMENT).hexdigest()
304
 
 
305
 
 
306
 
REV_2_SHORT_STRICT3 = """\
307
 
bazaar testament short form 3 strict
308
 
revision-id: test@user-2
309
 
sha1: %s
310
 
""" % osutils.sha(REV_2_STRICT_TESTAMENT3).hexdigest()
311
 
 
312
 
 
313
 
REV_PROPS_TESTAMENT = """\
314
 
bazaar-ng testament version 1
315
 
revision-id: test@user-3
316
 
committer: test@user
317
 
timestamp: 1129025493
318
 
timezone: 36000
319
 
parents:
320
 
  test@user-2
321
 
message:
322
 
  revision with properties
323
 
inventory:
324
 
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73
325
 
  directory src src-id
326
 
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
327
 
properties:
328
 
  branch-nick:
329
 
    test branch
330
 
  empty:
331
 
  flavor:
332
 
    sour cherry
333
 
    cream cheese
334
 
  size:
335
 
    medium
336
 
"""
337
 
 
338
 
 
339
 
REV_PROPS_TESTAMENT_STRICT = """\
340
 
bazaar-ng testament version 2.1
341
 
revision-id: test@user-3
342
 
committer: test@user
343
 
timestamp: 1129025493
344
 
timezone: 36000
345
 
parents:
346
 
  test@user-2
347
 
message:
348
 
  revision with properties
349
 
inventory:
350
 
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
351
 
  directory src src-id test@user-2 no
352
 
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
353
 
properties:
354
 
  branch-nick:
355
 
    test branch
356
 
  empty:
357
 
  flavor:
358
 
    sour cherry
359
 
    cream cheese
360
 
  size:
361
 
    medium
362
 
"""
363
 
 
364
 
 
365
 
REV_PROPS_TESTAMENT_STRICT3 = """\
366
 
bazaar testament version 3 strict
367
 
revision-id: test@user-3
368
 
committer: test@user
369
 
timestamp: 1129025493
370
 
timezone: 36000
371
 
parents:
372
 
  test@user-2
373
 
message:
374
 
  revision with properties
375
 
inventory:
376
 
  directory . TREE_ROT test@user-1 no
377
 
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
378
 
  directory src src-id test@user-2 no
379
 
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
380
 
properties:
381
 
  branch-nick:
382
 
    test branch
383
 
  empty:
384
 
  flavor:
385
 
    sour cherry
386
 
    cream cheese
387
 
  size:
388
 
    medium
389
 
"""
390
 
 
391
 
 
392
 
REV_3_TESTAMENT = """\
 
176
REV_1_TESTAMENT = b"""\
 
177
bazaar-ng testament version 1
 
178
revision-id: test@user-1
 
179
committer: test@user
 
180
timestamp: 1129025423
 
181
timezone: 0
 
182
parents:
 
183
message:
 
184
  initial null commit
 
185
inventory:
 
186
properties:
 
187
  branch-nick:
 
188
    test branch
 
189
"""
 
190
 
 
191
 
 
192
REV_1_STRICT_TESTAMENT = b"""\
 
193
bazaar-ng testament version 2.1
 
194
revision-id: test@user-1
 
195
committer: test@user
 
196
timestamp: 1129025423
 
197
timezone: 0
 
198
parents:
 
199
message:
 
200
  initial null commit
 
201
inventory:
 
202
properties:
 
203
  branch-nick:
 
204
    test branch
 
205
"""
 
206
 
 
207
 
 
208
REV_1_STRICT_TESTAMENT3 = b"""\
 
209
bazaar testament version 3 strict
 
210
revision-id: test@user-1
 
211
committer: test@user
 
212
timestamp: 1129025423
 
213
timezone: 0
 
214
parents:
 
215
message:
 
216
  initial null commit
 
217
inventory:
 
218
  directory . TREE_ROT test@user-1 no
 
219
properties:
 
220
  branch-nick:
 
221
    test branch
 
222
"""
 
223
 
 
224
 
 
225
REV_1_SHORT = b"""\
 
226
bazaar-ng testament short form 1
 
227
revision-id: test@user-1
 
228
sha1: %s
 
229
""" % osutils.sha_string(REV_1_TESTAMENT)
 
230
 
 
231
 
 
232
REV_1_SHORT_STRICT = b"""\
 
233
bazaar-ng testament short form 2.1
 
234
revision-id: test@user-1
 
235
sha1: %s
 
236
""" % osutils.sha_string(REV_1_STRICT_TESTAMENT)
 
237
 
 
238
 
 
239
REV_1_SHORT_STRICT3 = b"""\
 
240
bazaar testament short form 3 strict
 
241
revision-id: test@user-1
 
242
sha1: %s
 
243
""" % osutils.sha_string(REV_1_STRICT_TESTAMENT3)
 
244
 
 
245
 
 
246
REV_2_TESTAMENT = b"""\
 
247
bazaar-ng testament version 1
 
248
revision-id: test@user-2
 
249
committer: test@user
 
250
timestamp: 1129025483
 
251
timezone: 36000
 
252
parents:
 
253
  test@user-1
 
254
message:
 
255
  add files and directories
 
256
inventory:
 
257
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73
 
258
  directory src src-id
 
259
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
 
260
properties:
 
261
  branch-nick:
 
262
    test branch
 
263
"""
 
264
 
 
265
 
 
266
REV_2_STRICT_TESTAMENT = b"""\
 
267
bazaar-ng testament version 2.1
 
268
revision-id: test@user-2
 
269
committer: test@user
 
270
timestamp: 1129025483
 
271
timezone: 36000
 
272
parents:
 
273
  test@user-1
 
274
message:
 
275
  add files and directories
 
276
inventory:
 
277
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
 
278
  directory src src-id test@user-2 no
 
279
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
 
280
properties:
 
281
  branch-nick:
 
282
    test branch
 
283
"""
 
284
 
 
285
 
 
286
REV_2_STRICT_TESTAMENT3 = b"""\
 
287
bazaar testament version 3 strict
 
288
revision-id: test@user-2
 
289
committer: test@user
 
290
timestamp: 1129025483
 
291
timezone: 36000
 
292
parents:
 
293
  test@user-1
 
294
message:
 
295
  add files and directories
 
296
inventory:
 
297
  directory . TREE_ROT test@user-1 no
 
298
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
 
299
  directory src src-id test@user-2 no
 
300
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
 
301
properties:
 
302
  branch-nick:
 
303
    test branch
 
304
"""
 
305
 
 
306
 
 
307
REV_2_SHORT = b"""\
 
308
bazaar-ng testament short form 1
 
309
revision-id: test@user-2
 
310
sha1: %s
 
311
""" % osutils.sha_string(REV_2_TESTAMENT)
 
312
 
 
313
 
 
314
REV_2_SHORT_STRICT = b"""\
 
315
bazaar-ng testament short form 2.1
 
316
revision-id: test@user-2
 
317
sha1: %s
 
318
""" % osutils.sha_string(REV_2_STRICT_TESTAMENT)
 
319
 
 
320
 
 
321
REV_2_SHORT_STRICT3 = b"""\
 
322
bazaar testament short form 3 strict
 
323
revision-id: test@user-2
 
324
sha1: %s
 
325
""" % osutils.sha_string(REV_2_STRICT_TESTAMENT3)
 
326
 
 
327
 
 
328
REV_PROPS_TESTAMENT = b"""\
 
329
bazaar-ng testament version 1
 
330
revision-id: test@user-3
 
331
committer: test@user
 
332
timestamp: 1129025493
 
333
timezone: 36000
 
334
parents:
 
335
  test@user-2
 
336
message:
 
337
  revision with properties
 
338
inventory:
 
339
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73
 
340
  directory src src-id
 
341
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24
 
342
properties:
 
343
  branch-nick:
 
344
    test branch
 
345
  empty:
 
346
  flavor:
 
347
    sour cherry
 
348
    cream cheese
 
349
  size:
 
350
    medium
 
351
"""
 
352
 
 
353
 
 
354
REV_PROPS_TESTAMENT_STRICT = b"""\
 
355
bazaar-ng testament version 2.1
 
356
revision-id: test@user-3
 
357
committer: test@user
 
358
timestamp: 1129025493
 
359
timezone: 36000
 
360
parents:
 
361
  test@user-2
 
362
message:
 
363
  revision with properties
 
364
inventory:
 
365
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
 
366
  directory src src-id test@user-2 no
 
367
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
 
368
properties:
 
369
  branch-nick:
 
370
    test branch
 
371
  empty:
 
372
  flavor:
 
373
    sour cherry
 
374
    cream cheese
 
375
  size:
 
376
    medium
 
377
"""
 
378
 
 
379
 
 
380
REV_PROPS_TESTAMENT_STRICT3 = b"""\
 
381
bazaar testament version 3 strict
 
382
revision-id: test@user-3
 
383
committer: test@user
 
384
timestamp: 1129025493
 
385
timezone: 36000
 
386
parents:
 
387
  test@user-2
 
388
message:
 
389
  revision with properties
 
390
inventory:
 
391
  directory . TREE_ROT test@user-1 no
 
392
  file hello hello-id 34dd0ac19a24bf80c4d33b5c8960196e8d8d1f73 test@user-2 yes
 
393
  directory src src-id test@user-2 no
 
394
  file src/foo.c foo.c-id a2a049c20f908ae31b231d98779eb63c66448f24 test@user-2 no
 
395
properties:
 
396
  branch-nick:
 
397
    test branch
 
398
  empty:
 
399
  flavor:
 
400
    sour cherry
 
401
    cream cheese
 
402
  size:
 
403
    medium
 
404
"""
 
405
 
 
406
 
 
407
REV_3_TESTAMENT = b"""\
393
408
bazaar-ng testament version 1
394
409
revision-id: test@user-3
395
410
committer: test@user
410
425
"""
411
426
 
412
427
 
413
 
REV_3_TESTAMENT_STRICT = """\
 
428
REV_3_TESTAMENT_STRICT = b"""\
414
429
bazaar-ng testament version 2.1
415
430
revision-id: test@user-3
416
431
committer: test@user
431
446
"""
432
447
 
433
448
 
434
 
REV_3_TESTAMENT_STRICT3 = """\
 
449
REV_3_TESTAMENT_STRICT3 = b"""\
435
450
bazaar testament version 3 strict
436
451
revision-id: test@user-3
437
452
committer: test@user
521
536
 
522
537
 
523
538
texts = {
524
 
    Testament: { 'rev_1': REV_1_TESTAMENT,
525
 
                 'rev_1_short': REV_1_SHORT,
526
 
                 'rev_2': REV_2_TESTAMENT,
527
 
                 'rev_2_short': REV_2_SHORT,
528
 
                 'rev_3': REV_3_TESTAMENT,
529
 
                 'rev_props': REV_PROPS_TESTAMENT,
530
 
                 'sample_unicode': SAMPLE_UNICODE_TESTAMENT,
531
 
    },
 
539
    Testament: {'rev_1': REV_1_TESTAMENT,
 
540
                'rev_1_short': REV_1_SHORT,
 
541
                'rev_2': REV_2_TESTAMENT,
 
542
                'rev_2_short': REV_2_SHORT,
 
543
                'rev_3': REV_3_TESTAMENT,
 
544
                'rev_props': REV_PROPS_TESTAMENT,
 
545
                'sample_unicode': SAMPLE_UNICODE_TESTAMENT,
 
546
                },
532
547
    StrictTestament: {'rev_1': REV_1_STRICT_TESTAMENT,
533
548
                      'rev_1_short': REV_1_SHORT_STRICT,
534
549
                      'rev_2': REV_2_STRICT_TESTAMENT,
536
551
                      'rev_3': REV_3_TESTAMENT_STRICT,
537
552
                      'rev_props': REV_PROPS_TESTAMENT_STRICT,
538
553
                      'sample_unicode': SAMPLE_UNICODE_TESTAMENT_STRICT,
539
 
    },
 
554
                      },
540
555
    StrictTestament3: {'rev_1': REV_1_STRICT_TESTAMENT3,
541
 
                      'rev_1_short': REV_1_SHORT_STRICT3,
542
 
                      'rev_2': REV_2_STRICT_TESTAMENT3,
543
 
                      'rev_2_short': REV_2_SHORT_STRICT3,
544
 
                      'rev_3': REV_3_TESTAMENT_STRICT3,
545
 
                      'rev_props': REV_PROPS_TESTAMENT_STRICT3,
546
 
                      'sample_unicode': SAMPLE_UNICODE_TESTAMENT_STRICT3,
547
 
    },
 
556
                       'rev_1_short': REV_1_SHORT_STRICT3,
 
557
                       'rev_2': REV_2_STRICT_TESTAMENT3,
 
558
                       'rev_2_short': REV_2_SHORT_STRICT3,
 
559
                       'rev_3': REV_3_TESTAMENT_STRICT3,
 
560
                       'rev_props': REV_PROPS_TESTAMENT_STRICT3,
 
561
                       'sample_unicode': SAMPLE_UNICODE_TESTAMENT_STRICT3,
 
562
                       },
548
563
}