subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1704854 - /subversion/trunk/subversion/libsvn_diff/parse-diff.c
Date Wed, 23 Sep 2015 13:58:47 GMT
Author: rhuijben
Date: Wed Sep 23 13:58:46 2015
New Revision: 1704854

URL: http://svn.apache.org/viewvc?rev=1704854&view=rev
Log:
Fix an issue in the diff parsing code where a delete or add in
a 'svn diff --git' was not properly applied in
'svn diff --reverse-diff'

This patch will be tested in a future regression test that currently
requires binary patch support.

* subversion/libsvn_diff/parse-diff.c
  (svn_diff_parse_next_patch): Properly reverse add and delete operations.

Modified:
    subversion/trunk/subversion/libsvn_diff/parse-diff.c

Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=1704854&r1=1704853&r2=1704854&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Wed Sep 23 13:58:46 2015
@@ -1851,6 +1851,22 @@ svn_diff_parse_next_patch(svn_patch_t **
       temp = patch->old_filename;
       patch->old_filename = patch->new_filename;
       patch->new_filename = temp;
+
+      switch (patch->operation)
+        {
+          case svn_diff_op_added:
+            patch->operation = svn_diff_op_deleted;
+            break;
+          case svn_diff_op_deleted:
+            patch->operation = svn_diff_op_added;
+            break;
+
+          /* ### case svn_diff_op_copied:
+             ### case svn_diff_op_moved:*/
+
+          case svn_diff_op_modified:
+            break; /* Stays modify */
+        }
     }
 
   if (patch->old_filename == NULL || patch->new_filename == NULL)



Mime
View raw message