subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1356835 - in /subversion/trunk/subversion/libsvn_wc: conflicts.c props.c props.h workqueue.c
Date Tue, 03 Jul 2012 17:07:20 GMT
Author: rhuijben
Date: Tue Jul  3 17:07:19 2012
New Revision: 1356835

URL: http://svn.apache.org/viewvc?rev=1356835&view=rev
Log:
Fold svn_wc__get_prejfile_abspath() in its two callers, that already
know about conflict skels.

* subversion/libsvn_wc/conflicts.c
  (svn_wc__conflict_create_markers): Find a prej file in the skel.

* subversion/libsvn_wc/props.c
  (svn_wc__get_prejfile_abspath): Remove function.

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

* subversion/libsvn_wc/workqueue.c
  (run_prej_install): Read conflict skel to find path.

Modified:
    subversion/trunk/subversion/libsvn_wc/conflicts.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/props.h
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1356835&r1=1356834&r2=1356835&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Tue Jul  3 17:07:19 2012
@@ -962,7 +962,7 @@ svn_wc__conflict_create_markers(svn_skel
 
          This can be simplified once we really store conflict_skel in wc.db */
 
-      const char *marker_abspath;
+      const char *marker_abspath = NULL;
       const char *marker_relpath;
 
       /* ### as the legacy code, check if we already have a prejfile.
@@ -970,8 +970,19 @@ svn_wc__conflict_create_markers(svn_skel
          ### Triggered by merge_tests.py 90 on a double property merge.
          ### Needs further review as we will probably loose the original
          ### conflict by overwriting. (Legacy issue)  */
-      SVN_ERR(svn_wc__get_prejfile_abspath(&marker_abspath, db, local_abspath,
-                                           scratch_pool, scratch_pool));
+      {
+        svn_skel_t *old_conflict;
+        SVN_ERR(svn_wc__db_read_conflict(&old_conflict, db, local_abspath,
+                                         scratch_pool, scratch_pool));
+
+        if (old_conflict)
+          SVN_ERR(svn_wc__conflict_read_prop_conflict(&marker_abspath,
+                                                      NULL, NULL, NULL, NULL,
+                                                      db, local_abspath,
+                                                      old_conflict,
+                                                      scratch_pool,
+                                                      scratch_pool));
+      }
 
       if (! marker_abspath)
         {

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1356835&r1=1356834&r2=1356835&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Tue Jul  3 17:07:19 2012
@@ -87,39 +87,6 @@ append_prop_conflict(svn_stream_t *strea
   return svn_stream_puts(stream, native_text);
 }
 
-
-/* Get the property reject file for LOCAL_ABSPATH in DB.  Set
-   *PREJFILE_ABSPATH to the name of that file, or to NULL if no such
-   file is named.  The file may, or may not, exist on disk. */
-svn_error_t *
-svn_wc__get_prejfile_abspath(const char **prejfile_abspath,
-                             svn_wc__db_t *db,
-                             const char *local_abspath,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool)
-{
-  const apr_array_header_t *conflicts;
-  int i;
-
-  SVN_ERR(svn_wc__read_conflicts(&conflicts, db, local_abspath,
-                                 scratch_pool, scratch_pool));
-
-  for (i = 0; i < conflicts->nelts; i++)
-    {
-      const svn_wc_conflict_description2_t *cd;
-      cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description2_t *);
-
-      if (cd->kind == svn_wc_conflict_kind_property)
-        {
-          *prejfile_abspath = apr_pstrdup(result_pool, cd->their_abspath);
-          return SVN_NO_ERROR;
-        }
-    }
-
-  *prejfile_abspath = NULL;
-  return SVN_NO_ERROR;
-}
-
 /*---------------------------------------------------------------------*/
 
 /*** Merging propchanges into the working copy ***/

Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=1356835&r1=1356834&r2=1356835&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Tue Jul  3 17:07:19 2012
@@ -145,13 +145,6 @@ svn_wc__get_actual_props(apr_hash_t **pr
                          apr_pool_t *scratch_pool);
 
 svn_error_t *
-svn_wc__get_prejfile_abspath(const char **prejfile_abspath,
-                             svn_wc__db_t *db,
-                             const char *local_abspath,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool);
-
-svn_error_t *
 svn_wc__create_prejfile(const char **tmp_prejfile_abspath,
                         svn_wc__db_t *db,
                         const char *local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1356835&r1=1356834&r2=1356835&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Tue Jul  3 17:07:19 2012
@@ -1153,29 +1153,34 @@ run_prej_install(svn_wc__db_t *db,
   const svn_skel_t *arg1 = work_item->children->next;
   const char *local_relpath;
   const char *local_abspath;
-  const svn_skel_t *conflict_skel;
+  svn_skel_t *conflicts;
+  const svn_skel_t *prop_conflict_skel;
   const char *tmp_prejfile_abspath;
   const char *prejfile_abspath;
 
   local_relpath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
   SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
                                   local_relpath, scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+                                   scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_wc__conflict_read_prop_conflict(&prejfile_abspath,
+                                              NULL, NULL, NULL, NULL,
+                                              db, local_abspath, conflicts,
+                                              scratch_pool, scratch_pool));
+
   if (arg1->next != NULL)
-    conflict_skel = arg1->next;
+    prop_conflict_skel = arg1->next;
   else
     SVN_ERR_MALFUNCTION();  /* ### wc_db can't provide it ... yet.  */
 
   /* Construct a property reject file in the temporary area.  */
   SVN_ERR(svn_wc__create_prejfile(&tmp_prejfile_abspath,
                                   db, local_abspath,
-                                  conflict_skel,
+                                  prop_conflict_skel,
                                   scratch_pool, scratch_pool));
 
-  /* Get the (stored) name of where it should go.  */
-  SVN_ERR(svn_wc__get_prejfile_abspath(&prejfile_abspath, db, local_abspath,
-                                       scratch_pool, scratch_pool));
-  SVN_ERR_ASSERT(prejfile_abspath != NULL);
-
   /* ... and atomically move it into place.  */
   SVN_ERR(svn_io_file_rename(tmp_prejfile_abspath,
                              prejfile_abspath,



Mime
View raw message