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/01/26 17:26:22 UTC

svn commit: r903307 - in /subversion/trunk/subversion: svn/notify.c tests/cmdline/patch_tests.py

Author: stsp
Date: Tue Jan 26 16:26:21 2010
New Revision: 903307

URL: http://svn.apache.org/viewvc?rev=903307&view=rev
Log:
Make svn patch a little less verbose again.

* subversion/svn/notify.c
  (notify): When notifying about hunks, print information about
   a hunk only if there was a problem with the hunk. Currently this
   either means the hunk had to be applied with an offset, or the
   hunk was rejected.

* subversion/tests/cmdline/patch_tests.py
  (patch_unidiff, patch_unidiff_absolute_paths, patch_chopped_leading_spaces,
   patch_unidiff_strip1): Adjust expected output.

Suggested by: danielsh

Modified:
    subversion/trunk/subversion/svn/notify.c
    subversion/trunk/subversion/tests/cmdline/patch_tests.py

Modified: subversion/trunk/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=903307&r1=903306&r2=903307&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Tue Jan 26 16:26:21 2010
@@ -290,14 +290,6 @@
 
     case svn_wc_notify_patch_applied_hunk:
       nb->received_some_change = TRUE;
-      if ((err = svn_cmdline_printf(pool,
-                                    ">         applied hunk "
-                                    "@@ -%lu,%lu +%lu,%lu @@",
-                                    n->hunk_original_start,
-                                    n->hunk_original_length,
-                                    n->hunk_modified_start,
-                                    n->hunk_modified_length)))
-        goto print_error;
       if (n->hunk_original_start != n->hunk_matched_line)
         {
           apr_int64_t off;
@@ -313,13 +305,16 @@
               off = n->hunk_original_start - n->hunk_matched_line;
               s = "-";
             }
-          if ((err = svn_cmdline_printf(pool,
-                                        " with offset %s%"APR_INT64_T_FMT,
+          if ((err = svn_cmdline_printf(pool, ">         applied hunk "
+                                        "@@ -%lu,%lu +%lu,%lu @@ "
+                                        "with offset %s%"APR_INT64_T_FMT"\n",
+                                        n->hunk_original_start,
+                                        n->hunk_original_length,
+                                        n->hunk_modified_start,
+                                        n->hunk_modified_length,
                                         s, off)))
             goto print_error;
         }
-      if ((err = svn_cmdline_printf(pool, "\n")))
-        goto print_error;
       break;
 
     case svn_wc_notify_patch_rejected_hunk:

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=903307&r1=903306&r2=903307&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Tue Jan 26 16:26:21 2010
@@ -187,13 +187,9 @@
 
   expected_output = [
     'U         %s\n' % os.path.join(wc_dir, 'A', 'D', 'gamma'),
-    '>         applied hunk @@ -1,1 +1,1 @@\n',
     'U         %s\n' % os.path.join(wc_dir, 'iota'),
-    '>         applied hunk @@ -1,1 +1,1 @@\n',
     'A         %s\n' % os.path.join(wc_dir, 'new'),
     'U         %s\n' % os.path.join(wc_dir, 'A', 'mu'),
-    '>         applied hunk @@ -6,6 +6,6 @@\n',
-    '>         applied hunk @@ -14,11 +17,11 @@\n',
     'D         %s\n' % os.path.join(wc_dir, 'A', 'B', 'E', 'beta'),
   ]
 
@@ -261,7 +257,6 @@
   lambda_path = os.path.join(os.path.sep, 'A', 'B', 'lambda')
   expected_output = [
     'U         %s\n' % os.path.join('A', 'B', 'E', 'alpha'),
-    '>         applied hunk @@ -1,1 +1,1 @@\n',
     'Skipped \'%s\'\n' % lambda_path,
     'Summary of conflicts:\n',
     '  Skipped paths: 1\n'
@@ -639,13 +634,9 @@
 
   expected_output = [
     'U         %s\n' % os.path.join(wc_dir, 'A', 'D', 'gamma'),
-    '>         applied hunk @@ -1,1 +1,1 @@\n',
     'U         %s\n' % os.path.join(wc_dir, 'iota'),
-    '>         applied hunk @@ -1,1 +1,1 @@\n',
     'A         %s\n' % os.path.join(wc_dir, 'new'),
     'U         %s\n' % os.path.join(wc_dir, 'A', 'mu'),
-    '>         applied hunk @@ -6,6 +6,6 @@\n',
-    '>         applied hunk @@ -14,11 +17,11 @@\n',
     'D         %s\n' % os.path.join(wc_dir, 'A', 'B', 'E', 'beta'),
   ]
 
@@ -813,13 +804,9 @@
 
   expected_output = [
     'U         %s\n' % os.path.join(wc_dir, 'A', 'D', 'gamma'),
-    '>         applied hunk @@ -1,1 +1,1 @@\n',
     'U         %s\n' % os.path.join(wc_dir, 'iota'),
-    '>         applied hunk @@ -1,1 +1,1 @@\n',
     'A         %s\n' % os.path.join(wc_dir, 'new'),
     'U         %s\n' % os.path.join(wc_dir, 'A', 'mu'),
-    '>         applied hunk @@ -6,6 +6,6 @@\n',
-    '>         applied hunk @@ -14,11 +17,11 @@\n',
     'D         %s\n' % os.path.join(wc_dir, 'A', 'B', 'E', 'beta'),
   ]