This is a first pass. It drives only the file methods in the diff processor API, not the open- and close-directory methods, and not reporting changes on directories.
* 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.