/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.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:
1588
1588
        #       already in memory. However, this really needs to be done at a
1589
1589
        #       higher level, because there either won't be anything on disk,
1590
1590
        #       or the thing on disk will be a file.
1591
 
        return os.readlink(abspath.encode(osutils._fs_enc))
 
1591
        return os.readlink(abspath)
1592
1592
 
1593
1593
    def get_ghosts(self):
1594
1594
        """Return a list of the parent tree revision ids that are ghosts."""
1866
1866
            size = 0
1867
1867
            executable = False
1868
1868
        elif kind == 'symlink':
1869
 
            # We don't support non-ascii targets for symlinks yet.
1870
 
            fingerprint = str(inv_entry.symlink_target or '')
 
1869
            fingerprint = inv_entry.symlink_target.encode('utf8') or ''
1871
1870
            size = 0
1872
1871
            executable = False
1873
1872
        elif kind == 'file':