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/10/12 16:06:33 UTC

svn commit: r1531535 - in /subversion/branches/invoke-diff-cmd-feature: BRANCH-README subversion/svn/svn.c

Author: gbg
Date: Sat Oct 12 14:06:33 2013
New Revision: 1531535

URL: http://svn.apache.org/r1531535
Log:
On the invoke-diff-cmd branch: Update BRANCH-README file.  Update
'diff' help.

* BRANCH-README:
  Update to reflect current state.
  (svn_io_create_custom_diff_cmd): Remove.  
    
* subversion/svn/svn.c
  (svn_cl__options): Update help info for invoke-diff-cmd,

Modified:
    subversion/branches/invoke-diff-cmd-feature/BRANCH-README
    subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c

Modified: subversion/branches/invoke-diff-cmd-feature/BRANCH-README
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/BRANCH-README?rev=1531535&r1=1531534&r2=1531535&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/BRANCH-README (original)
+++ subversion/branches/invoke-diff-cmd-feature/BRANCH-README Sat Oct 12 14:06:33 2013
@@ -1,26 +1,126 @@
-This branch implements the 'invoke-diff-cmd' feature.
+This branch implements the 'invoke-diff-cmd' feature and is located at 
+https://svn.apache.org/repos/asf/subversion/branches/invoke-diff-cmd-feature/
 
---invoke-diff-cmd calls an external diff command with a user-defined
-  arbitrary command.
+It is a feature branch, receiving regular sync merges from /trunk, and
+expected to be reintegrated back thereto.
 
---invoke-diff-cmd is currently is implemented for 'diff', 'log',
-  'svnlook' and the config file.
+See: http://subversion.tigris.org/issues/show_bug.cgi?id=2044 for the
+original motivation for this project.
 
-Also see: http://subversion.tigris.org/issues/show_bug.cgi?id=2044
+--invoke-diff-cmd allows command line selection of an external diff
+program and will be extended to cover the existing diff3 option with a
+similar --invoke-diff3-cmd option.
 
-DONE
+Currently this capability is provided by user written shell scripts
+which are passed as the diff program via the svn config file.
 
-   * deprechate svn_io_run_diff2()
+--invoke-diff-cmd is currently implemented for 'diff', 'log',
+'svnlook' and the config file.
 
 
-TODO:
+What --invoke-diff-cmd and --invoke-diff3-cmd provide
+------------------------------------------------------
+
+Users can type 'free-style' command lines for their selected
+diff/merge program, from 'svn help diff':
+
+  --invoke-diff-cmd ARG:
+
+   use ARG as format string for external diff command
+   invocation. 
+               
+   Substitutions: ;f1 original file                       
+                  ;f2 changed file                        
+                  ;l1 label of the original file          
+                  ;l2 label of the changed file           
+   Examples: --invoke-diff-cmd="diff -y ;f1 ;f2"        
+      --invoke-diff-cmd="kdiff3 -auto -o /home/u/log \  
+        +;f1 ;l2 --L1 ;l1 --L2 "Custom Label" "        
+
+   The delimiter ';' can be escaped by adding a ';', which will be
+   consumed in the process.  The delimiter can appear anywhere in the
+   string, ie, file=;f1 will expand as expected and file=;;f1 will be
+   rendered as file=;f1.
+
+Structure of the feature:
+=========================
+
+API components 
+--------------
+
+   ./subversion/libsvn_subr/io.c:3030 __create_custom_diff_cmd()
+ 
+   transforms the user input 'invoke-diff-cmd' into a command line
+   call by substitution the file names, whilst leaving everything else
+   untouched.  This is more of an internal routine and probably not
+   well placed in the API.  It will be reused for the merge part of
+   this project.
+
+   NOTE:  
+
+   ./subversion/libsvn_subr/io.c:3108 svn_io_run_external_diff()
+
+   calls svn_io_create_custom_diff_cmd() and does all the error
+   checking required, before routing the result to the actual call to
+   the APR routine that makes it.
+ 
+
+UI components
+-------------
+
+  --invoke-diff-cmd and its user interface components for the command
+  line have been installed everywhere where --diff-cmd is available,
+  in svnlook.c, svn.c, svnlog.c.
 
-  * figure out if/how to solve file-type issue
-    http://subversion.tigris.org/issues/show_bug.cgi?id=2447
+  Users can specify the following mutually exclusive options:
 
-  * add invoke-diff-3-cmd as per:  issue 2447
+  --invoke-diff-cmd, --diff-cmd and --internal-diff-cmd, and also
+  define what diff program to use via the ./svn/config file, using the
+  new config file parameter "invoke-diff-cmd"..
+
+  The selection first defaults to the internal diff program, then to
+  the config file entry (if defined) which in turn is overridden when
+  one of --invoke-diff-cmd, --diff-cmd or --internal-diff-cmd are
+  invoked.
+
+
+Changes to the existing code structure:
+=======================================
+
+the original --diff-cmd parsing and routing code has been deprecated
+and the call to --diff-cmd is now handled by the
+svn_io_create_custom_diff_cmd() and svn_io_run_external_diff()
+routines.  All the original functionality and user syntax has been
+retained.
+
+TESTS
+=====
+
+The test for this feature is
+
+/subversion/tests/cmdline/diff_tests.py diff_invoke_external_diffcmd
+
+
+The test for the updated --diff-cmd is 
+
+/subversion/tests/cmdline/diff_tests.py diff_external_diffcmd
+
+
+TODO:
+====
 
-  * consider adding to svn up, see issue:
-    http://subversion.tigris.org/issues/show_bug.cgi?id=3836
+  * add invoke-diff-cmd option to the blame section
+  
+  * add help info to log, svnlook, blame
+
+  * Adding invoke-diff-cmd to merge:
+    add --invoke-diff-3-cmd using the svn_io_create_custom_diff_cmd()
+    and creating a new svn_io_run_external_merge function to manage
+    the external call in the same way that svn_io_run_external_diff
+    does.  Add the necessary UI components.  Add --invoke-diff-3-cmd
+    to 'svn up'.
 
+  * Fix the issue of unclear labels being displayed in external merge
+    programs:
 
+       http://subversion.tigris.org/issues/show_bug.cgi?id=3836

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c?rev=1531535&r1=1531534&r2=1531535&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/svn/svn.c Sat Oct 12 14:06:33 2013
@@ -364,21 +364,13 @@ const apr_getopt_option_t svn_cl__option
                       "                             "
                       "     +;f1 ;l2 --L1 ;l1 --L2 \"Custom Label\" \"        \n"
                       "                             "
-                      "The delimiter  ';' can be escaped in case ';f1', ';f2',\n"
+                      "The delimiter ';' can be escaped by adding a ';', which\n"
                       "                             "
-                      "';l1' and ';l2' should be preserved.  Ie. ';;f1' will  \n"          
+                      "will be consumed in the process.  The delimiter can    \n"
                       "                             "
-                      "be rendered as ';f1' and ';;;;f1' as ';;;f1'.          \n"
+                      "appear anywhere in the string, ie, file=;f1 will expand\n"
                       "                             "
-                      "Any other instances of ';' or multiples thereof not    \n"
-                      "                             "
-                      "accompanied by f1, f2, l1 or l3 will not be modified.  \n"
-                      "                             "
-		      "Non-alphanumeric characters at the beginning or the end\n"
-                      "                             "
-		      "are permitted, ie. +;f1, ;f1+ and +;f1+                \n"
-
-
+                      "as expected and file=;;f1 will be rendered as file=;f1.\n"
      )},
   {"internal-diff", opt_internal_diff, 0,
                        N_("override diff-cmd specified in config file")},