~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Fix #339055 and #277444 by handling non ascii symlink targets.

* bzrlib/tests/tree_implementations/test_path_content_summary.py:
(TestPathContentSummary.test_unicode_symlink_target_summary): Test
adding a non ascii symlink target.

* bzrlib/tests/workingtree_implementations/test_parents.py:
(TestSetParents.test_unicode_symlink): Should not fail anymore

* bzrlib/tests/branch_implementations/test_sprout.py:
(TestSprout.test_sprout_with_unicode_symlink): Should not fail anymore.

* bzrlib/workingtree.py:
(WorkingTree.path_content_summary): Get the symlink target as
unicode.

* bzrlib/transform.py:
(_PreviewTree.path_content_summary): Get the symlink target as
unicode.

* bzrlib/dirstate.py:
(DirState._read_link): abspath should stay in Unicode.
(DirState._inv_entry_to_details): Encode path in utf8 for the
fingerprint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1845
1845
                size = None
1846
1846
                executable = None
1847
1847
            if kind == 'symlink':
1848
 
                link_or_sha1 = os.readlink(limbo_name)
 
1848
                link_or_sha1 = os.readlink(limbo_name).decode(osutils._fs_enc)
1849
1849
        if supports_executable():
1850
1850
            executable = tt._new_executability.get(trans_id, executable)
1851
1851
        return kind, size, executable, link_or_sha1