[RFC] Introducing svn_client_make_diff_args? (Was: RE: svn commit: r33116 - in branches/ignore-mergeinfo/subversion: include libsvn_client svn)
From: Bert Huijben <bert_at_vmoo.com>
Date: Wed, 17 Sep 2008 12:47:13 +0200
> @@ -2225,8 +2228,36 @@ svn_client_blame(const char *path_or_url
This method has 5 different versions over 7 subversion point releases, each adding just on or a few 'optional' parameters.
Shouldn't we create some kind of context/args object that we can extend in future versions for methods that probably have yet another version in the next release?
Adding boolean number 4 to a function doesn't make user code more understandable, and with a context/args struct with a constructor function we can just extend that structure in the next release without breaking the ABI.
We do use argument structures in a few places in the subversion code (think user context, status, authorization, ...), but I think diff would be a good candidate to follow this construction. And there are probably a few other places that could benefit from such argument structures.
=====================
Using the old NSvn that followed the subversion arguments like most other bindings, you would use something like:
While a SharpSvn user would write something like:
[[
Client.Diff("a", "b", diffStream, args);
A little bit more code, but no need to set default values. I think everybody can understand it without looking at the documentation.
(Using C# 3.0 instead of 2.0 would allow you to use a more compact syntax)
Adding a new property to the args object does not break the ABI and does not require a new compatibility wrapper to maintain forever.
Bert
---------------------------------------------------------------------
|
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.