You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/09/29 16:58:43 UTC

svn commit: r1705872 - in /subversion/trunk/subversion: libsvn_client/patch.c tests/cmdline/patch_tests.py

Author: rhuijben
Date: Tue Sep 29 14:58:43 2015
New Revision: 1705872

URL: http://svn.apache.org/viewvc?rev=1705872&view=rev
Log:
Make 'svn patch' stop notifying that a node is deleted, when it was already
deleted before invoking the patch. This might just be an ordinary case of the
patch was already applied.

* subversion/libsvn_client/patch.c
  (send_patch_notification): Update notify type when the target was already
    deleted pre-patch.

* subversion/tests/cmdline/patch_tests.py
  (patch_empty_vs_delete): Expect these patches are also repeatable with the
    usual notifications.

Modified:
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/tests/cmdline/patch_tests.py

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1705872&r1=1705871&r2=1705872&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Tue Sep 29 14:58:43 2015
@@ -2190,7 +2190,7 @@ send_patch_notification(const patch_targ
 
   if (target->skipped)
     action = svn_wc_notify_skip;
-  else if (target->deleted)
+  else if (target->deleted && !target->locally_deleted)
     action = svn_wc_notify_delete;
   else if (target->added || target->replaced || target->move_target_abspath)
     action = svn_wc_notify_add;
@@ -2945,7 +2945,9 @@ install_patched_target(patch_target_t *t
            * notify about what we did before aborting. */
           SVN_ERR(svn_wc_delete4(ctx->wc_ctx, target->local_abspath,
                                  FALSE /* keep_local */, FALSE,
-                                 NULL, NULL, NULL, NULL, pool));
+                                 ctx->cancel_func, ctx->cancel_baton,
+                                 NULL, NULL /* notify */,
+                                 pool));
         }
     }
   else
@@ -3074,7 +3076,8 @@ install_patched_target(patch_target_t *t
                                     target->move_target_abspath,
                                     TRUE, /* metadata_only */
                                     FALSE, /* allow_mixed_revisions */
-                                    NULL, NULL, NULL, NULL,
+                                    ctx->cancel_func, ctx->cancel_baton,
+                                    NULL, NULL,
                                     pool));
 
               /* Delete the patch target's old location from disk. */

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1705872&r1=1705871&r2=1705872&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Tue Sep 29 14:58:43 2015
@@ -6472,11 +6472,26 @@ def patch_empty_vs_delete(sbox):
                                        [], True, True,
                                        '--strip', strip_count)
 
+  # Retry
+  expected_output.tweak('iota', status='G ')
+  svntest.actions.run_and_verify_patch(wc_dir, del_patch,
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip,
+                                       [], True, True,
+                                       '--strip', strip_count)
+
   svntest.actions.run_and_verify_svn(None, [],
                                      'revert', sbox.ospath('iota'))
 
   # Git diff to deleted
-  # Ordinary diff to deleted
+  expected_output.tweak('iota', status='D ')
+  svntest.actions.run_and_verify_patch(wc_dir, del_git_patch,
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip,
+                                       [], True, True)
+
+  # Retry
+  expected_output.tweak('iota', status='G ')
   svntest.actions.run_and_verify_patch(wc_dir, del_git_patch,
                                        expected_output, expected_disk,
                                        expected_status, expected_skip,