* subversion/libsvn_client/shelf.c (file_changed, file_deleted, file_added): New. (diff_baton_t, diff_visitor): Drive a diff-processor from shelved changes. (svn_client__shelf_diff): New. (svn_client_shelf_export_patch): Delete the body; it is deprecated and did nothing before.
* subversion/svn/shelf-cmd.c (shelf_diff): First obtain a diff writer. Then call the shelf-diff API, driving that writer.
* subversion/tests/cmdline/shelf_tests.py (shelf_diff_simple): New test. (test_list): Run it.
Revert r1704048 (merge of 'reuse-ra-session' branch): unfortunately the code is not ready for trunk. The most serious problem that we cannot assume that API user doesn't change svn_client_ctx_t fields like AUTH_BATON or OPEN_TUNNEL_FUNC between svn_client_*() functions invocation. JavaHL bindings is one example of usage of such pattern.
I'll revive 'reuse-ra-session' branch and attempt to fix these problems there.