A few more thought, mostly for the next release:
* svn_client_shelf_save_new_version3 takes two callback functions, but
they both have the same type. So why not just change that API to take
one callback but provide a 'failed' flag instead?
* when a shelve operation fails, we have to remove the version with
svn_client_shelf_delete_newer_versions. But if there are no more
versions left, the shelf itself is not removed. So while testing I ended
up with several empty shelves. I'm now using
svn_client_shelf_get_all_versions to count how many versions are left
and if there are none I'm calling svn_client_shelf_delete. I think
svn_client_shelf_delete_newer_versions should do that automatically.
Unless of course there's a reason why empty shelves can exist?
* maybe this one can make it into 1.11: the doc comments don't mention
that the version numbers are 1 based, not 0 based. On my first test, I
ended up calling svn_client_shelf_version_open with version = 0, which
of course returned an error. So I noticed it right away. But I still
think this should be in the doc comments - I assume that most devs using
this API are not VB programmers :)
* some thoughts in general: I think for svn_client_ API's, the
shelf-API's don't really 'fit' in. The way they work now they're very
flexible, but not really from a client point of view. For example, to do
a shelve operation you first have to open/create the shelf, save the new
version and close the shelf. And if there are errors, you also have to
clean up separately. For an svn_client_ API I would expect one API call
that does this job, including cleaning up in case of an error. Compared
to e.g. svn_client_log() that API does the whole job, no need to first
open the connection, send the request and get the data, then close the
connection - the API does all this in one call.
So for the shelf API I would expect it something like this:
svn_client_shelf(shelveName, wcPath, logMsg, depth, keeplocal);
and it would do everything automatically.
Not very urgent, just something you might want to consider.
in case you're interested, here are screenshots of the shelve and
unshelve dialog I did in TSVN:
https://svn.osdn.net/svnroot/tortoisesvn/trunk/doc/images/en/Shelve.png
https://svn.osdn.net/svnroot/tortoisesvn/trunk/doc/images/en/Unshelve.png
Stefan
Received on 2018-09-15 17:41:26 CEST