[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Diff plugins

From: Sander Striker <striker_at_apache.org>
Date: 2003-02-14 16:44:58 CET

Hi,

I was thinking about the diff plugins... I think we can use the
same scheme as what we do with libsvn_auth, create diff providers.
The default providers will be our internal ones, others can be
added by third parties.

Something like:

  svn_diff_provider_t *svn_diff_provider_obtain(const char *mime_type, ...);
  svn_error_t *svn_diff_provider_register(svn_diff_provider_t *provider,
                                          int priority,
                                          apr_pool_t *pool);

  struct svn_diff_provider_t
  {
    svn_boolean_t (*match_fn)(const char *mime_type);
    svn_error_t * (*diff_fn)(apr_file_t *output_file,
                             const char *path1, const char *path2,
                             const char *label1, const char *label2,
                             const char *mime-type; /* XXX: provider could match
                                                       multiple mime-types. */
                             svn_config_t *config /* XXX: maybe?? */
                             apr_pool_t *pool);
  };

The default chain would look like:

 -> internal_diff_provider -> internal_binary_diff_provider
     (matches text/*) (matches *)

The internal_diff_provider would provide unified diff output like we
are used to today (no -x ... yet, we could add that later).

The internal_binary_diff_provider would just output: X an Y differ/are
the same.

Now (if the user defined some config option?) we could insert
external_diff_provider in front of the chain. Implementing
external_diff_provider is probably just moving svn_io_run_diff
and adding a match function. This isolates the entire return code of 0, 1 or
2 mess in the external_diff_provider.
Idea (making the above problem worse ;): let the external_diff_provider
read a config file which maps { mime-type : path/to/diff_of_choice }.
The match function the simply checks if there is an entry in the map.

Thoughts? Anyone got time to implement this? I'll take care of the
internal_diff_provider if need be.

Sander

PS. Since I don't have the time to implement this idea, my commits to the
    issue-405-internal-diff branch do not accomodate for this yet.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 14 16:45:44 2003

This is an archived mail posted to the Subversion Dev mailing list.