Bug 222669 - Patch files created under subversive not compatible with patch program
Summary: Patch files created under subversive not compatible with patch program
Status: RESOLVED FIXED
Alias: None
Product: Subversive
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Alexander Gurov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-13 17:01 EDT by Mike CLA
Modified: 2011-05-18 06:46 EDT (History)
0 users

See Also:


Attachments
test patch that is broken (3.37 KB, patch)
2008-03-25 16:14 EDT, Mike CLA
i.vinnykov: iplog+
Details | Diff
Example java file used to create the patch (2.49 KB, text/plain)
2008-03-25 16:16 EDT, Mike CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike CLA 2008-03-13 17:01:40 EDT
Build ID: M20071023-1652

Steps To Reproduce:
1. Create a patch from subversive



More information:
Subversive is creating patch files that the command line tool called 'patch' cannot read. The problem is that the file names contained in the patch are missing from the appropriate lines in the patch file. Here is an example:


Snippit from file created by subversive:

Index: src/java/com/liveops/test/tools/telesim/TSSProvider.java
===================================================================
--- . (revision 9008)
+++ . (working copy)
@@ -1076,7 +1076,8 @@

/**
* Look up a provider across all tests and provider objects based on a
- * provider ID.
+ * provider ID. Try and find provider object in an test that is not finished
+ * first, otherwise return the last found finished test provider
*
* It might make sense to have a global map some day as this function could
* get quite slow.



Snippit from file created using svn diff:

Index: src/java/com/liveops/test/tools/telesim/TSSProvider.java
===================================================================
--- src/java/com/liveops/test/tools/telesim/TSSProvider.java (revision 9012)
+++ src/java/com/liveops/test/tools/telesim/TSSProvider.java (working copy)
@@ -1076,7 +1076,8 @@

/**
* Look up a provider across all tests and provider objects based on a
- * provider ID.
+ * provider ID. Try and find provider object in an test that is not finished
+ * first, otherwise return the last found finished test provider
*




Notice how the +++ and --- lines in the subversive version do not contain the filename, but rather just '.'. When using patch to apply, it complains about an invalid file to patch named '.'

The one time I tried to apply the patch back via eclipse it did work, but when working with external people that do not use eclipse, this is a huge problem.



Eclipse SDK
Version: 3.3.1.1
Build id: M20071023-1652

Subversive 2.0.0.v20080214


Anyone else run into this issue?
Comment 1 Alexander Gurov CLA 2008-03-14 13:06:17 EDT
Fix will be available at the end of next week.
Comment 2 Mike CLA 2008-03-24 17:42:15 EDT
I did an update of my subversive plugins today (to version 20080321) and notice the filenames are now properly showing up in the file, but I think there is a new problem. Not sure if its related to this bug or not.

I noticed a patch file I created that adds a new file that did not previously exist, contains incorrectly formatted lines. Every line change in the section for the new file should contain a '+', since its all new content. In the patch created by this new version of subversive, there are a number of lines missing the '+'. It actually looks like the '+' for the given line has a carriage return inserted directly after it, causing the actual change line to be moved to the next line, causing the + to go away from the beginning of the line.

Example:


Index: src/java/com/liveops/test/tools/telesim/TSSDBVerifier.java
===================================================================
--- src/java/com/liveops/test/tools/telesim/TSSDBVerifier.java  (revision 0)
+++ src/java/com/liveops/test/tools/telesim/TSSDBVerifier.java  (revision 0)
@@ -0,0 +1,330 @@
+package com.liveops.test.tools.telesim;
+     
import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+    
import com.liveops.db.DBUtil;
+import com.liveops.util.corp.*;
+     
public class TSSDBVerifier extends TSSObject
+{    
+    private static final long serialVersionUID = 4157975256829893605L;
+    public final static String CLASSNAME = "DBVerifier"; 
+    
    protected boolean mBusy;
+
+    String mDBName;
+



Notice the import java.sql.Connection line does not have a leading '+', nor does the protected boolean mBusy line. This of course, is still screwing up the 'patch' command from being able to apply this patch.



Comment 3 Alexander Gurov CLA 2008-03-25 05:38:01 EDT
Unfortunately I cannot reproduce the problem. Possibly it relates only to files created in Mac OS X environment. So, could you please attach incorrectly generated patch file and file on which I can test the patch generation code?
Comment 4 Mike CLA 2008-03-25 16:14:11 EDT
Created attachment 93489 [details]
test patch that is broken


This test patch contains two file parts, one is a file that existed but had 1 line change, the other is a new file in the workspace that didnt exist in svn before (CopyOfEvent.java). If you look at several of the lines in this second file, there are lines that have a '+' missing, causing tools to reject the patch.

This was created from subversive 20080321 on OS X 10.4.
Comment 5 Mike CLA 2008-03-25 16:15:25 EDT
If you look at this patch via bugzilla "Diff" view, you will clearly see the missing '+' lines because they show up as white instead of green.
Comment 6 Mike CLA 2008-03-25 16:16:53 EDT
Created attachment 93490 [details]
Example java file used to create the patch
Comment 7 Alexander Gurov CLA 2008-03-26 12:51:41 EDT
Thank you for provided information. Issue is fixed and fix will be available in the next Subversive build.