Support symlinks to non-ascii file names

Bug #272444 reported by Daniel Clemente
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Vincent Ladeuil

Bug Description

bzr from today. At bzrlib/dirstate.py, method _inv_entry_to_details:

        elif kind == 'symlink':
            # We don't support non-ascii targets for symlinks yet.
            fingerprint = str(inv_entry.symlink_target or '')

This causes many encoding bugs in Bazaar and plugins. Those bugs will be linked to this one.

Tags: symlink

Related branches

Revision history for this message
Daniel Clemente (n142857) wrote :

Some commands (add,rm,log,...) support it, while others (branch) don't.

A simple testcase to make „branch“ fail is:
  mkdir br1; cd br1; bzr init .; touch més; ln -s més prova; bzr add prova; bzr commit -m "link to utf-8 file name"; cd ..; bzr branch br1 br2

Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Daniel Clemente (n142857) wrote :

Comment from John Arbash Meinel at http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/48304

And just to mention *why* it isn't supported. Symlink targets are just
'non-null' 8-bit strings, with no defined encoding. I believe the true
encoding is just whatever the filesystem encoding is. Which means that
we probably need to decode the string when we read it from disk, track
it in memory as a Unicode string, store it into our inventories as
UTF-8, and then encode it when we go to create the symlink.

Revision history for this message
Daniel Clemente (n142857) wrote :

The patch would be similar to the one for bug #319317.

Note that we already have tests for this in bzr (but they fail):
test_unicode_symlink
test_sprout_with_unicode_symlink

Revision history for this message
Daniel Clemente (n142857) wrote :

I sent a first patch: http://bundlebuggy.aaronbentley.com/project/bzr/request/%<email address hidden>%3E

Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → vila
status: Triaged → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 1.13
status: In Progress → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.