You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Gabriela Gibson <ga...@gmail.com> on 2013/04/16 18:54:37 UTC
Subversion InstantPlayground patch
Here is a little dev toy for casual submitters and people who just
want to have a quick play with the svn source, or perhaps use svn as a
framework to explore one of the API's that svn uses.
The patch sets up a new option for the svn diff command called
'InstantPlayground' and puts a function called
InstantPlaygroundFunction into subversion/libsvn_client/diff.c
together with all the parameters needed for playing with the svn
diff code.
It also demonstrates how to set up a command line option, so
people who want something different should easily be able to use
this as a guide, even if the patch eventually goes 'out of date'.
It's not meant for committing, but I thought that other people
might find this little tool as useful as I do, so here it is :)
To use it, apply the patch, then open diff.c and find the
InstantPlaygroundFunction, where your code will go.
[[[
This is a demonstration patch that shows how to add a new sub command
to the svn command line structure for the diff command.
This is aimed at casual submitters or anyone who wants a quick
'ready-to-play' set-up to explore svn or to use svn as a framework
to to play with the API's svn uses.
To call your code from the command line, do:
svn diff --InstantPlayground="your input here"
* subversion/include/svn_client.h (svn_client_diff6):
Add the InstantPlayground char* parameter that contains the input
string to the parameter list.
* subversion/libsvn_client/deprecated.c
(svn_client_diff5): Add the InstantPlayground char* parameter to
the call this deprecated function makes to svn_client_diff6.
(InstantPlaygroundFunction): Your code goes here. The parameter
'diff_cmd_baton' contains everything that would be normally passed
into the svn diff domain.
* subversion/libsvn_client/diff.c (diff_cmd_baton):
Define the char* InstantPlayground variable within the
diff_cmd_baton structure.
(svn_client_diff6): Add the InstantPlayground char* parameter that
contains the input string to the parameter list, assign it to
diff_cmd_baton and reroute the call to the InstantPlaygroundFunction
instead of do_diff).
* subversion/svn/cl.h (svn_cl__opt_state_t):
Add the char* InstantPlayground field to the diff command structure
contained within the svn diff command options.
* subversion/svn/diff-cmd.c
(svn_cl__diff): Call svnclient_diff6 with the new parameter char *
InstantPlayground added.
* subversion/svn/svn.c
(svn_cl__longopt_t): Define the opt_InstantPlayground parameter to the
long options list that do not have a short option.
(svn_cl__options): This is the main list of svn command line options
and we're adding the opt_InstantPlayground as a sub option to the
diff group within.
(svn_cl__cmd_table): Add opt_InstantPlayground to the list of diff
sub options that can be called.
(sub_main): Assign the input string passed on the command line to the
opt_InstantPlayground variable.
]]]