[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Diff Project --invoke-diff-cmd part

From: Gabriela Gibson <gabriela.gibson_at_gmail.com>
Date: Thu, 11 Apr 2013 22:39:24 +0100

This patch plugs in a new option --invoke-diff-cmd into the existing
diff command structure, but does leave the existing "diff-cmd" option
untouched.

This addition allows the user to define a complex diff command, to be
applied in place of the internal diff, for example:

svn diff --invoke-diff-cmd="kdiff3 -auto -o /home/g/log ---f1 ---f2 --L1
---l1 --L2 "MyLabel""

either on the command line(for example):

   svn diff --invoke-diff-cmd="diff -y ---f1 ---f2"

which expands to "diff -y *from *to",

or, in the config file by adding

   invoke-diff-cmd= diff -y ---f1 ---f2

where ---f1 ---f2 are file 1 and 2. and ---l1 ---l2 are labels.

What's missing:
--------------

* The merge part, --invoke-diff3-cmd.

* Tests. I will write them, but I have to spent some time reading
   into the test suite first.

* This patch breaks the override --internal-diff for now, because
   this part has to be revised anyway when the invoke-diff3-cmd part
   gets added.

* I added the help blurb to subversion/svn/svn.c:340 but svn help is
   not showing it. I will hunt for th reason over the weekend, I
   didn't want to delay the patch any longer.

Thanks for looking!

Gabriela

[[[
Add new diff option "--invoke-diff-cmd" which allows the user to
define a custom command line or config file entry for an external
diff program.

* subversion/include/svn_client.h
   (svn_client_diff7): Add new function.
   (svn_client_diff6): Remove deprecated function.

* subversion/include/svn_config.h
   (): Add new definition.

* subversion/include/svn_io.h
   (svn_io_create_custom_diff_cmd): Add new function.
   (svn_io_run_external_diff): Add new function.

* subversion/libsvn_client/deprecated.c
   (svn_client_diff6): Add deprecated function.

* subversion/libsvn_client/diff.c
   (struct diff_cmd_baton): Add new variable.
   (diff_content_changed): Add new conditional function call.
   (set_up_diff_cmd_and_options): Add new condition.

* subversion/libsvn_subr/config_file.c
   (svn_config_ensure): Add help text.

* subversion/libsvn_subr/io.c
   (svn_io_create_custom_diff_cmd): Add new function.
   (svn_io_run_external_diff): Add new function.

* subversion/svn/cl.h
   (struct svn_cl__opt_state_t): Add new variable.
   (struct svn_cl__opt_state_t.diff): Add new variable.

* subversion/svn/diff-cmd.c
   (svn_cl__diff): Modify call to deprecated function.

* subversion/svn/svn.c
   (svn_cl__options[]): Add new variable and help info.
]]]

Received on 2013-04-11 23:39:59 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.