Index: subversion/libsvn_wc/props.c =================================================================== --- subversion/libsvn_wc/props.c (revision 13553) +++ subversion/libsvn_wc/props.c (working copy) @@ -1188,6 +1188,13 @@ property into it. */ if (new_value) value = svn_string_create_from_buf (new_value, pool); + /* value == NULL means the operation is propdel + * if so, check if such a property already exists. + * If not, return an error + */ + if (!value && (apr_hash_get (prophash, name, APR_HASH_KEY_STRING)) == NULL) + return svn_error_createf (SVN_ERR_BAD_PROP_KIND, NULL, + _("Property '%s' does not exist"), name); apr_hash_set (prophash, name, APR_HASH_KEY_STRING, value); /* Open the propfile for writing. */ Index: subversion/tests/clients/cmdline/prop_tests.py =================================================================== --- subversion/tests/clients/cmdline/prop_tests.py (revision 13553) +++ subversion/tests/clients/cmdline/prop_tests.py (working copy) @@ -1123,6 +1123,25 @@ verify_output([ prop1 + ' : ' + propval1, prop2 + ' : ' + propval2, 'Properties on ' ], output, errput) +#---------------------------------------------------------------------- +# remove non existent property +def remove_nonexistent_prop(sbox): + "remove a property that does not exist" + + # Bootstrap + sbox.build() + wc_dir = sbox.wc_dir + + # delete a non-existent property from a file + iota_path = os.path.join(wc_dir, 'iota') + exp_stderr = "svn: Property 'thispropdoesntexist' does not exist" + output, errput = svntest.main.run_svn(1, 'propdel', + 'thispropdoesntexist', + iota_path) + if(errput[1].find(exp_stderr) == -1): + print 'Error: expected stderr: ', exp_stderr + print ' actual stderr : ', errput[1] + raise svntest.Failure ######################################################################## # Run the tests @@ -1148,6 +1167,7 @@ binary_props, recursive_base_wc_ops, url_props_ops, + remove_nonexistent_prop, ] if __name__ == '__main__':