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 2010/07/26 21:35:45 UTC

svn commit: r979416 - in /subversion/trunk/subversion/libsvn_wc: diff.c props.c props.h

Author: rhuijben
Date: Mon Jul 26 19:35:44 2010
New Revision: 979416

URL: http://svn.apache.org/viewvc?rev=979416&view=rev
Log:
Remove a left over reference to revert properties. New code should talk
about base_properties or pristine_properties. This patch should also fix
the crash reported by artagon in: '[BUG] svn diff segfault' by making
sure that the file diff always sees pristine properties, even for added
files.

* subversion/libsvn_wc/diff.c
  (file_diff): Retrieve base properties instead of revert properties and
    ensure that baseprops is not NULL when retrieving pristine props.

* subversion/libsvn_wc/props.c
  (svn_wc__get_revert_props): Remove now unused function.

* subversion/libsvn_wc/props.h
  (svn_wc__get_revert_props): Remove function.

Modified:
    subversion/trunk/subversion/libsvn_wc/diff.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/props.h

Modified: subversion/trunk/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff.c?rev=979416&r1=979415&r2=979416&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff.c Mon Jul 26 19:35:44 2010
@@ -736,9 +736,9 @@ file_diff(struct dir_baton *db,
           /* We don't want the normal pristine properties (which are
              from the WORKING tree). We want the pristines associated
              with the BASE tree, which are saved as "revert" props.  */
-          SVN_ERR(svn_wc__get_revert_props(&baseprops,
-                                           eb->db, local_abspath,
-                                           pool, pool));
+          SVN_ERR(svn_wc__db_base_get_props(&baseprops,
+                                            eb->db, local_abspath,
+                                            pool, pool));
         }
       else
         {
@@ -750,6 +750,10 @@ file_diff(struct dir_baton *db,
 
           SVN_ERR(svn_wc__get_pristine_props(&baseprops, eb->db, local_abspath,
                                              pool, pool));
+
+          /* baseprops will be NULL for added nodes */
+          if (!baseprops)
+            baseprops = apr_hash_make(pool);
         }
       base_mimetype = get_prop_mimetype(baseprops);
 

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=979416&r1=979415&r2=979416&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Mon Jul 26 19:35:44 2010
@@ -167,31 +167,6 @@ svn_wc__get_prejfile_abspath(const char 
 }
 
 
-svn_error_t *
-svn_wc__get_revert_props(apr_hash_t **revert_props_p,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  svn_boolean_t replaced;
-
-  SVN_ERR_ASSERT(revert_props_p != NULL);
-
-  SVN_ERR(svn_wc__internal_is_replaced(&replaced, db, local_abspath,
-                                       scratch_pool));
-  if (replaced)
-    {
-      SVN_ERR(svn_wc__db_base_get_props(revert_props_p, db, local_abspath,
-                                        result_pool, scratch_pool));
-    }
-  else
-    *revert_props_p = apr_hash_make(result_pool);
-
-  return SVN_NO_ERROR;
-}
-
-
 /* See props.h  */
 #ifdef SVN__SUPPORT_BASE_MERGE
 

Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=979416&r1=979415&r2=979416&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Mon Jul 26 19:35:44 2010
@@ -179,17 +179,6 @@ svn_wc__get_actual_props(apr_hash_t **pr
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
-
-/* Load the revert props for ENTRY at PATH returning them in *REVERT_PROPS_P.
-   Returned hash/values are allocated in RESULT_POOL. All temporary
-   allocations are made in SCRATCH_POOL.  */
-svn_error_t *
-svn_wc__get_revert_props(apr_hash_t **revert_props_p,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool);
-
 /* Set *MARKED to indicate whether the versioned file at LOCAL_ABSPATH in DB
  * has a "binary" file type, as indicated by its working svn:mime-type
  * property. See svn_mime_type_is_binary() for the interpretation. */



Re: svn commit: r979416 - in /subversion/trunk/subversion/libsvn_wc: diff.c props.c props.h

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Bert,

rhuijben@apache.org writes:
> Author: rhuijben
> Date: Mon Jul 26 19:35:44 2010
> New Revision: 979416
> 
> URL: http://svn.apache.org/viewvc?rev=979416&view=rev
> Log:
> Remove a left over reference to revert properties. New code should talk
> about base_properties or pristine_properties. This patch should also fix
> the crash reported by artagon in: '[BUG] svn diff segfault' by making
> sure that the file diff always sees pristine properties, even for added
> files.

Yep, that solves it. Thanks! :)
Btw, I just fixed small typo in the log message: 'artagon'.

-- Ram

Re: svn commit: r979416 - in /subversion/trunk/subversion/libsvn_wc: diff.c props.c props.h

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Bert,

rhuijben@apache.org writes:
> Author: rhuijben
> Date: Mon Jul 26 19:35:44 2010
> New Revision: 979416
> 
> URL: http://svn.apache.org/viewvc?rev=979416&view=rev
> Log:
> Remove a left over reference to revert properties. New code should talk
> about base_properties or pristine_properties. This patch should also fix
> the crash reported by artagon in: '[BUG] svn diff segfault' by making
> sure that the file diff always sees pristine properties, even for added
> files.

Yep, that solves it. Thanks! :)
Btw, I just fixed small typo in the log message: 'artagon'.

-- Ram