You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2011/09/02 17:27:26 UTC

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

Author: cmpilato
Date: Fri Sep  2 15:27:25 2011
New Revision: 1164580

URL: http://svn.apache.org/viewvc?rev=1164580&view=rev
Log:
Fix issue #4003 ("'svn patch' seems unable to delete properties").

* subversion/libsvn_client/patch.c
  (install_patched_prop_targets): If the result of the patching
    operation is that a formerly-non-empty property is now empty, just
    try to remove the property altogether.

* subversion/tests/cmdline/patch_tests.py
  (patch_deletes_prop): Remove @XFail decorator.

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=1164580&r1=1164579&r2=1164580&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Fri Sep  2 15:27:25 2011
@@ -2493,8 +2493,15 @@ install_patched_prop_targets(patch_targe
           target->added = TRUE;
         }
 
-      /* Attempt to set the property, and reject all hunks if this fails. */
-      prop_val = svn_stringbuf__morph_into_string(prop_target->patched_value);
+      /* Attempt to set the property, and reject all hunks if this
+         fails.  If the property had a non-empty value, but now has
+         an empty one, we'll just delete the property altogether.  */
+      if (prop_target->value && prop_target->value->len
+          && prop_target->patched_value && !prop_target->patched_value->len)
+        prop_val = NULL;
+      else
+        prop_val = svn_stringbuf__morph_into_string(prop_target->patched_value);
+
       if (dry_run)
         {
           const svn_string_t *canon_propval;

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1164580&r1=1164579&r2=1164580&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Fri Sep  2 15:27:25 2011
@@ -3671,7 +3671,6 @@ def patch_lacking_trailing_eol(sbox):
                                        1, # check-props
                                        1) # dry-run
 
-@XFail()
 @Issue(4003)
 def patch_deletes_prop(sbox):
   "patch deletes prop, directly and via reversed add"