You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sergio Lopes <kn...@gmail.com> on 2009/03/23 10:19:15 UTC
Encoding problem causes SVN to misbehave on OS X Leopard
Hi,
I've search with whatever words and expressions I could come up to but failed to find an answer to the problem I'm facing.
I found this old thread about the same problem, http://svn.haxx.se/users/archive-2005-12/0191.shtml, but no solution nor hint on how to resolve the situation.
I have been using SVN on Windows and Linux without any major problems, every client I used from command line subversion to tortoiseSVN has always behaved accordingly.
Now I changed to OS X and started getting problems on filenames with no-ASCII characters.
SVN does not complain about them, but sees the files as deleted and new, so I now have several files that show as new files and, at the same time, as deleted files.
After a bit of cleaning up on the repository, that made me delete quite a number of files, one of these problematic files slip trough and was commit, now I can't make a checkout out of the repository, nor can I seem to be able to delete, or otherwise reset those files' status.
On my Mac, svn keeps working, somehow committing changes, but I fear that the repository is no longer working properly.
If found some mention of the locale settings, the 'locale' command on my machine gives back:
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
I've also found how to make svn read the files' names correctly, or at least makes them show properly at my terminal, using:
alias svn="env LC_CTYPE=pt_PT.UTF-8 /opt/subversion/bin/svn"
I defined that alias in my .profile file so that it changed the encoding to svn alone and doesn't change other settings in my system.
I'm completely lost as to what steps I can take to solve the problem. I'll probably create some pre-commit hook that prevents such files to be sent to the repository, but I need to be able to solve this problem, making the repository work again.
Sorry for the long reading :), I couldn't make it any shorter.
Thanks,
Sergio Lopes
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1388585
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Encoding problem causes SVN to misbehave on OS X Leopard
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 26, 2009, at 04:10, Sergio Lopes wrote:
> I'll want the pre-commit hook to deny any file with non-ASCII
> characters in the name, accepting only files whose names have no
> Portuguese characters will, I think, prevent further issues like this
> one, or other that may arise related to encodings.
Ah yes, that would work too. I don't commit files with non-ASCII
characters in their filenames to my repositories either, and I think
it's a good idea until this problem is solved properly in a later
version of Subversion. Actually I think it's a good idea in general,
but I'm also an English speaker living in the U.S. so it's not hard
for me to avoid filenames with non-ASCII characters, whereas I know
this is more problematic in other languages.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1437755
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Encoding problem causes SVN to misbehave on OS X Leopard
Posted by Sergio Lopes <kn...@gmail.com>.
> What would you have your pre-commit hook do? The only workable thing I could
> think to have it do would be to only accept filenames in decomposed UTF-8
> representation and deny filenames in composed UTF-8 representation. This
> would mean anytime you want to create a new file with UTF-8 characters, you
> would have to do so from a Mac (since that's the only platform that creates
> decomposed UTF-8 filenames). And that's probably inconvenient for your
> non-Mac-using coworkers.
I'll want the pre-commit hook to deny any file with non-ASCII
characters in the name, accepting only files whose names have no
Portuguese characters will, I think, prevent further issues like this
one, or other that may arise related to encodings.
It is, actually, a rule we have talked about, amongst the developers,
and these particular files were the only exception, given they came
from a client and the person that put the files in the repository
didn't rename them.
Though as my experience with such issues is limited, and it may be
that creating the hook will be more of an annoyance than a feature.
Unfortunately, the all situation came in the middle of an iteration
where my attention needs to be all in the development and, as SVN is
working properly for the other developers, I'll have do postpone
solving the problem.
--
Sem mais e com os melhores cumprimentos,
Sérgio Lopes
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1427442
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Encoding problem causes SVN to misbehave on OS X Leopard
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 24, 2009, at 04:40, Sergio Lopes wrote:
>> What happens when you try?
>
> On the problematic file, svn complains that a file with the same name
> already exists, any checkout or update stops and I get half the code.
> After that, given that I have a incomplete working copy, I can't do
> much with svn.
>
> Also it seems I'm the only one having problems, the other programmers,
> using TortoiseSVN on Windows, have no issues with updating, committing
> or even checking the code.
Ok. Probably what has happened is you have committed two files to the
repository whose names contain the same UTF-8 characters but in one
case the characters are represented in composed form and in the other
case they are represented in decomposed form. Linux and Windows by
default create names in composed form, while Mac OS X creates names
in decomposed form. Linux and Windows will happily use files of
either representation. If you have both in your repository, they will
have no problem checking this out and showing you two different files
that appear to have the same name. Pretty confusing. Mac OS X will
attempt to convert both of these to the same (decomposed)
representation, but fail on the second one because the file of the
same name already exists.
You can use "svn ls" on the URL of the directory in question to
verify this. You should then use "svn cat" on the two files to
determine which one you want to keep, and "svn rm" the other one.
>> Have you run "svnadmin verify" on your repository? What does it say?
>
> All versions are properly verified, no errors found. As I indicated
> above, it breaks down to being only a problem with my machine, not the
> repository, as I feared.
Ok. Then there is nothing wrong (nothing corrupted, anyway) in your
repository.
>> Usually you would just set LANG to the correct value for your
>> system. For
>> example, on my Mac, I set LANG=en_US.UTF-8. I would think you
>> would want
>> that set for all programs; I don't see why it should be Subversion-
>> specific.
>
> I'm quite knew to this mac thing, and the all "if it ain't broken,
> don't fix it" idea keeps popping to me :). Everything works correctly
> in my system, or so it seems, even the terminal works fine in all
> other usages, so I changed only that setting.
>
>> Note that I'm on Tiger. On Leopard, I believe you can have the
>> Terminal set
>> LANG automatically for you. Look around in the preferences and window
>> settings.
>
> I can only find options to set the available encodings, and those are
> UTF-8 and the ISO-8859-1 and ISO-8859-9, as far as I can see, I have
> no option to tell the Terminal which is the default or used one.
Well there's probably no harm in setting the variable yourself
instead of having Terminal do it for you automatically.
> Funny enough, I was using SmartSVN, and only after ditching it did I
> found the encoding problem, SmartSVN never had any problems with the
> files, and it doesn't even sees the dual status for the same file, if
> only it was a decent client I would have been unaware of all this.
I haven't used SmartSVN. I cannot explain why it would not suffer
from the problem.
> Thanks for the information, I'll probably create the pre-commit hook
> nevertheless, and at least prevent future situations like this one,
> and as soon as I have the time, I'll look into the patch, though I
> don't really like to use such solution.
What would you have your pre-commit hook do? The only workable thing
I could think to have it do would be to only accept filenames in
decomposed UTF-8 representation and deny filenames in composed UTF-8
representation. This would mean anytime you want to create a new file
with UTF-8 characters, you would have to do so from a Mac (since
that's the only platform that creates decomposed UTF-8 filenames).
And that's probably inconvenient for your non-Mac-using coworkers.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1409648
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Encoding problem causes SVN to misbehave on OS X Leopard
Posted by Sergio Lopes <kn...@gmail.com>.
> That's this bug:
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=2464
Thanks, I'll keep an eye on that report :)
> What happens when you try?
On the problematic file, svn complains that a file with the same name
already exists, any checkout or update stops and I get half the code.
After that, given that I have a incomplete working copy, I can't do
much with svn.
Also it seems I'm the only one having problems, the other programmers,
using TortoiseSVN on Windows, have no issues with updating, committing
or even checking the code.
> Have you run "svnadmin verify" on your repository? What does it say?
All versions are properly verified, no errors found. As I indicated
above, it breaks down to being only a problem with my machine, not the
repository, as I feared.
> Usually you would just set LANG to the correct value for your system. For
> example, on my Mac, I set LANG=en_US.UTF-8. I would think you would want
> that set for all programs; I don't see why it should be Subversion-specific.
I'm quite knew to this mac thing, and the all "if it ain't broken,
don't fix it" idea keeps popping to me :). Everything works correctly
in my system, or so it seems, even the terminal works fine in all
other usages, so I changed only that setting.
> Note that I'm on Tiger. On Leopard, I believe you can have the Terminal set
> LANG automatically for you. Look around in the preferences and window
> settings.
I can only find options to set the available encodings, and those are
UTF-8 and the ISO-8859-1 and ISO-8859-9, as far as I can see, I have
no option to tell the Terminal which is the default or used one.
Funny enough, I was using SmartSVN, and only after ditching it did I
found the encoding problem, SmartSVN never had any problems with the
files, and it doesn't even sees the dual status for the same file, if
only it was a decent client I would have been unaware of all this.
Thanks for the information, I'll probably create the pre-commit hook
nevertheless, and at least prevent future situations like this one,
and as soon as I have the time, I'll look into the patch, though I
don't really like to use such solution.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1399970
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Encoding problem causes SVN to misbehave on OS X Leopard
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 23, 2009, at 05:19, Sergio Lopes wrote:
> I've search with whatever words and expressions I could come up to
> but failed to find an answer to the problem I'm facing.
>
> I found this old thread about the same problem, http://svn.haxx.se/
> users/archive-2005-12/0191.shtml, but no solution nor hint on how
> to resolve the situation.
>
> I have been using SVN on Windows and Linux without any major
> problems, every client I used from command line subversion to
> tortoiseSVN has always behaved accordingly.
>
> Now I changed to OS X and started getting problems on filenames
> with no-ASCII characters.
>
> SVN does not complain about them, but sees the files as deleted and
> new, so I now have several files that show as new files and, at the
> same time, as deleted files.
That's this bug:
http://subversion.tigris.org/issues/show_bug.cgi?id=2464
A possible workaround is available if you install Subversion via
MacPorts and use the +unicode_path variant. Note that this has some
tradeoffs which you should read about and understand before using
that variant.
> After a bit of cleaning up on the repository, that made me delete
> quite a number of files, one of these problematic files slip trough
> and was commit, now I can't make a checkout out of the repository,
> nor can I seem to be able to delete, or otherwise reset those
> files' status.
What happens when you try?
> On my Mac, svn keeps working, somehow committing changes, but I
> fear that the repository is no longer working properly.
Have you run "svnadmin verify" on your repository? What does it say?
> If found some mention of the locale settings, the 'locale' command
> on my machine gives back:
>
> LANG=
> LC_COLLATE="C"
> LC_CTYPE="UTF-8"
> LC_MESSAGES="C"
> LC_MONETARY="C"
> LC_NUMERIC="C"
> LC_TIME="C"
> LC_ALL=
>
> I've also found how to make svn read the files' names correctly, or
> at least makes them show properly at my terminal, using:
>
> alias svn="env LC_CTYPE=pt_PT.UTF-8 /opt/subversion/bin/svn"
>
> I defined that alias in my .profile file so that it changed the
> encoding to svn alone and doesn't change other settings in my system.
Usually you would just set LANG to the correct value for your system.
For example, on my Mac, I set LANG=en_US.UTF-8. I would think you
would want that set for all programs; I don't see why it should be
Subversion-specific.
Note that I'm on Tiger. On Leopard, I believe you can have the
Terminal set LANG automatically for you. Look around in the
preferences and window settings.
> I'm completely lost as to what steps I can take to solve the
> problem. I'll probably create some pre-commit hook that prevents
> such files to be sent to the repository, but I need to be able to
> solve this problem, making the repository work again.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1395636
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].