[PATCH] Pass the mime-type to the notify callback
From: SteveKing <steveking_at_gmx.ch>
Date: 2004-01-24 21:20:05 CET
Hi,
While working on TSVN I wanted to show the user the mime-type of files
So I thought I'll do exactly that. Below is my patch. Tested with
Stefan
--- Don't blame me, I'm having a blonde moment! --- Log Message: Pass the mime-type of files to the notification callback so clients can use it. * subversion/libsvn_wc/update_editor.c (close_file): pass mime-type to callback function Index: subversion/libsvn_wc/update_editor.c =================================================================== --- subversion/libsvn_wc/update_editor.c (revision 8291) +++ subversion/libsvn_wc/update_editor.c (working copy) @@ -2311,15 +2311,27 @@ (prop_state != svn_wc_notify_state_unchanged)) { if (eb->notify_func) + { + const char * mimetype = NULL; + int i; + for (i = 0; i < propchanges->nelts; i++) + { + svn_prop_t *propchange + = &APR_ARRAY_IDX (propchanges, i, svn_prop_t); + + if (strcmp (propchange->name, SVN_PROP_MIME_TYPE) == 0) + mimetype = propchange->value->data; + } (*eb->notify_func) (eb->notify_baton, fb->path, fb->added ? svn_wc_notify_update_add : svn_wc_notify_update_update, svn_node_file, - NULL, /* ### use install_file() mimetype here */ + mimetype, content_state, prop_state, SVN_INVALID_REVNUM); + } } return SVN_NO_ERROR; }
Index: subversion/libsvn_wc/update_editor.c
---------------------------------------------------------------------
|
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.