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 2015/03/06 01:40:43 UTC

svn commit: r1664533 - in /subversion/trunk/subversion: libsvn_wc/status.c tests/cmdline/stat_tests.py

Author: rhuijben
Date: Fri Mar  6 00:40:43 2015
New Revision: 1664533

URL: http://svn.apache.org/r1664533
Log:
Stop showing 'uninteresting deletes' in 'svn status' without -v. This
filters non-op_root deletes from the output. These deletes are implied
by their ancestor, as a delete automatically affects everything below
it.

So after this patch status just shows the root of a delete as deleted
and perhaps some children that are interesting for a different reason,
such as being conflicted or being moved away..

* subversion/libsvn_wc/status.c
  (svn_wc__internal_status_t): Add op_root boolean.
  (assemble_status): Tweak interesting filter.
  (hash_stash): Copy op_root.
  (is_sendable_status): Tweak interesting status.

* subversion/tests/cmdline/stat_tests.py
  (status_dash_u_deleted_directories): Update expected results. Extend
    test with '-v' behavior to also obtain existing results.

Modified:
    subversion/trunk/subversion/libsvn_wc/status.c
    subversion/trunk/subversion/tests/cmdline/stat_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1664533&r1=1664532&r2=1664533&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Fri Mar  6 00:40:43 2015
@@ -69,6 +69,7 @@ typedef struct svn_wc__internal_status_t
   svn_wc_status3_t s; /* First member; same pointer*/
 
   svn_boolean_t has_descendants;
+  svn_boolean_t op_root;
 
   /* Make sure to update hash_stash() when adding values here */
 } svn_wc__internal_status_t;
@@ -587,7 +588,8 @@ assemble_status(svn_wc__internal_status_
      This filter should match the filter in is_sendable_status() */
   if (! get_all)
     if (((node_status == svn_wc_status_none)
-         || (node_status == svn_wc_status_normal))
+         || (node_status == svn_wc_status_normal)
+         || (node_status == svn_wc_status_deleted && !info->op_root))
 
         && (! switched_p)
         && (! info->locked)
@@ -606,6 +608,7 @@ assemble_status(svn_wc__internal_status_
   inner_stat = apr_pcalloc(result_pool, sizeof(*inner_stat));
   stat = &inner_stat->s;
   inner_stat->has_descendants = info->has_descendants;
+  inner_stat->op_root = info->op_root;
 
   switch (info->kind)
     {
@@ -1484,6 +1487,7 @@ hash_stash(void *baton,
   /* Copy the internal/private data. */
   svn_wc__internal_status_t *is = new_status;
   is->has_descendants = old_status->has_descendants;
+  is->op_root = old_status->op_root;
 
   assert(! svn_hash_gets(stat_hash, path));
   svn_hash_sets(stat_hash, apr_pstrdup(hash_pool, path), new_status);
@@ -1865,7 +1869,9 @@ is_sendable_status(const svn_wc__interna
 
   /* If the text, property or tree state is interesting, send it. */
   if ((status->node_status != svn_wc_status_none)
-       && (status->node_status != svn_wc_status_normal))
+       && (status->node_status != svn_wc_status_normal)
+       && !(status->node_status == svn_wc_status_deleted
+            && !i_status->op_root))
     return TRUE;
 
   /* If it's switched, send it. */

Modified: subversion/trunk/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/stat_tests.py?rev=1664533&r1=1664532&r2=1664533&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/stat_tests.py Fri Mar  6 00:40:43 2015
@@ -1598,44 +1598,81 @@ def status_dash_u_deleted_directories(sb
 
   # check status -u of B
   expected = svntest.verify.UnorderedOutput(
-         ["D                1   %s\n" % "B",
-          "D                1   %s\n" % os.path.join("B", "lambda"),
-          "D                1   %s\n" % os.path.join("B", "E"),
-          "D                1   %s\n" % os.path.join("B", "E", "alpha"),
-          "D                1   %s\n" % os.path.join("B", "E", "beta"),
-          "D                1   %s\n" % os.path.join("B", "F"),
+         ["D                1        1 jrandom      %s\n" % \
+                                        "B",
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("B", "lambda"),
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("B", "E"),
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("B", "E", "alpha"),
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("B", "E", "beta"),
+          "D                1        1 jrandom      %s\n" % 
+          os.path.join("B", "F"),
           "Status against revision:      1\n" ])
   svntest.actions.run_and_verify_svn(expected,
                                      [],
+                                     "status", "-u", "-v", "B")
+
+  expected = \
+         ["D                1   %s\n" % "B",
+          "Status against revision:      1\n" ]
+  svntest.actions.run_and_verify_svn(expected,
+                                     [],
                                      "status", "-u", "B")
 
+
   # again, but now from inside B, should give the same output
   if not os.path.exists('B'):
     os.mkdir('B')
   os.chdir("B")
   expected = svntest.verify.UnorderedOutput(
-         ["D                1   %s\n" % ".",
-          "D                1   %s\n" % "lambda",
-          "D                1   %s\n" % "E",
-          "D                1   %s\n" % os.path.join("E", "alpha"),
-          "D                1   %s\n" % os.path.join("E", "beta"),
-          "D                1   %s\n" % "F",
+         ["D                1        1 jrandom      %s\n" % \
+                                        ".",
+          "D                1        1 jrandom      %s\n" % \
+                                        "lambda",
+          "D                1        1 jrandom      %s\n" % \
+                                        "E",
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("E", "alpha"),
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("E", "beta"),
+          "D                1        1 jrandom      %s\n" % \
+                                        "F",
           "Status against revision:      1\n" ])
   svntest.actions.run_and_verify_svn(expected,
                                      [],
+                                     "status", "-u", "-v", ".")
+
+  expected = \
+         ["D                1   %s\n" % ".",
+          "Status against revision:      1\n" ]
+  svntest.actions.run_and_verify_svn(expected,
+                                     [],
                                      "status", "-u", ".")
 
   # check status -u of B/E
   expected = svntest.verify.UnorderedOutput(
-         ["D                1   %s\n" % os.path.join("B", "E"),
-          "D                1   %s\n" % os.path.join("B", "E", "alpha"),
-          "D                1   %s\n" % os.path.join("B", "E", "beta"),
+         ["D                1        1 jrandom      %s\n" % \
+                                        os.path.join("B", "E"),
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("B", "E", "alpha"),
+          "D                1        1 jrandom      %s\n" % \
+                                        os.path.join("B", "E", "beta"),
           "Status against revision:      1\n" ])
 
   os.chdir(was_cwd)
   os.chdir(A_path)
   svntest.actions.run_and_verify_svn(expected,
                                      [],
+                                     "status", "-u", "-v",
+                                     os.path.join("B", "E"))
+
+
+  expected = [ "Status against revision:      1\n" ]
+  svntest.actions.run_and_verify_svn(expected,
+                                     [],
                                      "status", "-u",
                                      os.path.join("B", "E"))