241
162
TestCaseInTempDir.setUp(self)
242
163
ResourcedTestCase.setUpResources(self)
243
os.environ['HOME'] = self._baz._homedir
164
self.output = StringIO()
245
166
def tearDown(self):
246
167
ResourcedTestCase.tearDownResources(self)
247
168
TestCaseInTempDir.tearDown(self)
249
def test_import_utf8(self):
250
import_version('output', pybaz.Version(self._baz._utf8), None)
251
branch = Branch.open('output')
252
plain_revid = 'Arch-1:demo@DONOTUSE%c--utf8--0--base-0'
253
self.assertEqual([plain_revid], branch.revision_history())
254
self.assertEqual(u'I am importing now\ufffd\ufffd\ufffd',
255
branch.repository.get_revision(plain_revid).message)
256
import_version('output2', pybaz.Version(self._baz._utf8), 'utf-8')
257
branch2 = Branch.open('output2')
258
utf8_revid = 'Arch-1-utf-8:demo@DONOTUSE%c--utf8--0--base-0'
259
self.assertEqual([utf8_revid], branch2.revision_history())
260
self.assertEqual(u'I am importing now\u1234',
261
branch2.repository.get_revision(utf8_revid).message)
170
def collect(self, text):
171
self.output.write(text)
172
self.output.write("\n")
263
174
def test_import_empty(self):
264
import_version('output', pybaz.Version(self._baz._import), None)
175
import_version('output', pybaz.Version(self._baz._import), self.collect)
265
176
# expected results:
266
# one commit, no files, revision identifier of
267
# 'demo@DONOTUSE_c--import--0--base-0'
268
branch = Branch.open('output')
269
repo = branch.repository
177
# one commit, no files, revision identifier of 'demo@DONOTUSE_c--import--0--base-0'
178
branch = find_branch('output', find_root=False)
270
179
self.assertEqual(branch.revision_history(),
271
180
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
272
rev = repo.get_revision('Arch-1:demo@DONOTUSE%c--import--0--base-0')
181
rev = branch.get_revision('Arch-1:demo@DONOTUSE%c--import--0--base-0')
274
183
import_version('output2', pybaz.Version('demo@DONOTUSE/c--import--0'),
276
branch2 = Branch.open('output2')
277
repo2 = branch2.repository
185
branch2 = find_branch('output2', find_root=False)
278
186
self.assertEqual(branch.revision_history(), branch2.revision_history())
279
rev2 = repo2.get_revision('Arch-1:demo@DONOTUSE%c--import--0--base-0')
187
rev2 = branch2.get_revision('Arch-1:demo@DONOTUSE%c--import--0--base-0')
280
188
# they must be the same
281
189
self.assertEqual(rev, rev2)
287
195
"Arch-1:demo@DONOTUSE%c--import--0--base-0")
289
197
def test_empty_tagged(self):
290
import_version('output', pybaz.Version(self._baz._empty_tag), None)
198
import_version('output', pybaz.Version(self._baz._empty_tag),
291
200
# expected results:
292
201
# two commits, no files, revision identifiers of
293
202
# 'demo@DONOTUSE_c--import--0--base-0' and
294
203
# self._baz._empty_tag_bzr
295
branch = Branch.open('output')
204
branch = find_branch('output', find_root=False)
296
205
self.assertEqual(branch.revision_history(),
297
206
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
298
207
self._baz._empty_tag_bzr])
299
rev = branch.repository.get_revision(self._baz._empty_tag_bzr)
208
rev = branch.get_revision(self._baz._empty_tag_bzr)
301
import_version('output2', pybaz.Version(self._baz._empty_tag), None)
302
branch2 = Branch.open('output2')
210
import_version('output2', pybaz.Version(self._baz._empty_tag),
212
branch2 = find_branch('output2', find_root=False)
303
213
self.assertEqual(branch.revision_history(), branch2.revision_history())
304
rev2 = branch2.repository.get_revision(self._baz._empty_tag_bzr)
214
rev2 = branch2.get_revision(self._baz._empty_tag_bzr)
305
215
# they must be the same
306
216
self.assertEqual(rev, rev2)
308
218
# and we should get some expected values:
309
219
self.assertEqual(rev.committer, "Test User<test@example.org>")
310
self.assertEqual(rev.message,
311
"tag of demo@DONOTUSE/c--import--0--base-0")
220
self.assertEqual(rev.message, "tag of demo@DONOTUSE/c--import--0--base-0")
312
221
self.assertEqual(rev.revision_id, self._baz._empty_tag_bzr)
314
223
def test_empty_merged_tagged(self):
315
import_version('output', pybaz.Version(self._baz._empty_merged_tag),
224
import_version('output', pybaz.Version(self._baz._empty_merged_tag),
317
226
# expected results:
318
227
# two commits, no files, revision identifiers of
319
228
# 'demo@DONOTUSE_c--import--0--base-0' and
321
230
# self._baz._empty_merged_tag_bzr
322
231
# and a merged revision from the latter of
323
232
# self._baz._empty_tag_bzr
324
branch = Branch.open('output')
325
repo = branch.repository
233
branch = find_branch('output', find_root=False)
326
234
self.assertEqual(branch.revision_history(),
327
235
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
328
236
self._baz._empty_merged_tag_bzr_base,
329
237
self._baz._empty_merged_tag_bzr])
331
import_version('output2', pybaz.Version(self._baz._empty_merged_tag),
333
branch2 = Branch.open('output2')
334
repo2 = branch2.repository
239
import_version('output2', pybaz.Version(self._baz._empty_merged_tag),
241
branch2 = find_branch('output2', find_root=False)
335
242
# and import what we should be merged up against for checking with.
336
import_version('output3', pybaz.Version(self._baz._empty_tag), None)
337
branch3 = Branch.open('output3')
243
import_version('output3', pybaz.Version(self._baz._empty_tag),
245
branch3 = find_branch('output3', find_root=False)
339
247
self.assertEqual(branch.revision_history(), branch2.revision_history())
340
self.assertNotEqual(branch.revision_history(),
341
branch3.revision_history())
248
self.assertNotEqual(branch.revision_history(), branch3.revision_history())
342
249
# check revisions in the history.
343
rev = repo.get_revision(self._baz._empty_merged_tag_bzr_base)
344
rev2 = repo2.get_revision(self._baz._empty_merged_tag_bzr_base)
250
rev = branch.get_revision(self._baz._empty_merged_tag_bzr_base)
251
rev2 = branch2.get_revision(self._baz._empty_merged_tag_bzr_base)
345
252
# they must be the same
346
253
self.assertEqual(rev, rev2)
347
254
# and we should get some expected values:
348
255
self.assertEqual(rev.committer, "Test User<test@example.org>")
349
self.assertEqual(rev.message,
350
"tag of demo@DONOTUSE/c--import--0--base-0")
256
self.assertEqual(rev.message, "tag of demo@DONOTUSE/c--import--0--base-0")
351
257
self.assertEqual(rev.revision_id, self._baz._empty_merged_tag_bzr_base)
352
self.assertEqual(['Arch-1:demo@DONOTUSE%c--import--0--base-0'],
355
259
# check next revisions in the history.
356
rev = repo.get_revision(self._baz._empty_merged_tag_bzr)
357
rev2 = repo2.get_revision(self._baz._empty_merged_tag_bzr)
260
rev = branch.get_revision(self._baz._empty_merged_tag_bzr)
261
rev2 = branch2.get_revision(self._baz._empty_merged_tag_bzr)
358
262
# they must be the same
359
263
self.assertEqual(rev, rev2)
360
264
# and we should get some expected values:
361
265
self.assertEqual(rev.committer, "Test User<test@example.org>")
362
266
self.assertEqual(rev.message, "did a merge, yarh")
363
267
self.assertEqual(rev.revision_id, self._baz._empty_merged_tag_bzr)
364
self.assertEqual(rev.parent_ids[0],
268
self.assertEqual(rev.parents[0].revision_id,
365
269
self._baz._empty_merged_tag_bzr_base)
366
self.assertEqual(rev.parent_ids[1], self._baz._empty_tag_bzr)
270
self.assertEqual(rev.parents[1].revision_id,
271
self._baz._empty_tag_bzr)
368
273
# this tree should have nothing missing from that tree.
369
274
# FIXME there is no code for this right now.
370
275
# self.assertEqual(branch.missing_revisions(branch3), [])
372
277
def test_merge_branch_with_merges(self):
373
import_version('output', pybaz.Version(self._baz._empty_merged_tag_2),
278
import_version('output', pybaz.Version(self._baz._empty_merged_tag_2),
375
280
# expected results:
376
281
# two commits, no files, revision identifiers of
377
282
# 'demo@DONOTUSE_c--import--0--base-0' and
379
284
# self._baz._empty_merged_tag_2_bzr
380
285
# and a merged revision from the latter of
381
286
# self._baz._empty_merged_tag_bzr
382
branch = Branch.open('output')
383
repo = branch.repository
287
branch = find_branch('output', find_root=False)
384
288
self.assertEqual(branch.revision_history(),
385
289
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
386
290
self._baz._empty_merged_tag_2_bzr_base,
387
291
self._baz._empty_merged_tag_2_bzr])
389
293
import_version('output2', pybaz.Version(self._baz._empty_merged_tag_2),
391
branch2 = Branch.open('output2')
392
repo2 = branch2.repository
295
branch2 = find_branch('output2', find_root=False)
393
296
# and import what we should be merged up against for checking with.
394
297
import_version('output3', pybaz.Version(self._baz._empty_merged_tag),
396
branch3 = Branch.open('output3')
299
branch3 = find_branch('output3', find_root=False)
398
301
self.assertEqual(branch.revision_history(), branch2.revision_history())
399
self.assertNotEqual(branch.revision_history(),
400
branch3.revision_history())
302
self.assertNotEqual(branch.revision_history(), branch3.revision_history())
401
303
# check revisions in the history.
402
rev = repo.get_revision(self._baz._empty_merged_tag_2_bzr_base)
403
rev2 = repo2.get_revision(self._baz._empty_merged_tag_2_bzr_base)
304
rev = branch.get_revision(self._baz._empty_merged_tag_2_bzr_base)
305
rev2 = branch2.get_revision(self._baz._empty_merged_tag_2_bzr_base)
404
306
# they must be the same
405
307
self.assertEqual(rev, rev2)
406
308
# and we should get some expected values:
407
309
self.assertEqual(rev.committer, "Test User<test@example.org>")
408
self.assertEqual(rev.message,
409
"tag of demo@DONOTUSE/c--import--0--base-0")
410
self.assertEqual(rev.revision_id,
411
self._baz._empty_merged_tag_2_bzr_base)
310
self.assertEqual(rev.message, "tag of demo@DONOTUSE/c--import--0--base-0")
311
self.assertEqual(rev.revision_id, self._baz._empty_merged_tag_2_bzr_base)
413
313
# check next revisions in the history.
414
rev = repo.get_revision(self._baz._empty_merged_tag_2_bzr)
415
rev2 = repo2.get_revision(self._baz._empty_merged_tag_2_bzr)
314
rev = branch.get_revision(self._baz._empty_merged_tag_2_bzr)
315
rev2 = branch2.get_revision(self._baz._empty_merged_tag_2_bzr)
416
316
# they must be the same
417
317
self.assertEqual(rev, rev2)
418
318
# and we should get some expected values:
419
319
self.assertEqual(rev.committer, "Test User<test@example.org>")
420
320
self.assertEqual(rev.message, "merge in a merged tree.")
421
321
self.assertEqual(rev.revision_id, self._baz._empty_merged_tag_2_bzr)
422
self.assertEqual(rev.parent_ids[0],
322
self.assertEqual(rev.parents[0].revision_id,
423
323
self._baz._empty_merged_tag_2_bzr_base)
424
self.assertEqual(rev.parent_ids[1],
324
self.assertEqual(rev.parents[1].revision_id,
425
325
self._baz._empty_merged_tag_bzr)
427
327
# this tree should have nothing missing from that tree.
453
352
self.assertEqual(rev.revision_id, self._baz._import_symlink_bzr)
455
354
# and we want the symlink alink with target 'missing-file-name'
456
inv = branch.repository.get_inventory(rev.revision_id)
355
inv = branch.get_inventory(rev.inventory_id)
457
356
self.assertEqual(inv.path2id('alink'), 'x_symlink_tag')
458
357
entry = inv['x_symlink_tag']
459
358
self.assertEqual(entry.kind, 'symlink')
460
359
self.assertEqual(entry.symlink_target, 'missing-file-name')
462
# current bzr doesn't handle type changes
463
self.assertRaises(AssertionError, import_version, 'output3',
464
pybaz.Version(self._baz._import_symlink), None)
466
361
def test_missing_ancestor(self):
467
362
import_version('output', pybaz.Version(self._baz._missing_ancestor),
469
364
# expected results:
470
365
# one commits, no files, revision identifiers of
471
366
# 'demo@DONOTUSE_c--gone--0--base-0' and
472
367
# a merge of demo-gone@DONOTUSE%c--import--0
473
branch = Branch.open('output')
368
branch = find_branch('output', find_root=False)
474
369
self.assertEqual(branch.revision_history(),
475
370
[self._baz._missing_ancestor_bzr])
476
rev = branch.repository.get_revision(self._baz._missing_ancestor_bzr)
371
rev = branch.get_revision(self._baz._missing_ancestor_bzr)
478
import_version('output2', pybaz.Version(self._baz._missing_ancestor),
480
branch2 = Branch.open('output2')
373
import_version('output2', pybaz.Version(self._baz._missing_ancestor),
375
branch2 = find_branch('output2', find_root=False)
481
376
self.assertEqual(branch.revision_history(), branch2.revision_history())
482
rev2 = branch2.repository.get_revision(self._baz._missing_ancestor_bzr)
377
rev2 = branch2.get_revision(self._baz._missing_ancestor_bzr)
483
378
# they must be the same
484
379
self.assertEqual(rev, rev2)
486
381
# and we should get some expected values:
487
382
self.assertEqual(rev.committer, "Test User<test@example.org>")
488
self.assertEqual(rev.message,
489
"tag of demo-gone@DONOTUSE/c--import--0--base-0")
383
self.assertEqual(rev.message, "tag of demo-gone@DONOTUSE/c--import--0--base-0")
490
384
self.assertEqual(rev.revision_id, self._baz._missing_ancestor_bzr)
491
self.assertEqual(rev.parent_ids[0], self._baz._missing_import_bzr)
492
self.assertEqual(1, len(rev.parent_ids))
385
self.assertEqual(rev.parents[0].revision_id,
386
self._baz._missing_import_bzr)
387
self.assertEqual(1, len(rev.parents))
494
389
# must NOT be able to get the merged evision
495
self.assertRaises(NoSuchRevision, branch.repository.get_revision,
390
self.assertRaises(NoSuchRevision, branch.get_revision,
496
391
self._baz._missing_import_bzr)
498
def test_missing_ancestor_reusing_history(self):
499
import_version('output', pybaz.Version(self._baz._missing_ancestor),
501
reuse_history_from=[self._baz._missing_import_imported])
503
# one commits, no files, revision identifiers of
504
# 'demo-gone@DONOTUSE%c--import--0--base-0' and
505
# 'demo@DONOTUSE%c--gone--0--base-0'
506
branch = Branch.open('output')
507
self.assertEqual(branch.revision_history(),
508
[self._baz._missing_import_bzr,
509
self._baz._missing_ancestor_bzr])
510
rev = branch.repository.get_revision(self._baz._missing_ancestor_bzr)
512
import_version('output2', pybaz.Version(self._baz._missing_ancestor),
514
reuse_history_from=[self._baz._missing_import_imported])
515
branch2 = Branch.open('output2')
516
self.assertEqual(branch.revision_history(), branch2.revision_history())
517
rev2 = branch2.repository.get_revision(self._baz._missing_ancestor_bzr)
518
# they must be the same
519
self.assertEqual(rev, rev2)
521
# must be able to get the missing base revision
522
branch.repository.get_revision(self._baz._missing_import_bzr)
524
# and we should get some expected values:
525
self.assertEqual(rev.committer, "Test User<test@example.org>")
526
self.assertEqual(rev.message,
527
"tag of demo-gone@DONOTUSE/c--import--0--base-0")
528
self.assertEqual(rev.revision_id, self._baz._missing_ancestor_bzr)
529
self.assertEqual(rev.parent_ids[0], self._baz._missing_import_bzr)
530
self.assertEqual(1, len(rev.parent_ids))
532
def test_bad_file_id(self):
533
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
535
# three commits, one files, revision identifiers of
536
# 'demo@DONOTUSE_c--import--0--base-0' ,
537
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
538
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
539
branch = Branch.open('output')
540
self.assertEqual(branch.revision_history(),
541
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
542
self._baz._bad_id_tag_bzr_base,
543
self._baz._bad_id_tag_bzr])
544
rev = branch.repository.get_revision(self._baz._bad_id_tag_bzr)
545
inv = branch.repository.get_inventory(self._baz._bad_id_tag_bzr)
546
self.assertEqual(inv.path2id('path'), 'x_this_id%2fneeds%25escaping')
547
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
549
def test_appending_revisions_already_present(self):
550
import_version('output', pybaz.Version(self._baz._bad_id_tag), None,
553
# three commits, one files, revision identifiers of
554
# 'demo@DONOTUSE_c--import--0--base-0' ,
555
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
556
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
557
branch = Branch.open('output')
558
self.assertEqual(branch.revision_history(),
559
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
560
self._baz._bad_id_tag_bzr_base])
561
branch.set_revision_history(
562
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
564
branch = Branch.open('output')
565
self.assertEqual(branch.revision_history(),
566
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
568
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
569
branch = Branch.open('output')
570
self.assertEqual(branch.revision_history(),
571
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
572
self._baz._bad_id_tag_bzr_base,
573
self._baz._bad_id_tag_bzr])
574
rev = branch.repository.get_revision(self._baz._bad_id_tag_bzr)
575
inv = branch.repository.get_inventory(self._baz._bad_id_tag_bzr)
576
self.assertEqual(inv.path2id('path'), 'x_this_id%2fneeds%25escaping')
577
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
579
def test_appending_revisions_all_already_present(self):
580
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
582
# three commits, one files, revision identifiers of
583
# 'demo@DONOTUSE_c--import--0--base-0' ,
584
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
585
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
586
branch = Branch.open('output')
587
self.assertEqual(branch.revision_history(),
588
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
589
self._baz._bad_id_tag_bzr_base,
590
self._baz._bad_id_tag_bzr])
591
branch.set_revision_history(
592
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
594
branch = Branch.open('output')
595
self.assertEqual(branch.revision_history(),
596
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
598
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
599
branch = Branch.open('output')
600
self.assertEqual(branch.revision_history(),
601
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
602
self._baz._bad_id_tag_bzr_base,
603
self._baz._bad_id_tag_bzr])
604
rev = branch.repository.get_revision(self._baz._bad_id_tag_bzr)
605
inv = branch.repository.get_inventory(self._baz._bad_id_tag_bzr)
606
self.assertEqual(inv.path2id('path'), 'x_this_id%2fneeds%25escaping')
607
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
609
def test_inbranch_conversion(self):
610
import_version('output', pybaz.Version(self._baz._inbranch_tag), None)
612
# three commits, no files, revision identifiers of
613
# 'demo@DONOTUSE_c--import--0--base-0' and
614
# self._baz._inbranch_tag_base_bzr
615
# self._baz._inbranch_tag_head_bzr
617
branch = Branch.open('output')
618
self.assertEqual(branch.revision_history(),
619
['Arch-1:demo@DONOTUSE%c--import--0--base-0',
620
self._baz._inbranch_tag_base_bzr,
621
self._baz._inbranch_tag_head_bzr])
623
import_version('output2', pybaz.Version(self._baz._inbranch_tag), None)
624
branch2 = Branch.open('output2')
626
self.assertEqual(branch.revision_history(), branch2.revision_history())
627
# check revisions in the history.
628
rev = branch.repository.get_revision(self._baz._inbranch_tag_base_bzr)
629
rev2 = branch2.repository.get_revision(self._baz._inbranch_tag_base_bzr)
630
# they must be the same
631
self.assertEqual(rev, rev2)
632
# and we should get some expected values:
633
self.assertEqual(rev.committer, "Test User<test@example.org>")
634
self.assertEqual(rev.message, "tag of demo@DONOTUSE/c--import--0--base-0")
635
self.assertEqual(rev.revision_id, self._baz._inbranch_tag_base_bzr)
637
# check next revisions in the history.
638
rev = branch.repository.get_revision(self._baz._inbranch_tag_head_bzr)
639
rev2 = branch2.repository.get_revision(self._baz._inbranch_tag_head_bzr)
640
# they must be the same
641
self.assertEqual(rev, rev2)
642
# and we should get some expected values:
643
self.assertEqual(rev.committer, "Test User<test@example.org>")
644
self.assertEqual(rev.message, "tag of demo@DONOTUSE/c--inbranch-tag--0--base-0")
645
self.assertEqual(rev.revision_id, self._baz._inbranch_tag_head_bzr)
646
self.assertEqual(rev.parent_ids,
647
[self._baz._inbranch_tag_base_bzr])
649
def test_no_commits_same_as_missing(self):
652
branch = bzrlib.bzrdir.BzrDir.create_branch_convenience(path)
653
import_version(path, pybaz.Version(self._baz._import), None)
655
# one commit, revision identifier of
656
# 'demo@DONOTUSE_c--import--0--base-0'
657
self.assertEqual(branch.revision_history(),
658
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
661
394
class TestNamespacePrevious(TestCase):
757
482
command = cmd_baz_import()
758
483
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
759
484
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output')))
760
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
762
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
763
'c1', '0.2','branch')))
764
default_format = repository.RepositoryFormat.get_default_format()
765
if getattr(default_format, 'rich_root_data', False):
769
walk_len = len(list(os.walk(os.path.join(self._tmpdir,'output'))))
770
self.assertEqual(num_files, walk_len)
485
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output', 'c','+trunk')))
486
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output', 'c1', '0.2','branch')))
488
len(list(os.walk(os.path.join(self._tmpdir,'output')))))
772
490
def test_run_twice(self):
773
491
self.make_import('c--0')
774
492
command = cmd_baz_import()
775
493
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
776
494
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
778
def test_accepts_reuse_history(self):
779
self.make_import('c--0')
780
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
781
'demo@DONOTUSE', '.', '.')
783
def test_does_not_need_reuse_history(self):
784
self.make_import('c--0')
785
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
788
def test_does_not_need_reuse_history(self):
789
self.make_import('c--0')
790
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
793
def test_encoding_flag(self):
794
self.make_import('c--0')
795
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
797
self.assertEqual(['Arch-1:demo@DONOTUSE%c--0--base-0'],
798
Branch.open(os.path.join(self._tmpdir,
799
'output/c/+trunk')).revision_history())
800
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output2'),
801
'demo@DONOTUSE', '--encoding', 'utf-8')
802
self.assertEqual(['Arch-1-utf-8:demo@DONOTUSE%c--0--base-0'],
803
Branch.open(os.path.join(self._tmpdir,
804
'output2/c/+trunk')).revision_history())
805
self.run_bzr('baz-import-branch', os.path.join(self._tmpdir, 'output3'),
806
'demo@DONOTUSE/c--0')
807
self.assertEqual(['Arch-1:demo@DONOTUSE%c--0--base-0'],
808
Branch.open(os.path.join(self._tmpdir,
809
'output3')).revision_history())
810
self.run_bzr('baz-import-branch', os.path.join(self._tmpdir,
811
'output4'), 'demo@DONOTUSE/c--0', '--encoding', 'utf-8')
812
self.assertEqual(['Arch-1-utf-8:demo@DONOTUSE%c--0--base-0'],
813
Branch.open(os.path.join(self._tmpdir,
814
'output4')).revision_history())