~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Merge shell-like-tests into description resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
369
369
        self.assertContainsRe(transform._limbo_name(first), 'new-1/file')
370
370
        self.assertNotContainsRe(transform._limbo_name(second), 'new-1/FiLe')
371
371
 
 
372
    def test_adjust_path_updates_child_limbo_names(self):
 
373
        tree = self.make_branch_and_tree('tree')
 
374
        transform = TreeTransform(tree)
 
375
        self.addCleanup(transform.finalize)
 
376
        foo_id = transform.new_directory('foo', transform.root)
 
377
        bar_id = transform.new_directory('bar', foo_id)
 
378
        baz_id = transform.new_directory('baz', bar_id)
 
379
        qux_id = transform.new_directory('qux', baz_id)
 
380
        transform.adjust_path('quxx', foo_id, bar_id)
 
381
        self.assertStartsWith(transform._limbo_name(qux_id),
 
382
                              transform._limbo_name(bar_id))
 
383
 
372
384
    def test_add_del(self):
373
385
        start, root = self.get_transform()
374
386
        start.new_directory('a', root, 'a')
2742
2754
        rev2_tree = tree.branch.repository.revision_tree(rev2_id)
2743
2755
        self.assertEqual('contents', rev2_tree.get_file_text('file_id'))
2744
2756
 
 
2757
    def test_ascii_limbo_paths(self):
 
2758
        self.requireFeature(tests.UnicodeFilenameFeature)
 
2759
        branch = self.make_branch('any')
 
2760
        tree = branch.repository.revision_tree(_mod_revision.NULL_REVISION)
 
2761
        tt = TransformPreview(tree)
 
2762
        foo_id = tt.new_directory('', ROOT_PARENT)
 
2763
        bar_id = tt.new_file(u'\u1234bar', foo_id, 'contents')
 
2764
        limbo_path = tt._limbo_name(bar_id)
 
2765
        self.assertEqual(limbo_path.encode('ascii', 'replace'), limbo_path)
 
2766
 
2745
2767
 
2746
2768
class FakeSerializer(object):
2747
2769
    """Serializer implementation that simply returns the input.