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

Incorrect diff generation using SVN "internal" diff method

From: Sergey Proskurnya <alaley_at_gmail.com>
Date: Fri, 05 Dec 2008 15:35:31 +0200

Hi,

I've faced with problem trying to create unified pacth file
using internal "svn diff". The GNU "patch" utility
fails to apply that patch with the following message:
"
patching file src/server-java/app/nextapp/echo/app/HttpImageReference.java
patching file
src/server-java/app/nextapp/echo/app/ResourceImageReference.java
missing header for unified diff at line 47 of patch
can't find file to patch at input line 47
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|,10 @@
|
| private Extent width, height;
| private String contentType;
|+ private int contentLength;
| private String resource;
| private String id;
|+ private long lastModified;
|
| /**
| * Creates a <code>ResourceImageReference</code>.
--------------------------
File to patch:
"
The patch command looks like
"patch -p0 --dry-run -i svn_diff_my_changes.patch".

The file "svn_diff_my_changes.patch" was generated with
the following command:
"svn.exe diff -r147:296 . > svn_diff_my_changes.patch"

So I've generated the .patch file using external GNU diff command,
which is located on my search path with the help of command:
"svn.exe diff --diff-cmd diff -r147:296 . >
external_gnu_diff_my_changes.patch"

And this one ("external_gnu_diff_my_changes.patch") was applied
successfully (using "patch -p0 --dry-run -i
external_gnu_diff_my_changes.patch")!

It's no problem for me to use external diff command,
but that's the problem with SVN? Is it "behaviour by design"?

I've attached those two .patch files, see "diff_patches.zip".
You can see, they are really differ in several places.

Environment&versions info:
- Windows XP SP2
- SVN 1.5.4 (svn-win32-1.5.4.zip)
- GnuWin32 "diff -version" gives:
        diff (GNU diffutils) 2.8.7
        Written by Paul Eggert, Mike Haertel, David Hayes,
        Richard Stallman, and Len Tower.
- GnuWin32 "patch -version" gives:
        patch 2.5.9
        Copyright (C) 1988 Larry Wall
        Copyright (C) 2003 Free Software Foundation, Inc.

Thanks,
Serge.

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].

Received on 2008-12-05 14:36:40 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.