16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
18
from bzrlib.tests import TestCaseInTempDir, TestCase
19
from bzrlib import repository
20
19
from bzrlib.osutils import has_symlinks
23
22
except ImportError:
26
from bzrlib.plugins.bzrtools import cmd_baz_import
27
from bzrlib.plugins.bzrtools.baz_import import (import_version,
26
from bzrtools.baz_import import (import_version, revision_id,
27
cmd_baz_import, make_archive, map_file_id)
29
from bzrlib.plugins.bzrtools.baz_import import (import_version,
32
35
from StringIO import StringIO
34
37
from testresources import (TestResource, TestLoader, OptimisingTestSuite,
38
41
from bzrlib.errors import NoSuchRevision
39
from bzrlib.plugins.bzrtools.fai import namespace_previous
43
from bzrtools.fai import namespace_previous
45
from bzrlib.plugins.bzrtools.fai import namespace_previous
40
46
from bzrlib.branch import Branch
64
70
pybaz.set_my_id("Test User<test@example.org>")
66
72
self.make_empty_import()
69
74
self._empty_tag = 'demo@DONOTUSE/c--empty-tag--0'
70
self._empty_tag_bzr = revision_id(self._empty_tag + '--base-0', None)
75
self._empty_tag_bzr = revision_id(self._empty_tag + '--base-0')
71
76
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
72
77
pybaz.Version(self._empty_tag))
74
79
self._empty_merged_tag = 'demo@DONOTUSE/c--empty-merged-tag--0'
75
self._empty_merged_tag_bzr_base = revision_id(self._empty_merged_tag
77
self._empty_merged_tag_bzr = revision_id(self._empty_merged_tag
80
self._empty_merged_tag_bzr_base = revision_id(self._empty_merged_tag
82
self._empty_merged_tag_bzr = revision_id(self._empty_merged_tag
79
84
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
80
85
pybaz.Version(self._empty_merged_tag))
81
86
tree = pybaz.Revision(self._empty_merged_tag + '--base-0').get(
86
91
msg["summary"]="did a merge, yarh"
88
93
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
90
95
# tree, two commits, includes merge of other branch
91
96
self._empty_merged_tag_2 = 'demo@DONOTUSE/c--empty-tag-2--0'
92
97
self._empty_merged_tag_2_bzr_base = revision_id(
93
self._empty_merged_tag_2 + '--base-0', None)
98
self._empty_merged_tag_2 + '--base-0')
94
99
self._empty_merged_tag_2_bzr = revision_id(
95
self._empty_merged_tag_2 + '--patch-1', None)
100
self._empty_merged_tag_2 + '--patch-1')
96
101
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
97
102
pybaz.Version(self._empty_merged_tag_2))
98
103
tree = pybaz.Revision(self._empty_merged_tag_2 + '--base-0').get (
105
110
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
107
112
self._bad_id_tag = 'demo@DONOTUSE/c--bad-id--0'
108
self._bad_id_tag_bzr_base = revision_id(self._bad_id_tag + '--base-0',
110
self._bad_id_tag_bzr = revision_id(self._bad_id_tag + '--patch-1',
113
self._bad_id_tag_bzr_base = revision_id(self._bad_id_tag + '--base-0')
114
self._bad_id_tag_bzr = revision_id(self._bad_id_tag + '--patch-1')
112
115
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
113
116
pybaz.Version(self._bad_id_tag))
114
117
tree = pybaz.Revision(self._bad_id_tag + '--base-0').get(
115
118
os.path.join(self._tmpdir, 'tree'))
116
119
from bzrlib.plugins.bzrtools.baz_import import add_file
117
add_file(os.path.join(self._tmpdir,'tree/path'), 'text',
120
add_file(os.path.join(self._tmpdir,'tree/path'), 'text',
118
121
'this_id/needs%escaping')
119
122
msg = tree.log_message()
120
123
msg["summary"] = "commit something which needs escaping."
128
131
def make_import_symlink(self):
129
132
self._import_symlink = 'demo@DONOTUSE/c--import-symlink--0'
130
133
self._import_symlink_bzr = revision_id(
131
self._import_symlink + '--base-0', None)
134
self._import_symlink + '--base-0')
132
135
os.mkdir(os.path.join(self._tmpdir, 'tree'))
133
136
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
134
137
self._import_symlink)
135
link_path = os.path.join(self._tmpdir, 'tree', 'alink')
136
os.symlink('missing-file-name', link_path)
138
os.symlink('missing-file-name',
139
os.path.join(self._tmpdir, 'tree', 'alink'))
137
140
tree.add_tag('alink')
138
141
id_file = open(os.path.join(tree, '.arch-ids', 'alink.id'), 'w')
139
142
id_file.write('symlink_tag\n')
141
144
msg = tree.log_message()
142
145
msg["summary"] = "Import with a symlink"
143
146
tree.import_(msg)
145
f = file(link_path, 'w')
146
f.write('Not a symlink no more!')
148
msg = tree.log_message()
149
msg["summary"] = "Turn a symlink into a file"
151
147
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
153
149
def make_empty_import(self):
154
150
self._import = 'demo@DONOTUSE/c--import--0'
155
151
os.mkdir(os.path.join(self._tmpdir, 'tree'))
156
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
152
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
158
154
msg = tree.log_message()
159
155
msg["summary"] = "I am importing now"
160
156
tree.import_(msg)
161
157
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
163
def make_utf8_log(self):
164
self._utf8 = 'demo@DONOTUSE/c--utf8--0'
165
os.mkdir(os.path.join(self._tmpdir, 'tree'))
166
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
168
msg = tree.log_message()
169
msg["summary"] = u"I am importing now\u1234".encode('utf-8')
171
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
173
159
def make_missing_ancestor(self):
174
160
self._archivegoneroot = os.path.join(self._tmpdir, 'archivegone')
175
161
self._archive = make_archive('demo-gone@DONOTUSE',
176
162
str(self._archivegoneroot))
177
163
self._missing_import = 'demo-gone@DONOTUSE/c--import--0'
178
self._missing_import_bzr = revision_id(self._missing_import
164
self._missing_import_bzr = revision_id(self._missing_import
180
166
self._missing_ancestor = 'demo@DONOTUSE/c--gone--0'
181
self._missing_ancestor_bzr = revision_id(self._missing_ancestor
167
self._missing_ancestor_bzr = revision_id(self._missing_ancestor
183
169
os.mkdir(os.path.join(self._tmpdir, 'tree'))
184
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
170
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
185
171
self._missing_import)
186
172
msg = tree.log_message()
187
173
msg["summary"] = "I am importing now"
194
180
# make an import for testing history-reuse logic.
195
181
# note the use of a namespace layout here.
196
self._missing_import_imported = os.path.join(self._tmpdir,
182
self._missing_import_imported = os.path.join(self._tmpdir,
197
183
'archivegone-bzr')
198
184
os.mkdir(os.path.join(self._tmpdir, 'archivegone-bzr'))
199
185
os.mkdir(os.path.join(self._tmpdir, 'archivegone-bzr', 'c'))
200
import_version(os.path.join(self._tmpdir, 'archivegone-bzr',
186
import_version(os.path.join(self._tmpdir, 'archivegone-bzr',
202
pybaz.Version(self._missing_import), None)
188
pybaz.Version(self._missing_import))
203
189
# and make it inaccessible
204
190
pybaz.Archive('demo-gone@DONOTUSE').unregister()
206
192
def make_inbranch_continuation(self):
207
193
self._inbranch_tag = 'demo@DONOTUSE/c--inbranch-tag--0'
208
194
self._inbranch_tag_base = self._inbranch_tag + '--base-0'
209
self._inbranch_tag_base_bzr = revision_id(self._inbranch_tag_base,
195
self._inbranch_tag_base_bzr = revision_id(self._inbranch_tag_base)
211
196
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
212
197
pybaz.Version(self._inbranch_tag))
213
198
self._inbranch_tag_head = self._inbranch_tag + '--patch-1'
214
self._inbranch_tag_head_bzr = revision_id(self._inbranch_tag_head,
199
self._inbranch_tag_head_bzr = revision_id(self._inbranch_tag_head)
216
200
pybaz.Revision(self._inbranch_tag_base).make_continuation(
217
201
pybaz.Version(self._inbranch_tag))
237
221
def tearDown(self):
238
222
ResourcedTestCase.tearDownResources(self)
239
223
TestCaseInTempDir.tearDown(self)
241
def test_import_utf8(self):
242
import_version('output', pybaz.Version(self._baz._utf8), None)
243
branch = Branch.open('output')
244
plain_revid = 'Arch-1:demo@DONOTUSE%c--utf8--0--base-0'
245
self.assertEqual([plain_revid], branch.revision_history())
246
self.assertEqual(u'I am importing now\ufffd\ufffd\ufffd',
247
branch.repository.get_revision(plain_revid).message)
248
import_version('output2', pybaz.Version(self._baz._utf8), 'utf-8')
249
branch2 = Branch.open('output2')
250
utf8_revid = 'Arch-1-utf-8:demo@DONOTUSE%c--utf8--0--base-0'
251
self.assertEqual([utf8_revid], branch2.revision_history())
252
self.assertEqual(u'I am importing now\u1234',
253
branch2.repository.get_revision(utf8_revid).message)
255
225
def test_import_empty(self):
256
import_version('output', pybaz.Version(self._baz._import), None)
226
import_version('output', pybaz.Version(self._baz._import))
257
227
# expected results:
258
# one commit, no files, revision identifier of
228
# one commit, no files, revision identifier of
259
229
# 'demo@DONOTUSE_c--import--0--base-0'
260
230
branch = Branch.open('output')
261
231
repo = branch.repository
279
248
"Arch-1:demo@DONOTUSE%c--import--0--base-0")
281
250
def test_empty_tagged(self):
282
import_version('output', pybaz.Version(self._baz._empty_tag), None)
251
import_version('output', pybaz.Version(self._baz._empty_tag))
283
252
# expected results:
284
# two commits, no files, revision identifiers of
253
# two commits, no files, revision identifiers of
285
254
# 'demo@DONOTUSE_c--import--0--base-0' and
286
255
# self._baz._empty_tag_bzr
287
256
branch = Branch.open('output')
300
269
# and we should get some expected values:
301
270
self.assertEqual(rev.committer, "Test User<test@example.org>")
302
self.assertEqual(rev.message,
271
self.assertEqual(rev.message,
303
272
"tag of demo@DONOTUSE/c--import--0--base-0")
304
273
self.assertEqual(rev.revision_id, self._baz._empty_tag_bzr)
306
275
def test_empty_merged_tagged(self):
307
import_version('output', pybaz.Version(self._baz._empty_merged_tag),
276
import_version('output', pybaz.Version(self._baz._empty_merged_tag))
309
277
# expected results:
310
# two commits, no files, revision identifiers of
278
# two commits, no files, revision identifiers of
311
279
# 'demo@DONOTUSE_c--import--0--base-0' and
312
280
# self._baz._empty_merged_tag_bzr_base
313
281
# self._baz._empty_merged_tag_bzr
320
288
self._baz._empty_merged_tag_bzr_base,
321
289
self._baz._empty_merged_tag_bzr])
323
import_version('output2', pybaz.Version(self._baz._empty_merged_tag),
291
import_version('output2', pybaz.Version(self._baz._empty_merged_tag))
325
292
branch2 = Branch.open('output2')
326
293
repo2 = branch2.repository
327
294
# and import what we should be merged up against for checking with.
328
import_version('output3', pybaz.Version(self._baz._empty_tag), None)
295
import_version('output3', pybaz.Version(self._baz._empty_tag))
329
296
branch3 = Branch.open('output3')
331
298
self.assertEqual(branch.revision_history(), branch2.revision_history())
332
self.assertNotEqual(branch.revision_history(),
299
self.assertNotEqual(branch.revision_history(),
333
300
branch3.revision_history())
334
301
# check revisions in the history.
335
302
rev = repo.get_revision(self._baz._empty_merged_tag_bzr_base)
338
305
self.assertEqual(rev, rev2)
339
306
# and we should get some expected values:
340
307
self.assertEqual(rev.committer, "Test User<test@example.org>")
341
self.assertEqual(rev.message,
308
self.assertEqual(rev.message,
342
309
"tag of demo@DONOTUSE/c--import--0--base-0")
343
310
self.assertEqual(rev.revision_id, self._baz._empty_merged_tag_bzr_base)
344
311
self.assertEqual(['Arch-1:demo@DONOTUSE%c--import--0--base-0'],
357
324
self._baz._empty_merged_tag_bzr_base)
358
325
self.assertEqual(rev.parent_ids[1], self._baz._empty_tag_bzr)
360
# this tree should have nothing missing from that tree.
327
# this tree should have nothing missing from that tree.
361
328
# FIXME there is no code for this right now.
362
329
# self.assertEqual(branch.missing_revisions(branch3), [])
364
331
def test_merge_branch_with_merges(self):
365
import_version('output', pybaz.Version(self._baz._empty_merged_tag_2),
332
import_version('output', pybaz.Version(self._baz._empty_merged_tag_2))
367
333
# expected results:
368
# two commits, no files, revision identifiers of
334
# two commits, no files, revision identifiers of
369
335
# 'demo@DONOTUSE_c--import--0--base-0' and
370
336
# self._baz._empty_merged_tag_2_bzr_base
371
337
# self._baz._empty_merged_tag_2_bzr
378
344
self._baz._empty_merged_tag_2_bzr_base,
379
345
self._baz._empty_merged_tag_2_bzr])
381
import_version('output2', pybaz.Version(self._baz._empty_merged_tag_2),
347
import_version('output2', pybaz.Version(self._baz._empty_merged_tag_2))
383
348
branch2 = Branch.open('output2')
384
349
repo2 = branch2.repository
385
350
# and import what we should be merged up against for checking with.
386
import_version('output3', pybaz.Version(self._baz._empty_merged_tag),
351
import_version('output3', pybaz.Version(self._baz._empty_merged_tag))
388
352
branch3 = Branch.open('output3')
390
354
self.assertEqual(branch.revision_history(), branch2.revision_history())
391
self.assertNotEqual(branch.revision_history(),
355
self.assertNotEqual(branch.revision_history(),
392
356
branch3.revision_history())
393
357
# check revisions in the history.
394
358
rev = repo.get_revision(self._baz._empty_merged_tag_2_bzr_base)
397
361
self.assertEqual(rev, rev2)
398
362
# and we should get some expected values:
399
363
self.assertEqual(rev.committer, "Test User<test@example.org>")
400
self.assertEqual(rev.message,
364
self.assertEqual(rev.message,
401
365
"tag of demo@DONOTUSE/c--import--0--base-0")
402
self.assertEqual(rev.revision_id,
366
self.assertEqual(rev.revision_id,
403
367
self._baz._empty_merged_tag_2_bzr_base)
405
369
# check next revisions in the history.
416
380
self.assertEqual(rev.parent_ids[1],
417
381
self._baz._empty_merged_tag_bzr)
419
# this tree should have nothing missing from that tree.
383
# this tree should have nothing missing from that tree.
420
384
# FIXME there is no code for this right now.
421
385
# self.assertEqual(branch.missing_revisions(branch3), [])
423
387
def test_import_symlink(self):
424
import_version('output', pybaz.Version(self._baz._import_symlink),
388
import_version('output', pybaz.Version(self._baz._import_symlink))
426
389
# expected results:
427
# two commits, no files, revision identifier of
390
# one commit, no files, revision identifier of
428
391
# 'demo@DONOTUSE_c--import--0--base-0'
429
392
branch = Branch.open('output')
430
393
self.assertEqual(branch.revision_history(),
431
394
[self._baz._import_symlink_bzr])
432
395
rev = branch.repository.get_revision(self._baz._import_symlink_bzr)
434
import_version('output2', pybaz.Version(self._baz._import_symlink),
397
import_version('output2', pybaz.Version(self._baz._import_symlink))
436
398
branch2 = Branch.open('output2')
437
399
self.assertEqual(branch.revision_history(), branch2.revision_history())
438
400
rev2 = branch2.repository.get_revision(self._baz._import_symlink_bzr)
451
413
self.assertEqual(entry.kind, 'symlink')
452
414
self.assertEqual(entry.symlink_target, 'missing-file-name')
454
# Test kind change for import
455
import_version('output3', pybaz.Version(self._baz._import_symlink),
458
416
def test_missing_ancestor(self):
459
import_version('output', pybaz.Version(self._baz._missing_ancestor),
417
import_version('output', pybaz.Version(self._baz._missing_ancestor))
461
418
# expected results:
462
# one commits, no files, revision identifiers of
419
# one commits, no files, revision identifiers of
463
420
# 'demo@DONOTUSE_c--gone--0--base-0' and
464
421
# a merge of demo-gone@DONOTUSE%c--import--0
465
422
branch = Branch.open('output')
478
434
# and we should get some expected values:
479
435
self.assertEqual(rev.committer, "Test User<test@example.org>")
480
self.assertEqual(rev.message,
436
self.assertEqual(rev.message,
481
437
"tag of demo-gone@DONOTUSE/c--import--0--base-0")
482
438
self.assertEqual(rev.revision_id, self._baz._missing_ancestor_bzr)
483
439
self.assertEqual(rev.parent_ids[0], self._baz._missing_import_bzr)
484
440
self.assertEqual(1, len(rev.parent_ids))
486
442
# must NOT be able to get the merged evision
487
self.assertRaises(NoSuchRevision, branch.repository.get_revision,
443
self.assertRaises(NoSuchRevision, branch.repository.get_revision,
488
444
self._baz._missing_import_bzr)
490
446
def test_missing_ancestor_reusing_history(self):
491
447
import_version('output', pybaz.Version(self._baz._missing_ancestor),
493
448
reuse_history_from=[self._baz._missing_import_imported])
494
449
# expected results:
495
# one commits, no files, revision identifiers of
496
# 'demo-gone@DONOTUSE%c--import--0--base-0' and
450
# one commits, no files, revision identifiers of
451
# 'demo-gone@DONOTUSE%c--import--0--base-0' and
497
452
# 'demo@DONOTUSE%c--gone--0--base-0'
498
453
branch = Branch.open('output')
499
454
self.assertEqual(branch.revision_history(),
516
470
# and we should get some expected values:
517
471
self.assertEqual(rev.committer, "Test User<test@example.org>")
518
self.assertEqual(rev.message,
472
self.assertEqual(rev.message,
519
473
"tag of demo-gone@DONOTUSE/c--import--0--base-0")
520
474
self.assertEqual(rev.revision_id, self._baz._missing_ancestor_bzr)
521
475
self.assertEqual(rev.parent_ids[0], self._baz._missing_import_bzr)
522
476
self.assertEqual(1, len(rev.parent_ids))
524
478
def test_bad_file_id(self):
525
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
479
import_version('output', pybaz.Version(self._baz._bad_id_tag))
526
480
# expected results:
527
# three commits, one files, revision identifiers of
481
# three commits, one files, revision identifiers of
528
482
# 'demo@DONOTUSE_c--import--0--base-0' ,
529
483
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
530
484
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
539
493
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
541
495
def test_appending_revisions_already_present(self):
542
import_version('output', pybaz.Version(self._baz._bad_id_tag), None,
496
import_version('output', pybaz.Version(self._baz._bad_id_tag),
544
498
# expected results:
545
# three commits, one files, revision identifiers of
499
# three commits, one files, revision identifiers of
546
500
# 'demo@DONOTUSE_c--import--0--base-0' ,
547
501
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
548
502
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
569
523
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
571
525
def test_appending_revisions_all_already_present(self):
572
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
526
import_version('output', pybaz.Version(self._baz._bad_id_tag))
573
527
# expected results:
574
# three commits, one files, revision identifiers of
528
# three commits, one files, revision identifiers of
575
529
# 'demo@DONOTUSE_c--import--0--base-0' ,
576
530
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
577
531
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
599
553
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
601
555
def test_inbranch_conversion(self):
602
import_version('output', pybaz.Version(self._baz._inbranch_tag), None)
556
import_version('output', pybaz.Version(self._baz._inbranch_tag))
603
557
# expected results:
604
# three commits, no files, revision identifiers of
558
# three commits, no files, revision identifiers of
605
559
# 'demo@DONOTUSE_c--import--0--base-0' and
606
560
# self._baz._inbranch_tag_base_bzr
607
561
# self._baz._inbranch_tag_head_bzr
644
598
branch = bzrlib.bzrdir.BzrDir.create_branch_convenience(path)
645
import_version(path, pybaz.Version(self._baz._import), None)
599
import_version(path, pybaz.Version(self._baz._import))
646
600
# expected results:
647
# one commit, revision identifier of
601
# one commit, revision identifier of
648
602
# 'demo@DONOTUSE_c--import--0--base-0'
649
603
self.assertEqual(branch.revision_history(),
650
604
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
749
703
command = cmd_baz_import()
750
704
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
751
705
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output')))
752
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
706
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
754
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
708
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
755
709
'c1', '0.2','branch')))
756
default_format = repository.RepositoryFormat.get_default_format()
757
if getattr(default_format, 'rich_root_data', False):
761
710
walk_len = len(list(os.walk(os.path.join(self._tmpdir,'output'))))
762
self.assertEqual(num_files, walk_len)
711
self.assertEqual(20, walk_len)
764
713
def test_run_twice(self):
765
714
self.make_import('c--0')
766
715
command = cmd_baz_import()
767
716
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
768
717
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
770
719
def test_accepts_reuse_history(self):
771
720
self.make_import('c--0')
772
721
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
773
722
'demo@DONOTUSE', '.', '.')
775
def test_does_not_need_reuse_history(self):
776
self.make_import('c--0')
777
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
780
def test_does_not_need_reuse_history(self):
781
self.make_import('c--0')
782
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
785
def test_encoding_flag(self):
786
self.make_import('c--0')
787
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
789
self.assertEqual(['Arch-1:demo@DONOTUSE%c--0--base-0'],
790
Branch.open(os.path.join(self._tmpdir,
791
'output/c/+trunk')).revision_history())
792
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output2'),
793
'demo@DONOTUSE', '--encoding', 'utf-8')
794
self.assertEqual(['Arch-1-utf-8:demo@DONOTUSE%c--0--base-0'],
795
Branch.open(os.path.join(self._tmpdir,
796
'output2/c/+trunk')).revision_history())
797
self.run_bzr('baz-import-branch', os.path.join(self._tmpdir, 'output3'),
798
'demo@DONOTUSE/c--0')
799
self.assertEqual(['Arch-1:demo@DONOTUSE%c--0--base-0'],
800
Branch.open(os.path.join(self._tmpdir,
801
'output3')).revision_history())
802
self.run_bzr('baz-import-branch', os.path.join(self._tmpdir,
803
'output4'), 'demo@DONOTUSE/c--0', '--encoding', 'utf-8')
804
self.assertEqual(['Arch-1-utf-8:demo@DONOTUSE%c--0--base-0'],
805
Branch.open(os.path.join(self._tmpdir,
806
'output4')).revision_history())
724
def test_does_not_need_reuse_history(self):
725
self.make_import('c--0')
726
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),