[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svn diff shows entire file as modified after add 1 character

From: Thornock, Brian (Brian) <bthornock_at_avaya.com>
Date: Mon, 6 Apr 2009 15:38:42 -0600

The "svn diff" command seems to be inconsistent across various files in my Java repository.
I imported several java files from ClearCase into a Subversion repository. The "eol-style" property is set to "native".

For me to reproduce, I test with 2 files in the same package and directory:
*I checkout the repository: svn co http://svn/repos/trunk ./code-devel
*svn diff TestClient.java = reports no change
*Open TestClient.java in VI, add a single line in the header comment section
*svn diff TestClient.java = shows the diff with the 1 extra line

*svn diff TestConnector.java = reports no change
*Open TestConnector.java in VI, add a single line in the header comment section
*svn diff TestConnector.java = reports every line changed

There are about 20 files scattered throughout our base in various packages that have this weird problem where once you change something in the file, every line says it's modified. Even if I delete the line, it still reports every line as modified; I have to svn revert these 20 files. All the other files behave as expected.

After searching the archives, I found some comments on other topics about EOL.

I then tried:
svn diff -x --ignore-eol-style TestConnector.java = correctly shows the diff with the 1 extra line

svn diff --diff-cmd /usr/bin/diff -x -b = correctly shows the diff with the extra line

$ svn diff --diff-cmd /usr/bin/diff -x -b TestConnector.java
Index: TestConnector.java
===================================================================
1a2
> * Test Comment

$ svn diff -x --ignore-eol-style TestConnector.java
Index: TestConnector.java
===================================================================
--- TestConnector.java (revision 176006)
+++ TestConnector.java (working copy)
@@ -1,4 +1,5 @@
 /*
+ * Test Comment
  * TestConnector.java
  *
  *

$ svn diff TestConnector.java
Index: TestConnector.java
===================================================================
--- TestConnector.java (revision 176006)
+++ TestConnector.java (working copy)
@@ -1,727 +1,728 @@
-/*
- * TestConnector.java
- *
... Blah Blah Blah etc. etc.

+/*
+ * Test comment
+ * TestConnector.java
+ *
... Blah Blah etc. etc.

$ svn pl -v TestConnector.java
Properties on 'TestConnector.java':
  ClearcaseRevision : /main/21
  ClearcaseLabels : R4_2_2_341, R4_2_2_342
  svn:eol-style : native

An example of the properties for a file that does not manifest this problem and behaves correctly:
$ svn pl -v TestClient.java
Properties on 'TestClient.java':
  ClearcaseRevision : /main/1
  ClearcaseLabels : R4_2_2_342, R4_2_2_343
  svn:eol-style : native

I see this problem with both:
svn, version 1.5.4 (r33841) compiled Nov 10 2008, 17:14:16 Copyright (C) 2000-2008 CollabNet.
(from binary rpm subversion-1.1.4-2.ent)
and
svn, version 1.5.0 (r31699) compiled Jun 20 2008, 08:12:56 Copyright (C) 2000-2008 CollabNet.
(from binary rpm subversion-1.5.0-1)

Has anyone else seen this, and know how to fix it? I can't figure if there is another property that ought to be set? These are just ASCII text .java files. This is really frustrating that the files were both imported the same way, should be identical as far as file-type. But svn just freaks out with these 20 or so, and every other java file behaves correctly.

That's not really helpful to know that there is an option that "works-around" this 'oddity', when that ought to be the default behavior anyway, and is the case with 80% of the base.

When I also use the Subclipse plug-in in Eclipse and Compare with Base, it shows no change. But if I select to Commit, it incorrectly shows the files as Modified.

Thanks,
--Brian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1566170

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-04-06 23:40:41 CEST

This is an archived mail posted to the Subversion Users mailing list.