LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 03-17-2009, 05:41 PM   #1
+Yan
LQ Newbie
 
Registered: Jan 2006
Distribution: Slackware Linux
Posts: 21

Rep: Reputation: 15
Cool svn checkout failes to add corret EOL on windows machine


Hello,
We are using svn client version 1.5.6. I was able to setup svn server on linux server successfully. The server is working fine for linux machies. I.e. if they checkout/checkin source code, the line endings are unix style. The problem comes when the source is checkouted on Windows machine. SVN client does not automatically add 0xd at the end of line. Instead of that the line ending is unix style - 0xa . I tried to change config file in this way:

[miscellany]
enable-auto-props = yes

[auto-props]
*.PL = svn:eol-style=native
*.pl = svn:eol-style=native
*.cpp = svn:eol-style=native
*.c = svn:eol-style=native
*.h = svn:eol-style=native
*.dsp = svn:eol-style=native
*.dsw = svn:eol-style=native
*.sh = svn:eol-style=native;svn:executable
*.SH = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=native

But it looks like this is used when I commit or import files onlyn
When I checkout source files (.c for example) they have incorrect EOL.

Searching the net I found another approach:
svn propset -R svn:eol-style native .
This command is valid only if:
1. I checkout the sources.
2. change to work directory.
3. execute the command.
4. delete checkout-ed files without deleting .svn directories or their content.
5. execute svn update. In this case EOL's are ok.

My question is quite simple.
Is there any easy way to tell svn client to add correct EOL symbols when I'm checkouting source, and restoring the EOL to original one when I'm committing the source ?
I know that there are external programs that can do the conversion, but I would like to avoid this.

--
Thank you in advance for your answers.
 
Old 03-19-2009, 02:31 AM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You basically have the correct solution to the problem:

http://svnbook.red-bean.com/en/1.1/ch07s02.html

Quote:
native

This causes the file to contain the EOL markers that are native to the operating system on which Subversion was run. In other words, if a user on a Windows machine checks out a working copy that contains a file with an svn:eol-style property set to native, that file will contain CRLF EOL markers. A Unix user checking out a working copy which contains the same file will see LF EOL markers in his copy of the file.

Note that Subversion will actually store the file in the repository using normalized LF EOL markers regardless of the operating system. This is basically transparent to the user, though.
However, perhaps you should do this:

http://svn.haxx.se/tsvn/archive-2008-11/0035.shtml

Quote:
a) set svn:eol-style=lf on each of the text files in your repository
b) set svn:eol-style=native on all clients that check-out/update these files
You might also consider setting MIME type and EOF settings in the same configuration file, and making sure all your clients can share a standard SVN configuration file. Here are a couple of examples:

http://www.topazproject.org/trac/wiki/SubversionSetup
http://www.ogre3d.org/wiki/index.php...rsion_settings

'Hope that helps .. PSM

PS:
I also just stumbled across this gem:

http://svn.haxx.se/users/archive-2008-09/0858.shtml
Quote:
Have you looked at svn:eol-style=share?

That keeps the line endings in the repository as Unix LF, but changes
them in your working copy depending upon the platform you use. On
Unix, they'll be LF, on Windows, they'll be CRLF.

Last edited by paulsm4; 03-19-2009 at 02:35 AM.
 
  


Reply

Tags
checkout, svn, windows


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SVN Checkout Error? your_shadow03 Linux - Server 2 02-13-2009 05:29 AM
svn checkout -bash svn command not found Anauj0101 Linux - Newbie 6 04-20-2008 06:50 PM
Not able to add two different projects in SVN (Linux server) deepaklinux Linux - Software 1 02-14-2008 03:02 AM
svn checkout keith2045 Linux - General 3 11-15-2007 10:15 PM
how to add a linux machine to a windows 2003 domain ? whisper Linux - Newbie 1 02-09-2007 06:53 AM


All times are GMT -5. The time now is 11:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration