subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1356375 - in /subversion/trunk/subversion/libsvn_wc: update_editor.c wc_db.c
Date Mon, 02 Jul 2012 17:44:36 GMT
Author: rhuijben
Date: Mon Jul  2 17:44:35 2012
New Revision: 1356375

URL: http://svn.apache.org/viewvc?rev=1356375&view=rev
Log:
Ensure that the the wc_db mark conflict api is only used for adding conflicts
to the skel and not for removing.

* subversion/libsvn_wc/update_editor.c
  (add_directory,
   add_file): Store conflict for storing again in close_directory/close_file.

* subversion/libsvn_wc/wc_db.c
  (mark_conflict): In maintainer mode assert that this function is only used
    for adding/marking new conflicts.

Modified:
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1356375&r1=1356374&r2=1356375&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Jul  2 17:44:35 2012
@@ -2131,6 +2131,8 @@ add_directory(const char *path,
           tree_conflict = NULL; /* No direct notification */
           db->shadowed = TRUE; /* Just continue */
           conflicted = FALSE; /* No skip */
+
+          db->edit_conflict = tree_conflict; /* Cache for close_directory */
         }
       else
         SVN_ERR(node_already_conflicted(&conflicted, eb->db,
@@ -3309,6 +3311,8 @@ add_file(const char *path,
           tree_conflict = NULL; /* No direct notification */
           fb->shadowed = TRUE; /* Just continue */
           conflicted = FALSE; /* No skip */
+
+          fb->edit_conflict = tree_conflict; /* Cache for close_file */
         }
       else
         SVN_ERR(node_already_conflicted(&conflicted, eb->db,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1356375&r1=1356374&r2=1356375&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Jul  2 17:44:35 2012
@@ -5223,7 +5223,13 @@ mark_conflict(svn_wc__db_wcroot_t *wcroo
       svn_boolean_t text_conflict;
       svn_boolean_t prop_conflict;
       svn_boolean_t tree_conflict;
-
+#ifdef SVN_DEBUG
+      svn_boolean_t had_text_conflict;
+      svn_boolean_t had_prop_conflict;
+      svn_boolean_t had_tree_conflict;
+      svn_sqlite__stmt_t *stmt;
+      svn_boolean_t got_row;
+#endif
       svn_wc_conflict_reason_t local_change;
       svn_wc_conflict_action_t incoming_change;
       const apr_array_header_t *locations;
@@ -5247,6 +5253,34 @@ mark_conflict(svn_wc__db_wcroot_t *wcroo
                                          db, local_abspath, conflict_skel,
                                          scratch_pool, scratch_pool));
 
+#ifdef SVN_DEBUG
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_SELECT_ACTUAL_NODE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__step(&got_row, stmt));
+
+      if (got_row)
+        {
+          had_text_conflict = (!svn_sqlite__column_is_null(stmt, 3)
+                               || !svn_sqlite__column_is_null(stmt, 4)
+                               || !svn_sqlite__column_is_null(stmt, 5));
+          had_prop_conflict = !svn_sqlite__column_is_null(stmt, 6);
+          had_tree_conflict = !svn_sqlite__column_is_null(stmt, 7);
+        }
+      else
+        {
+          had_text_conflict = FALSE;
+          had_prop_conflict = FALSE;
+          had_tree_conflict = FALSE;
+        }
+      SVN_ERR(svn_sqlite__reset(stmt));
+
+      /* This function should only ADD conflicts */
+      SVN_ERR_ASSERT(text_conflict || !had_text_conflict);
+      SVN_ERR_ASSERT(prop_conflict || !had_prop_conflict);
+      SVN_ERR_ASSERT(tree_conflict || !had_tree_conflict);
+#endif
+
       if (text_conflict)
         {
           const char *mine_abspath;



Mime
View raw message