subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1436303 - in /subversion/trunk/subversion: libsvn_client/patch.c tests/cmdline/patch_tests.py
Date Mon, 21 Jan 2013 12:28:56 GMT
Author: rhuijben
Date: Mon Jan 21 12:28:56 2013
New Revision: 1436303

URL: http://svn.apache.org/viewvc?rev=1436303&view=rev
Log:
* subversion/libsvn_client/patch.c
  (readline): Count a linenumber when we read a line, instead of when we can
    read another line. This makes sure 1 line files start with line 1, like
    any other file.
    
* subversion/tests/cmdline/patch_tests.py
  (single_line_mismatch): Remove XFail marker and update expected
    error specifics.

Modified:
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/tests/cmdline/patch_tests.py

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1436303&r1=1436302&r2=1436303&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Mon Jan 21 12:28:56 2013
@@ -1173,7 +1173,11 @@ readline(target_content_t *content,
                                        NULL, FALSE,
                                        content->keywords, FALSE,
                                        result_pool));
-  if (! content->eof)
+
+  /* Increase the line number if a line is read. An easy !eof won't work,
+     because that won't count the last and sometime only line.
+     (And using line number 0 gives all kinds of problems) */
+  if (line_raw->size > 0 || eol_str)
     content->current_line++;
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1436303&r1=1436302&r2=1436303&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Mon Jan 21 12:28:56 2013
@@ -4359,7 +4359,6 @@ def patch_replace_dir_with_file_and_vv(s
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'patch', patch_file_path, sbox.wc_dir)
 
-@XFail()
 @Issue(4297)
 def single_line_mismatch(sbox):
   "single line replacement mismatch"
@@ -4388,6 +4387,9 @@ def single_line_mismatch(sbox):
   # But yet it shows up as deleted instead of conflicted
   expected_output = [
     'C         %s\n' % sbox.ospath('test'),
+    '>         rejected hunk @@ -1,1 +1,1 @@\n',
+    'Summary of conflicts:\n',
+    '  Text conflicts: 1\n',
   ]
 
   svntest.actions.run_and_verify_svn(None, expected_output, [],



Mime
View raw message