1431: Document how to create TortoiseSVN-compatible diffs

caffeina********@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 22, 2014
1608
What version are you running?
1.1 alpha 2

What's the URL of the page containing the problem?


What steps will reproduce the problem?
1. Create a new review request, choose a diff, request created no error
messages no diff available
2. Choose upload diff, same thing happens...no error but does nothing..view
diff button never appears.
3.

What is the expected output? What do you see instead?


What operating system are you using? What browser?
Windows XP Firefox 3.5.5, 3.0

Please provide any additional information below.
Attached is my diff file generated from svn diff
Index: XIMService.cfc
===================================================================
--- XIMService.cfc	(revision 1305)
+++ XIMService.cfc	(revision 1306)
@@ -700,41 +700,31 @@
 	</cffunction>
 
 
-  
-  <cffunction name="editNode" access="remote" returntype="void" output="false" hint="Edit a node, changing the name or type">
+  <cffunction name="editNodeSub" access="private" returntype="void" output="false" hint="Edit a node, changing the name or type">
 	   <cfargument name="node" type="Node" required="yes" hint="The node to update">
 	   <cfargument name="newtype" type="string" required="false" hint="The new type (CLASSIFICATION) of the node" default="">
 	   <cfargument name="oldtype" type="string" required="false" hint="The old type (CLASSIFICATION) of the node" default="">
 	   <cfargument name="oldname" type="string" required="false" hint="The old name of the node" default="">
        <cfargument name="context" type="string" required="false" default="" hint="
#1 caffeina********@gmai***** (Google Code) (Is this you? Claim this profile.)
After experimenting and taking out the first two lines that svn diff puts in there
namely:

Index: XIMService.cfc
=============================================

I was able to get it to work.  However, ReviewBoard should not just ignore the error
and probably should handle this extra info and ignore it.
#2 caffeina********@gmai***** (Google Code) (Is this you? Claim this profile.)
I spoke a little too soon.  You cannot load the diff when creating the request.  You
have to load the modified diff when viewing the request and clicking on the upload
diff button.  Also, if you use TortoiseSVN to generate the diff it will not work in
the following cases:

1) Generating a diff between working copy and latest revision - parse fails on dates
(alhtough this might have something to do with the full filenames I don't know)
2) When viewing a file revision log you can right click on one or more selected files
and generate a unified diff.  You can then copy this to notepad and save it.  However
it puts in the Index: <name> ==================== header and you must remove the path
to each of the two files (i.e. C:\xyz\MyFile.cfc) so just the filename remains like so:

--- MyFile.cfc
+++ MyFile.cfc

I really would wish the parser would be more robust.
chipx86
#3 chipx86
The Index line should work fine. We used it all the time. However, you're right that
TortoiseSVN-generated diffs don't work, as they generate incompatible diffs. We would
like to support them better.
#4 caffeina********@gmai***** (Google Code) (Is this you? Claim this profile.)
Well the index line causes a problem but I can work around it by editing. 
Unfortunately, I am trying to set this up so the department can use it for reviews
and an extra steps can be an issue when trying to convince people to use it. 
TortoiseSVN support is a must because nobody has a copy of svn on their local
workstations only the Tortoise client (or the Subclipse plugin which I have not
tested).  Thanks.
chipx86
#5 chipx86
Did you have a base path set for the Index line? Most likely, the base path just
wasn't set right.

I would like to add TortoiseSVN support. It generates slightly incompatible diffs,
which is an issue and causes some other problems.

I would recommend looking into post-review (part of RBTools), which is going to be
way more useful to you long-term.
  • +Confirmed
  • +Milestone-Release1.5
    +Component-DiffParser
  • +Need support for TortoiseSVN diffs
#6 sebastie*********@gmai***** (Google Code) (Is this you? Claim this profile.)
We use Tortoise SVN with functionality "Create a patch" to get a diff and it's working very well. how exactly to 
you generate your diffs ?
#7 caffeina********@gmai***** (Google Code) (Is this you? Claim this profile.)
There are two ways I was creating a diff.  1) You right click on the file and choose
diff with previous version (our organization has to post-commit reviews and we cannot
put the command line svn on every developer workstation) and then Save-As.  I was not
able to get this diff to work at all.  2) You can right-click on the file , choose
show log, right click on a specific entry and choose show unified diff.  Then you
copy all the text into a separate diff file.  This adds the index line I mentioned
that you have to remove.

I have never tried creating a patch but I don't see an option to do this from the svn
context menu or the repo browser.  Where is this at?
david
#8 david
  • -Type-Defect
    +Type-Enhancement
#9 sebastie*********@gmai***** (Google Code) (Is this you? Claim this profile.)
@caffeinatedcode: http://screencast.com/t/YzZkZWU1MGUt
I just right click on my root *folder* (not on a single file) and then I get this 
option. I am using Tortoise SVN v 1.6.1
#10 caffeina********@gmai***** (Google Code) (Is this you? Claim this profile.)
Yeah I see that now.  I will have to see how it works (assuming I can get reviewboard
to work with https Subversion on our Windows 2003 Server machines - it works fine on
workstation).  The others should probably as well though :)  Thanks.
david
#11 david
  • -Milestone-Release1.5
    +Milestone-Release1.6
#13 ben.*****@gmai***** (Google Code) (Is this you? Claim this profile.)
We use ReviewBoard with TortoiseSVN and have found that TSVN gives you multiple ways to produce a diff, but only one produces a unified diff in the correct format for ReviewBoard.

In general, any way of creating a diff through the TortoiseMerge utility (which is the default utility for viewing diffs in Tortoise) resulted in a diff that was not formatted correctly for ReviewBoard.  It appears that TortoiseMerge's diff treats the two files as simply files on your hard drive (not as a working copy and a pristine copy, like the "svn diff" command does) and doesn't create the header with the information that ReviewBoard needs.  I suspect that many other diff programs will have this same problem.

Instead, if you right click -> TortoiseSVN submenu -> "Create Patch...", this WILL create a diff in the unified diff format expected by ReviewBoard.  This command appears to use the "svn diff" command to create the diff (instead of doing the comparison itself), which is what ReviewBoard is expecting.

In case it's important, we're using ReviewBoard 1.6beta2 and TortoiseSVN 1.6.15
chipx86
#14 chipx86
Thanks Ben! I'll put this in the FAQ.
chipx86
#15 chipx86
  • -Component-DiffParser
    +Component-Docs
  • -Need support for TortoiseSVN diffs
    +Document how to create TortoiseSVN-compatible diffs
chipx86
#16 chipx86
Pushing lower-priority docs to to 1.6.x.
  • +Milestone-Release1.6.x
david
#17 david
  • -Milestone-Release1.6.x
david
#18 david
  • -Confirmed
    +WontFix