tags:

views:

146

answers:

4

I have two copies of a site, one is the production copy, and the other is the development copy. I recently added everything in the production to a subversion repository hosted on our linux backup server. I created a tag of the current version and I was done.

I then copied the development copy overtop of the production copy (on my local machine where I have everything checked out). There are only 10-20 files changed, however, when I use tortoise SVN to do a commit, it says every file has changed. The diff file generated shows subversion removing everything, and replacing it with the new version (which is the exact same).

What is going on? How do I fix it?

An example diff:

Index: C:/Users/jhollon/Documents/Visual Studio 2008/Projects/saloon/trunk/components/index.html
===================================================================
--- C:/Users/jhollon/Documents/Visual Studio 2008/Projects/saloon/trunk/components/index.html   (revision 5)
+++ C:/Users/jhollon/Documents/Visual Studio 2008/Projects/saloon/trunk/components/index.html   (working copy)
@@ -1,4 +1,4 @@
-<html>
-<body bgcolor="#FFFFFF">
-</body>
+<html>
+<body bgcolor="#FFFFFF">
+</body>
 </html>
\ No newline at end of file
+5  A: 

It's probably a line-ending mismatch. Set property svn:eol-style=native on all your files.

http://svnbook.red-bean.com/en/1.5/svn.advanced.props.file-portability.html#svn.advanced.props.special.eol-style

You can have Subversion set this property on all new files by default:

http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html#svn.advanced.props.auto

Here's what's in my ~/.subversion/config:

enable-auto-props = yes

### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match will be applied to the file.
### Note that auto-props functionality must be enabled, which
### is typically done by setting the 'enable-auto-props' option.
*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable=*
*.txt = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
*.jpeg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=native
*.tmpl = svn:eol-style=native
*.gif = svn:mime-type=image/gif
*.t = svn:eol-style=native;svn:executable=*
*.pm = svn:eol-style=native
*.pl = svn:eol-style=native;svn:executable=*
*.cgi = svn:eol-style=native;svn:executable=*
*.js = svn:eol-style=native;svn:mime-type=application/x-javascript
*.dtd = svn:eol-style=native;svn:mime-type=application/xml-dtd
*.txt = svn:eol-style=native;svn:mime-type=text/plain
*.html = svn:eol-style=native;svn:mime-type=text/html
*.yicf = svn:eol-style=native
*.xml = svn:eol-style=native;svn:mime-type=text/xml
*.sgml = svn:eol-style=native;svn:mime-type=text/sgml
*.xul = svn:mime-type=application/vnd.mozilla.xul+xml
*.tt = svn:eol-style=native
David M
That's it, The new version had /n and the old had /r/n
Malfist
A: 

short-term solution (to check the diff between the two versions) : check out the two versions to compare in two seperate directories, and compare the directories with an external diff tool (meld in linux, winmerge in windows). Those tools can be configured to ignore end of line differences.

Edit : for the rest, use David M's solution (didn't know SVN could manage that...)

Stéphane
Yikes, do not create Subversion hooks to diddle with EOL characters. You can explicitly what you want. `svn:eol-style=native` is the right choice unless you have a good reason to do something else.
David M
A: 

I see you're using Visual Studio, so maybe it has to do with the file encoding? I have had weird problems with VS encoding source files differently on two different machines, even though the machines have the same language and culture settings. In VS, the sources look exactly the same, but SVN sees the raw files...

Open the two revisions in an editor that knows nothing about Unicode or encoding (I think I used Notepad?), and see if they are different. The first line of the file contains a code that indicates what type of encoding is being used. I have no idea how to interpret that code, but at least you'll be able to tell if they are different.

There are options in Tools -> Options -> Environment -> Documents that control encoding.

HiredMind
Actually, I'm not using visual studio, it just got put into that directory because that's where I save all my projects. It's actually being using with Dreamweaver
Malfist
A: 

Sounds like this question is already well answered (EOL style). I just wanted to add one other thing that can trigger a problem like this: Tabs vs Spaces. If your text editor or IDE uses spaces for indenting, and someone else on your team uses Tabs, SVN will see lots of file changes, but you won't "see" the change.

msemack