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 2012/05/14 00:48:48 UTC

svn commit: r1338000 - /subversion/trunk/subversion/libsvn_wc/questions.c

Author: rhuijben
Date: Sun May 13 22:48:48 2012
New Revision: 1338000

URL: http://svn.apache.org/viewvc?rev=1338000&view=rev
Log:
* subversion/libsvn_wc/questions.c
  (svn_wc__internal_conflicted_p): Add an automatic 'repair' of text and
    property conflicts when no marker files are found and a wc lock is held.
    This is similar to the auto-repair in svn_wc__internal_file_modified_p(),
    for the recorded timestamp and size.

Modified:
    subversion/trunk/subversion/libsvn_wc/questions.c

Modified: subversion/trunk/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?rev=1338000&r1=1337999&r2=1338000&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/questions.c (original)
+++ subversion/trunk/subversion/libsvn_wc/questions.c Sun May 13 22:48:48 2012
@@ -396,6 +396,8 @@ svn_wc__internal_conflicted_p(svn_boolea
   const apr_array_header_t *conflicts;
   int i;
   svn_boolean_t conflicted;
+  svn_boolean_t resolved_text = FALSE;
+  svn_boolean_t resolved_props = FALSE;
 
   if (text_conflicted_p)
     *text_conflicted_p = FALSE;
@@ -464,7 +466,12 @@ svn_wc__internal_conflicted_p(svn_boolea
                                           scratch_pool));
 
                 *text_conflicted_p = (kind == svn_node_file);
+
+                if (*text_conflicted_p)
+                  break;
               }
+
+            resolved_text = TRUE; /* Remove in-db conflict marker */
             break;
 
           case svn_wc_conflict_kind_property:
@@ -477,8 +484,11 @@ svn_wc__internal_conflicted_p(svn_boolea
                                           scratch_pool));
 
                 *prop_conflicted_p = (kind == svn_node_file);
-              }
 
+                if (*prop_conflicted_p)
+                  break;
+              }
+            resolved_props = TRUE; /* Remove in-db conflict marker */
             break;
 
           case svn_wc_conflict_kind_tree:
@@ -492,6 +502,23 @@ svn_wc__internal_conflicted_p(svn_boolea
             break;
         }
     }
+
+  if (resolved_text || resolved_props)
+    {
+      svn_boolean_t own_lock;
+
+      /* The marker files are missing, so "repair" wc.db if we can */
+      SVN_ERR(svn_wc__db_wclock_owns_lock(&own_lock, db, local_abspath, FALSE,
+                                          scratch_pool));
+      if (own_lock)
+        SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath,
+                                            resolved_text,
+                                            resolved_props,
+                                            FALSE /* resolved_tree */,
+                                            NULL /* work_items */,
+                                            scratch_pool));
+    }
+
   return SVN_NO_ERROR;
 }