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,
34
from bzrlib.errors import NoSuchRevision
32
36
from StringIO import StringIO
34
38
from testresources import (TestResource, TestLoader, OptimisingTestSuite,
38
from bzrlib.errors import NoSuchRevision
39
from bzrlib.plugins.bzrtools.fai import namespace_previous
42
from bzrtools.fai import namespace_previous
44
from bzrlib.plugins.bzrtools.fai import namespace_previous
40
45
from bzrlib.branch import Branch
64
69
pybaz.set_my_id("Test User<test@example.org>")
66
71
self.make_empty_import()
69
73
self._empty_tag = 'demo@DONOTUSE/c--empty-tag--0'
70
self._empty_tag_bzr = revision_id(self._empty_tag + '--base-0', None)
74
self._empty_tag_bzr = revision_id(self._empty_tag + '--base-0')
71
75
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
72
76
pybaz.Version(self._empty_tag))
74
78
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
79
self._empty_merged_tag_bzr_base = revision_id(self._empty_merged_tag
81
self._empty_merged_tag_bzr = revision_id(self._empty_merged_tag
79
83
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
80
84
pybaz.Version(self._empty_merged_tag))
81
85
tree = pybaz.Revision(self._empty_merged_tag + '--base-0').get(
86
90
msg["summary"]="did a merge, yarh"
88
92
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
90
94
# tree, two commits, includes merge of other branch
91
95
self._empty_merged_tag_2 = 'demo@DONOTUSE/c--empty-tag-2--0'
92
96
self._empty_merged_tag_2_bzr_base = revision_id(
93
self._empty_merged_tag_2 + '--base-0', None)
97
self._empty_merged_tag_2 + '--base-0')
94
98
self._empty_merged_tag_2_bzr = revision_id(
95
self._empty_merged_tag_2 + '--patch-1', None)
99
self._empty_merged_tag_2 + '--patch-1')
96
100
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
97
101
pybaz.Version(self._empty_merged_tag_2))
98
102
tree = pybaz.Revision(self._empty_merged_tag_2 + '--base-0').get (
105
109
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
107
111
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',
112
self._bad_id_tag_bzr_base = revision_id(self._bad_id_tag + '--base-0')
113
self._bad_id_tag_bzr = revision_id(self._bad_id_tag + '--patch-1')
112
114
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
113
115
pybaz.Version(self._bad_id_tag))
114
116
tree = pybaz.Revision(self._bad_id_tag + '--base-0').get(
115
117
os.path.join(self._tmpdir, 'tree'))
116
118
from bzrlib.plugins.bzrtools.baz_import import add_file
117
add_file(os.path.join(self._tmpdir,'tree/path'), 'text',
119
add_file(os.path.join(self._tmpdir,'tree/path'), 'text',
118
120
'this_id/needs%escaping')
119
121
msg = tree.log_message()
120
122
msg["summary"] = "commit something which needs escaping."
128
130
def make_import_symlink(self):
129
131
self._import_symlink = 'demo@DONOTUSE/c--import-symlink--0'
130
132
self._import_symlink_bzr = revision_id(
131
self._import_symlink + '--base-0', None)
133
self._import_symlink + '--base-0')
132
134
os.mkdir(os.path.join(self._tmpdir, 'tree'))
133
135
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
134
136
self._import_symlink)
135
link_path = os.path.join(self._tmpdir, 'tree', 'alink')
136
os.symlink('missing-file-name', link_path)
137
os.symlink('missing-file-name',
138
os.path.join(self._tmpdir, 'tree', 'alink'))
137
139
tree.add_tag('alink')
138
140
id_file = open(os.path.join(tree, '.arch-ids', 'alink.id'), 'w')
139
141
id_file.write('symlink_tag\n')
141
143
msg = tree.log_message()
142
144
msg["summary"] = "Import with a symlink"
143
145
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
146
shutil.rmtree(os.path.join(self._tmpdir, 'tree'))
153
148
def make_empty_import(self):
154
149
self._import = 'demo@DONOTUSE/c--import--0'
155
150
os.mkdir(os.path.join(self._tmpdir, 'tree'))
156
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
151
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
158
153
msg = tree.log_message()
159
154
msg["summary"] = "I am importing now"
160
155
tree.import_(msg)
161
156
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
158
def make_missing_ancestor(self):
174
159
self._archivegoneroot = os.path.join(self._tmpdir, 'archivegone')
175
160
self._archive = make_archive('demo-gone@DONOTUSE',
176
161
str(self._archivegoneroot))
177
162
self._missing_import = 'demo-gone@DONOTUSE/c--import--0'
178
self._missing_import_bzr = revision_id(self._missing_import
163
self._missing_import_bzr = revision_id(self._missing_import
180
165
self._missing_ancestor = 'demo@DONOTUSE/c--gone--0'
181
self._missing_ancestor_bzr = revision_id(self._missing_ancestor
166
self._missing_ancestor_bzr = revision_id(self._missing_ancestor
183
168
os.mkdir(os.path.join(self._tmpdir, 'tree'))
184
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
169
tree = pybaz.init_tree(os.path.join(self._tmpdir, 'tree'),
185
170
self._missing_import)
186
171
msg = tree.log_message()
187
172
msg["summary"] = "I am importing now"
192
177
pybaz.Version(self._missing_ancestor))
194
179
# make an import for testing history-reuse logic.
195
182
# note the use of a namespace layout here.
196
self._missing_import_imported = os.path.join(self._tmpdir,
183
self._missing_import_imported = os.path.join(self._tmpdir,
197
184
'archivegone-bzr')
198
185
os.mkdir(os.path.join(self._tmpdir, 'archivegone-bzr'))
199
186
os.mkdir(os.path.join(self._tmpdir, 'archivegone-bzr', 'c'))
200
import_version(os.path.join(self._tmpdir, 'archivegone-bzr',
187
import_version(os.path.join(self._tmpdir, 'archivegone-bzr',
202
pybaz.Version(self._missing_import), None)
189
pybaz.Version(self._missing_import),
203
191
# and make it inaccessible
204
192
pybaz.Archive('demo-gone@DONOTUSE').unregister()
206
194
def make_inbranch_continuation(self):
207
195
self._inbranch_tag = 'demo@DONOTUSE/c--inbranch-tag--0'
208
196
self._inbranch_tag_base = self._inbranch_tag + '--base-0'
209
self._inbranch_tag_base_bzr = revision_id(self._inbranch_tag_base,
197
self._inbranch_tag_base_bzr = revision_id(self._inbranch_tag_base)
211
198
pybaz.Revision('demo@DONOTUSE/c--import--0--base-0').make_continuation(
212
199
pybaz.Version(self._inbranch_tag))
213
200
self._inbranch_tag_head = self._inbranch_tag + '--patch-1'
214
self._inbranch_tag_head_bzr = revision_id(self._inbranch_tag_head,
201
self._inbranch_tag_head_bzr = revision_id(self._inbranch_tag_head)
216
202
pybaz.Revision(self._inbranch_tag_base).make_continuation(
217
203
pybaz.Version(self._inbranch_tag))
233
219
TestCaseInTempDir.setUp(self)
234
220
ResourcedTestCase.setUpResources(self)
235
221
os.environ['HOME'] = self._baz._homedir
222
self.output = StringIO()
237
224
def tearDown(self):
238
225
ResourcedTestCase.tearDownResources(self)
239
226
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)
228
def collect(self, text):
229
self.output.write(text)
230
self.output.write("\n")
255
232
def test_import_empty(self):
256
import_version('output', pybaz.Version(self._baz._import), None)
233
import_version('output', pybaz.Version(self._baz._import),
257
235
# expected results:
258
# one commit, no files, revision identifier of
236
# one commit, no files, revision identifier of
259
237
# 'demo@DONOTUSE_c--import--0--base-0'
260
238
branch = Branch.open('output')
261
239
repo = branch.repository
279
257
"Arch-1:demo@DONOTUSE%c--import--0--base-0")
281
259
def test_empty_tagged(self):
282
import_version('output', pybaz.Version(self._baz._empty_tag), None)
260
import_version('output', pybaz.Version(self._baz._empty_tag),
283
262
# expected results:
284
# two commits, no files, revision identifiers of
263
# two commits, no files, revision identifiers of
285
264
# 'demo@DONOTUSE_c--import--0--base-0' and
286
265
# self._baz._empty_tag_bzr
287
266
branch = Branch.open('output')
300
280
# and we should get some expected values:
301
281
self.assertEqual(rev.committer, "Test User<test@example.org>")
302
self.assertEqual(rev.message,
282
self.assertEqual(rev.message,
303
283
"tag of demo@DONOTUSE/c--import--0--base-0")
304
284
self.assertEqual(rev.revision_id, self._baz._empty_tag_bzr)
306
286
def test_empty_merged_tagged(self):
307
287
import_version('output', pybaz.Version(self._baz._empty_merged_tag),
309
289
# expected results:
310
# two commits, no files, revision identifiers of
290
# two commits, no files, revision identifiers of
311
291
# 'demo@DONOTUSE_c--import--0--base-0' and
312
292
# self._baz._empty_merged_tag_bzr_base
313
293
# self._baz._empty_merged_tag_bzr
321
301
self._baz._empty_merged_tag_bzr])
323
303
import_version('output2', pybaz.Version(self._baz._empty_merged_tag),
325
305
branch2 = Branch.open('output2')
326
306
repo2 = branch2.repository
327
307
# and import what we should be merged up against for checking with.
328
import_version('output3', pybaz.Version(self._baz._empty_tag), None)
308
import_version('output3', pybaz.Version(self._baz._empty_tag),
329
310
branch3 = Branch.open('output3')
331
312
self.assertEqual(branch.revision_history(), branch2.revision_history())
332
self.assertNotEqual(branch.revision_history(),
313
self.assertNotEqual(branch.revision_history(),
333
314
branch3.revision_history())
334
315
# check revisions in the history.
335
316
rev = repo.get_revision(self._baz._empty_merged_tag_bzr_base)
338
319
self.assertEqual(rev, rev2)
339
320
# and we should get some expected values:
340
321
self.assertEqual(rev.committer, "Test User<test@example.org>")
341
self.assertEqual(rev.message,
322
self.assertEqual(rev.message,
342
323
"tag of demo@DONOTUSE/c--import--0--base-0")
343
324
self.assertEqual(rev.revision_id, self._baz._empty_merged_tag_bzr_base)
344
325
self.assertEqual(['Arch-1:demo@DONOTUSE%c--import--0--base-0'],
357
338
self._baz._empty_merged_tag_bzr_base)
358
339
self.assertEqual(rev.parent_ids[1], self._baz._empty_tag_bzr)
360
# this tree should have nothing missing from that tree.
341
# this tree should have nothing missing from that tree.
361
342
# FIXME there is no code for this right now.
362
343
# self.assertEqual(branch.missing_revisions(branch3), [])
364
345
def test_merge_branch_with_merges(self):
365
346
import_version('output', pybaz.Version(self._baz._empty_merged_tag_2),
367
348
# expected results:
368
# two commits, no files, revision identifiers of
349
# two commits, no files, revision identifiers of
369
350
# 'demo@DONOTUSE_c--import--0--base-0' and
370
351
# self._baz._empty_merged_tag_2_bzr_base
371
352
# self._baz._empty_merged_tag_2_bzr
379
360
self._baz._empty_merged_tag_2_bzr])
381
362
import_version('output2', pybaz.Version(self._baz._empty_merged_tag_2),
383
364
branch2 = Branch.open('output2')
384
365
repo2 = branch2.repository
385
366
# and import what we should be merged up against for checking with.
386
367
import_version('output3', pybaz.Version(self._baz._empty_merged_tag),
388
369
branch3 = Branch.open('output3')
390
371
self.assertEqual(branch.revision_history(), branch2.revision_history())
391
self.assertNotEqual(branch.revision_history(),
372
self.assertNotEqual(branch.revision_history(),
392
373
branch3.revision_history())
393
374
# check revisions in the history.
394
375
rev = repo.get_revision(self._baz._empty_merged_tag_2_bzr_base)
397
378
self.assertEqual(rev, rev2)
398
379
# and we should get some expected values:
399
380
self.assertEqual(rev.committer, "Test User<test@example.org>")
400
self.assertEqual(rev.message,
381
self.assertEqual(rev.message,
401
382
"tag of demo@DONOTUSE/c--import--0--base-0")
402
self.assertEqual(rev.revision_id,
383
self.assertEqual(rev.revision_id,
403
384
self._baz._empty_merged_tag_2_bzr_base)
405
386
# check next revisions in the history.
416
397
self.assertEqual(rev.parent_ids[1],
417
398
self._baz._empty_merged_tag_bzr)
419
# this tree should have nothing missing from that tree.
400
# this tree should have nothing missing from that tree.
420
401
# FIXME there is no code for this right now.
421
402
# self.assertEqual(branch.missing_revisions(branch3), [])
423
404
def test_import_symlink(self):
424
405
import_version('output', pybaz.Version(self._baz._import_symlink),
426
407
# expected results:
427
# two commits, no files, revision identifier of
408
# one commit, no files, revision identifier of
428
409
# 'demo@DONOTUSE_c--import--0--base-0'
429
410
branch = Branch.open('output')
430
411
self.assertEqual(branch.revision_history(),
451
432
self.assertEqual(entry.kind, 'symlink')
452
433
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
435
def test_missing_ancestor(self):
459
436
import_version('output', pybaz.Version(self._baz._missing_ancestor),
461
438
# expected results:
462
# one commits, no files, revision identifiers of
439
# one commits, no files, revision identifiers of
463
440
# 'demo@DONOTUSE_c--gone--0--base-0' and
464
441
# a merge of demo-gone@DONOTUSE%c--import--0
465
442
branch = Branch.open('output')
478
455
# and we should get some expected values:
479
456
self.assertEqual(rev.committer, "Test User<test@example.org>")
480
self.assertEqual(rev.message,
457
self.assertEqual(rev.message,
481
458
"tag of demo-gone@DONOTUSE/c--import--0--base-0")
482
459
self.assertEqual(rev.revision_id, self._baz._missing_ancestor_bzr)
483
460
self.assertEqual(rev.parent_ids[0], self._baz._missing_import_bzr)
484
461
self.assertEqual(1, len(rev.parent_ids))
486
463
# must NOT be able to get the merged evision
487
self.assertRaises(NoSuchRevision, branch.repository.get_revision,
464
self.assertRaises(NoSuchRevision, branch.repository.get_revision,
488
465
self._baz._missing_import_bzr)
490
467
def test_missing_ancestor_reusing_history(self):
491
468
import_version('output', pybaz.Version(self._baz._missing_ancestor),
493
470
reuse_history_from=[self._baz._missing_import_imported])
494
471
# expected results:
495
# one commits, no files, revision identifiers of
496
# 'demo-gone@DONOTUSE%c--import--0--base-0' and
472
# one commits, no files, revision identifiers of
473
# 'demo-gone@DONOTUSE%c--import--0--base-0' and
497
474
# 'demo@DONOTUSE%c--gone--0--base-0'
498
475
branch = Branch.open('output')
499
476
self.assertEqual(branch.revision_history(),
516
493
# and we should get some expected values:
517
494
self.assertEqual(rev.committer, "Test User<test@example.org>")
518
self.assertEqual(rev.message,
495
self.assertEqual(rev.message,
519
496
"tag of demo-gone@DONOTUSE/c--import--0--base-0")
520
497
self.assertEqual(rev.revision_id, self._baz._missing_ancestor_bzr)
521
498
self.assertEqual(rev.parent_ids[0], self._baz._missing_import_bzr)
522
499
self.assertEqual(1, len(rev.parent_ids))
524
501
def test_bad_file_id(self):
525
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
502
import_version('output', pybaz.Version(self._baz._bad_id_tag),
526
504
# expected results:
527
# three commits, one files, revision identifiers of
505
# three commits, one files, revision identifiers of
528
506
# 'demo@DONOTUSE_c--import--0--base-0' ,
529
507
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
530
508
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
539
517
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
541
519
def test_appending_revisions_already_present(self):
542
import_version('output', pybaz.Version(self._baz._bad_id_tag), None,
520
import_version('output', pybaz.Version(self._baz._bad_id_tag),
521
self.collect, max_count=2)
544
522
# expected results:
545
# three commits, one files, revision identifiers of
523
# three commits, one files, revision identifiers of
546
524
# 'demo@DONOTUSE_c--import--0--base-0' ,
547
525
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
548
526
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
569
548
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
571
550
def test_appending_revisions_all_already_present(self):
572
import_version('output', pybaz.Version(self._baz._bad_id_tag), None)
551
import_version('output', pybaz.Version(self._baz._bad_id_tag),
573
553
# expected results:
574
# three commits, one files, revision identifiers of
554
# three commits, one files, revision identifiers of
575
555
# 'demo@DONOTUSE_c--import--0--base-0' ,
576
556
# 'demo@DONOTUSE/c--bad-id--0--base-0' ,
577
557
# ''demo@DONOTUSE/c--bad-id--0--patch-1'
599
580
self.assertEqual('path', inv.id2path('x_this_id%2fneeds%25escaping'))
601
582
def test_inbranch_conversion(self):
602
import_version('output', pybaz.Version(self._baz._inbranch_tag), None)
583
import_version('output', pybaz.Version(self._baz._inbranch_tag),
603
585
# expected results:
604
# three commits, no files, revision identifiers of
586
# three commits, no files, revision identifiers of
605
587
# 'demo@DONOTUSE_c--import--0--base-0' and
606
588
# self._baz._inbranch_tag_base_bzr
607
589
# self._baz._inbranch_tag_head_bzr
612
594
self._baz._inbranch_tag_base_bzr,
613
595
self._baz._inbranch_tag_head_bzr])
615
import_version('output2', pybaz.Version(self._baz._inbranch_tag), None)
597
import_version('output2', pybaz.Version(self._baz._inbranch_tag),
616
599
branch2 = Branch.open('output2')
618
601
self.assertEqual(branch.revision_history(), branch2.revision_history())
619
602
# check revisions in the history.
620
603
rev = branch.repository.get_revision(self._baz._inbranch_tag_base_bzr)
638
621
self.assertEqual(rev.parent_ids,
639
622
[self._baz._inbranch_tag_base_bzr])
641
def test_no_commits_same_as_missing(self):
644
branch = bzrlib.bzrdir.BzrDir.create_branch_convenience(path)
645
import_version(path, pybaz.Version(self._baz._import), None)
647
# one commit, revision identifier of
648
# 'demo@DONOTUSE_c--import--0--base-0'
649
self.assertEqual(branch.revision_history(),
650
['Arch-1:demo@DONOTUSE%c--import--0--base-0'])
653
625
class TestNamespacePrevious(TestCase):
749
720
command = cmd_baz_import()
750
721
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
751
722
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output')))
752
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
723
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
754
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
725
self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output',
755
726
'c1', '0.2','branch')))
756
default_format = repository.RepositoryFormat.get_default_format()
757
if getattr(default_format, 'rich_root_data', False):
761
727
walk_len = len(list(os.walk(os.path.join(self._tmpdir,'output'))))
762
self.assertEqual(num_files, walk_len)
728
self.assertEqual(22, walk_len)
764
730
def test_run_twice(self):
765
731
self.make_import('c--0')
766
732
command = cmd_baz_import()
767
733
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
768
734
command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
770
736
def test_accepts_reuse_history(self):
771
737
self.make_import('c--0')
772
738
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),
773
739
'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())
741
def test_does_not_need_reuse_history(self):
742
self.make_import('c--0')
743
self.run_bzr('baz-import', os.path.join(self._tmpdir, 'output'),