You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/08/03 13:36:09 UTC

svn commit: r981826 - /subversion/trunk/subversion/libsvn_client/patch.c

Author: dannas
Date: Tue Aug  3 11:36:08 2010
New Revision: 981826

URL: http://svn.apache.org/viewvc?rev=981826&view=rev
Log:
Make 'svn patch' able to handle added files with properties.

Added dirs with properties does not work yet, though.

* subversion/libsvn_client/patch.c
  (init_prop_target): Allow the target to be non-existing.

Modified:
    subversion/trunk/subversion/libsvn_client/patch.c

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=981826&r1=981825&r2=981826&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Tue Aug  3 11:36:08 2010
@@ -477,7 +477,7 @@ init_prop_target(prop_patch_target_t **p
   target_content_info_t *content_info; 
   const svn_string_t *value;
   const char *patched_path;
-
+  svn_error_t *err;
 
   content_info = apr_pcalloc(result_pool, sizeof(*content_info));
 
@@ -496,8 +496,18 @@ init_prop_target(prop_patch_target_t **p
   new_prop_target->operation = operation;
   new_prop_target->content_info = content_info;
 
-  SVN_ERR(svn_wc_prop_get2(&value, wc_ctx, local_abspath, prop_name, 
-                           result_pool, scratch_pool));
+  err = svn_wc_prop_get2(&value, wc_ctx, local_abspath, prop_name, 
+                           result_pool, scratch_pool);
+  if (err)
+    {
+      if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+        {
+          svn_error_clear(err);
+          value = NULL;
+        }
+      else
+        return svn_error_return(err);
+    }
 
   if (value)
     {