You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gb...@apache.org on 2013/09/26 19:16:52 UTC

svn commit: r1526609 - in /subversion/branches/invoke-diff-cmd-feature/subversion: libsvn_subr/io.c tests/cmdline/diff_tests.py

Author: gbg
Date: Thu Sep 26 17:16:52 2013
New Revision: 1526609

URL: http://svn.apache.org/r1526609
Log:
On the invoke-diff-cmd branch: Ensure that ineligible delimiters that
  have a special end characer are not modified.  Add new test.

* subversion/libsvn_subr/io.c

  (__create_custom_diff_cmd): Ensure that ineligible delimiters that
  have a special end characer are not modified.

* subversion/tests/cmdline/diff_tests.py

  (diff_invoke_external_diffcmd): Add new test.  Change the misleading
  term 'token' to 'delimiter' for consistency.



Modified:
    subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c
    subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c?rev=1526609&r1=1526608&r2=1526609&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c Thu Sep 26 17:16:52 2013
@@ -3181,10 +3181,7 @@ __create_custom_diff_cmd(const char *lab
                 {
                   /* it's a protected delimiter, so we consume one ';'  */
                   svn_stringbuf_remove(word, 0, 1);   
-                  
-                  /* put the special character back if it exists */
-                  if (special_end_marker) 
-                    svn_stringbuf_appendbyte(word, special_end_marker);
+                
                 }
             }
           else /* check that this is a regular delimiter (length 3) */
@@ -3208,11 +3205,12 @@ __create_custom_diff_cmd(const char *lab
                                       3, /* delimiter is always length 3 */
                                       tokens_tab[j].token,
                                       strlen(tokens_tab[j].token));
-
-                /* put the special character back if it exists */
-                if (special_end_marker) 
-                  svn_stringbuf_appendbyte(word, special_end_marker);
               }
+
+          /* put the special character back if it exists */
+          if (special_end_marker) 
+            svn_stringbuf_appendbyte(word, special_end_marker);
+
         }
       result[argv] = word->data;
     }  

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py?rev=1526609&r1=1526608&r2=1526609&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/diff_tests.py Thu Sep 26 17:16:52 2013
@@ -3289,17 +3289,18 @@ def diff_invoke_external_diffcmd(sbox):
       "iota	(working copy)\n",
       # assert correct file ;f2
       os.path.abspath("iota") + "\n",
-      # assert special end char is added ;f1+ -> (file)+
+      # assert special end char is added ;f1+ -> file+
       os.path.abspath(svntest.wc.text_base_path("iota")) + "+\n", 
-      ";f1\n",  # assert removal of ';' @ lower boundary '1' ;;f1  -> ;f1
-      ";;l3\n", # assert removal of ';' @ high boundary '3'  ;;;l3 -> ;;l3
-      ";;fo\n", # assert only eligible tokens are modified   ;;fo  -> ;;fo
-      ";f1o\n"  # assert correct length test of token        ;f1o ->  ;f1o
+      ";f1\n",  # assert removal of ';' @ lower boundary '1'     ;;f1  -> ;f1
+      ";;l3\n", # assert removal of ';' @ high boundary '3'      ;;;l3 -> ;;l3
+      ";;fo\n", # assert only eligible delimiters are modified   ;;fo  -> ;;fo
+      ";f1o\n", # assert correct length test of delimiter        ;f1o  -> ;f1o
+      ";f15+\n" # assert non-modification of ineligble delimiter ;f15+ -> ;f15+
       ])
 
   svntest.actions.run_and_verify_svn(None, expected_output, [],
    'diff',
-   '--invoke-diff-cmd='+diff_script_path+' ;l1 ;f1 ;l2 ;f2 ;f1+ ;;f1 ;;;l3 ;;fo ;f1o',
+   '--invoke-diff-cmd='+diff_script_path+' ;l1 ;f1 ;l2 ;f2 ;f1+ ;;f1 ;;;l3 ;;fo ;f1o ;f15+',
    iota_path)