You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/02/24 15:06:08 UTC

svn commit: r915796 - /subversion/trunk/subversion/svn/notify.c

Author: stsp
Date: Wed Feb 24 14:06:07 2010
New Revision: 915796

URL: http://svn.apache.org/viewvc?rev=915796&view=rev
Log:
Fix conflict stat accounting for externals during update and merge.
Conflicts were counted but for some reason the count was never printed.
Simply stop counting conflicts in externals separately from other conflicts.
This makes the summary present a grand total of all conflicts encountered
during the entire operation, and the very end of the operation, matching
the behaviour of 'svn status' (which prints a conflict summary as of r915521).

* subversion/svn/notify.c
  (notify_baton, svn_cl__print_conflict_stats, svn_cl__get_notifier):
   Remove the EXT_{TEXT,PROP,TREE}_CONFLICTS and EXT_SKIPPED_PATHS fields.
  (notify): Don't count conflicts in externals separately.

Review by: julianfoad

Modified:
    subversion/trunk/subversion/svn/notify.c

Modified: subversion/trunk/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=915796&r1=915795&r2=915796&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Wed Feb 24 14:06:07 2010
@@ -58,12 +58,6 @@
   unsigned int tree_conflicts;
   unsigned int skipped_paths;
 
-  /* Conflict stats for update and merge (for externals). */
-  unsigned int ext_text_conflicts;
-  unsigned int ext_prop_conflicts;
-  unsigned int ext_tree_conflicts;
-  unsigned int ext_skipped_paths;
-
   /* The cwd, for use in decomposing absolute paths. */
   const char *path_prefix;
 };
@@ -73,32 +67,19 @@
 svn_cl__print_conflict_stats(void *notify_baton, apr_pool_t *pool)
 {
   struct notify_baton *nb = notify_baton;
-  const char *header;
   unsigned int text_conflicts;
   unsigned int prop_conflicts;
   unsigned int tree_conflicts;
   unsigned int skipped_paths;
 
-  if (nb->in_external)
-    {
-      header = _("Summary of conflicts in external item:\n");
-      text_conflicts = nb->ext_text_conflicts;
-      prop_conflicts = nb->ext_prop_conflicts;
-      tree_conflicts = nb->ext_tree_conflicts;
-      skipped_paths = nb->ext_skipped_paths;
-    }
-  else
-    {
-      header = _("Summary of conflicts:\n");
-      text_conflicts = nb->text_conflicts;
-      prop_conflicts = nb->prop_conflicts;
-      tree_conflicts = nb->tree_conflicts;
-      skipped_paths = nb->skipped_paths;
-    }
+  text_conflicts = nb->text_conflicts;
+  prop_conflicts = nb->prop_conflicts;
+  tree_conflicts = nb->tree_conflicts;
+  skipped_paths = nb->skipped_paths;
 
   if (text_conflicts > 0 || prop_conflicts > 0
     || tree_conflicts > 0 || skipped_paths > 0)
-      SVN_ERR(svn_cmdline_printf(pool, "%s", header));
+      SVN_ERR(svn_cmdline_printf(pool, "%s", _("Summary of conflicts:\n")));
 
   if (text_conflicts > 0)
     SVN_ERR(svn_cmdline_printf
@@ -146,8 +127,7 @@
   switch (n->action)
     {
     case svn_wc_notify_skip:
-      nb->in_external ? nb->ext_skipped_paths++
-                      : nb->skipped_paths++;
+      nb->skipped_paths++;
       if (n->content_state == svn_wc_notify_state_missing)
         {
           if ((err = svn_cmdline_printf
@@ -194,8 +174,7 @@
       nb->received_some_change = TRUE;
       if (n->content_state == svn_wc_notify_state_conflicted)
         {
-          nb->in_external ? nb->ext_text_conflicts++
-                          : nb->text_conflicts++;
+          nb->text_conflicts++;
           if ((err = svn_cmdline_printf(pool, "C    %s\n", path_local)))
             goto print_error;
         }
@@ -210,8 +189,7 @@
       nb->received_some_change = TRUE;
       if (n->content_state == svn_wc_notify_state_conflicted)
         {
-          nb->in_external ? nb->ext_text_conflicts++
-                          : nb->text_conflicts++;
+          nb->text_conflicts++;
           statchar_buf[0] = 'C';
         }
       else
@@ -219,8 +197,7 @@
 
       if (n->prop_state == svn_wc_notify_state_conflicted)
         {
-          nb->in_external ? nb->ext_prop_conflicts++
-                          : nb->prop_conflicts++;
+          nb->prop_conflicts++;
           statchar_buf[1] = 'C';
         }
       else if (n->prop_state == svn_wc_notify_state_merged)
@@ -286,8 +263,7 @@
         nb->received_some_change = TRUE;
         if (n->content_state == svn_wc_notify_state_conflicted)
           {
-            nb->in_external ? nb->ext_text_conflicts++
-                            : nb->text_conflicts++;
+            nb->text_conflicts++;
             statchar_buf[0] = 'C';
           }
         else if (n->kind == svn_node_file)
@@ -391,8 +367,7 @@
       {
         if (n->content_state == svn_wc_notify_state_conflicted)
           {
-            nb->in_external ? nb->ext_text_conflicts++
-                            : nb->text_conflicts++;
+            nb->text_conflicts++;
             statchar_buf[0] = 'C';
           }
         else if (n->kind == svn_node_file)
@@ -405,8 +380,7 @@
 
         if (n->prop_state == svn_wc_notify_state_conflicted)
           {
-            nb->in_external ? nb->ext_prop_conflicts++
-                            : nb->prop_conflicts++;
+            nb->prop_conflicts++;
             statchar_buf[1] = 'C';
           }
         else if (n->prop_state == svn_wc_notify_state_merged)
@@ -451,8 +425,6 @@
         {
           svn_handle_warning2(stderr, n->err, "svn: ");
           nb->in_external = FALSE;
-          nb->ext_text_conflicts = nb->ext_prop_conflicts
-            = nb->ext_tree_conflicts = nb->ext_skipped_paths = 0;
           if ((err = svn_cmdline_printf(pool, "\n")))
             goto print_error;
         }
@@ -768,8 +740,7 @@
       break;
 
     case svn_wc_notify_tree_conflict:
-      nb->in_external ? nb->ext_tree_conflicts++
-                      : nb->tree_conflicts++;
+      nb->tree_conflicts++;
       if ((err = svn_cmdline_printf(pool, "   C %s\n", path_local)))
         goto print_error;
       break;
@@ -856,10 +827,6 @@
   nb->prop_conflicts = 0;
   nb->tree_conflicts = 0;
   nb->skipped_paths = 0;
-  nb->ext_text_conflicts = 0;
-  nb->ext_prop_conflicts = 0;
-  nb->ext_tree_conflicts = 0;
-  nb->ext_skipped_paths = 0;
   SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));
 
   *notify_func_p = notify;