Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-2378

diff preview for UI clients




      Summary from Martin Hauner on the mailing list (see URL for list thread):
      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
      - 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.
      If possible, this information should be provided without having the API do the
      full diff in the background. The actual diff isn't needed and would only waste
      time and bandwidth to do and transfer the diff data.





            Unassigned Unassigned
            steveking Stefan K√ľng
            0 Vote for this issue
            0 Start watching this issue