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

proposal: diff preview for gui client

From: Martin Hauner <martin.hauner_at_gmx.net>
Date: 2005-06-08 22:37:29 CEST

Hello,

on Julians request I retry to gather the requirements for the gui
diff preview. I don't consider diff summarize here so we don't mix
the requirements between the two issues.

I hope this helps to make some progress on this issue. :)

This is about getting a usable gui interface for diffs between urls
like tags or branches.

A usable interface for a gui client is to present a list of modified
items between the diff targets as a diff preview. The user can then
decide on which item she likes to see a detailed diff in a visual diff
tool by running a normal diff on the items of the list.

The diff preview should take the same (diff) parameters as diff and
diff_peg and should provide the following information:

for each modified item:

- if it was added, modified or deleted

- if it has property changes

- the items path relative to its diff target (as in a normal diff)
   Possibly two paths: its old and new name if the item was moved or
   copied.

- if it is a folder or a file (it doesn't make sense to run a visual
   diff on a folder)

- its mime type (the gui could decide based on the mime type which
   diff tool to run, ie. binary or text)

There is currently no way to get a diff preview from the svn api. The
only known solution is to parse the text output from diff for the
Index: or ---/+++ lines.

I think the svn api is missing a clean way to provide this information.

In the thread "show diffs in a gui client, how to get a list of changed
files?" people like to see this info or a similar info in the shell too.

To the cli users: Is it the same info like above or is it more like
issue #2015, diff summarize?

Implementation for gui:

To get the information for the gui use case i would like to see two
new api calls svn_client_diff_preview/svn_client_diff_preview_peg or
new parameters to svn_client_diff2/svn_client_diff_peg2 to return the
preview info. I think it would be nice to provide this info through
an svn_client_status like callback and structure.

typedef void (*svn_diff_preview_func_t) (void *preview_baton,
                                          svn_diff_preview_t *diff);

typedef struct svn_diff_preview_t
{
   /** file or dir */
   svn_node_kind_t node_kind;

   /** item paths, relative to the old diff target and new diff target */
   const char* path_old;
   const char* path_new;

   /** the mime types of old and new */
   const char *mimetype_old,
   const char *mimetype_new,

   /** change kind: unchanged, added, modified or deleted */
   svn_preview_kind_t preview_kind;

   /** properties changed? */
   svn_boolean_t props_changed;

} svn_diff_preview_t;

This information is easily provided through a new implementation
of svn_wc_diff_callbacks2_t. The callbacks already provide all the
needed information and could simply create an svn_diff_preview_t
and pass it to svn_diff_preview_func_t.

-- 
Martin
Subcommander, http://subcommander.tigris.org
a crossplatform Win32/Unix/MacOSX svn gui client & diff/merge tool.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 8 22:36:20 2005

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