FreeBSD/contrib/subversion/subversion/libsvn_client/diff.c
/* Display context diffs between two PATH/REVISION pairs.  Each of
   these inputs will be one of the following:

   - a repository URL at a given revision.
   - a working copy path, ignoring local mods.
   - a working copy path, including local mods.

   We can establish a matrix that shows the nine possible types of
   diffs we expect to support.


      ` .     DST ||  URL:rev   | WC:base    | WC:working |
          ` .     ||            |            |            |
      SRC     ` . ||            |            |            |
      ============++============+============+============+
       URL:rev    || (*)        | (*)        | (*)        |
                  ||            |            |            |
                  ||            |            |            |
                  ||            |            |            |
      ------------++------------+------------+------------+
       WC:base    || (*)        |                         |
                  ||            | New svn_wc_diff which   |
                  ||            | is smart enough to      |
                  ||            | handle two WC paths     |
      ------------++------------+ and their related       +
       WC:working || (*)        | text-bases and working  |
                  ||            | files.  This operation  |
                  ||            | is entirely local.      |
                  ||            |                         |
      ------------++------------+------------+------------+
      * These cases require server communication.
*/
Display context diffs between two PATH/REVISION pairs.  Each of
these inputs will be one of the following.

a repository URL at a given revision.
a working copy path, ignoring local mods.
a working copy path, including local mods.

We can establish a matrix that shows the nine possible types of
diffs we expect to support.


Display context diffs between two PATH / REVISION pairs . Each of these inputs will be one of the following . a repository URL at a given revision . a working copy path ignoring local mods . a working copy path including local mods . We can establish a matrix that shows the nine possible types of diffs we expect to support .
svn_error_t *
svn_client_diff6(const apr_array_header_t *options,
                 const char *path_or_url1,
                 const svn_opt_revision_t *revision1,
                 const char *path_or_url2,
                 const svn_opt_revision_t *revision2,
                 const char *relative_to_dir,
                 svn_depth_t depth,
                 svn_boolean_t ignore_ancestry,
                 svn_boolean_t no_diff_added,
                 svn_boolean_t no_diff_deleted,
                 svn_boolean_t show_copies_as_adds,
                 svn_boolean_t ignore_content_type,
                 svn_boolean_t ignore_properties,
                 svn_boolean_t properties_only,
                 svn_boolean_t use_git_diff_format,
                 const char *header_encoding,
                 svn_stream_t *outstream,
                 svn_stream_t *errstream,
                 const apr_array_header_t *changelists,
                 svn_client_ctx_t *ctx,
                 apr_pool_t *pool)
{
  diff_writer_info_t dwi = { 0 };
  svn_opt_revision_t peg_revision;
  const svn_diff_tree_processor_t *diff_processor;
  svn_diff_tree_processor_t *processor;
  if (ignore_properties && properties_only)
    return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
                            _("Cannot ignore properties and show only "
                              "properties at the same time"));
  peg_revision.kind = svn_opt_revision_unspecified;
  dwi.ddi.orig_path_1 = path_or_url1;
  dwi.ddi.orig_path_2 = path_or_url2;
  SVN_ERR(create_diff_writer_info(&dwi, options,
                                  ctx->config, pool));
  dwi.pool = pool;
  dwi.outstream = outstream;
  dwi.errstream = errstream;
  dwi.header_encoding = header_encoding;
  dwi.force_binary = ignore_content_type;
  dwi.ignore_properties = ignore_properties;
  dwi.properties_only = properties_only;
  dwi.relative_to_dir = relative_to_dir;
  dwi.use_git_diff_format = use_git_diff_format;
  dwi.no_diff_added = no_diff_added;
  dwi.no_diff_deleted = no_diff_deleted;
  dwi.show_copies_as_adds = show_copies_as_adds;
  dwi.cancel_func = ctx->cancel_func;
  dwi.cancel_baton = ctx->cancel_baton;
  dwi.wc_ctx = ctx->wc_ctx;
  dwi.ddi.session_relpath = NULL;
  dwi.ddi.anchor = NULL;
  processor = svn_diff__tree_processor_create(&dwi, pool);
  processor->dir_added = diff_dir_added;
  processor->dir_changed = diff_dir_changed;
  processor->dir_deleted = diff_dir_deleted;
  processor->file_added = diff_file_added;
  processor->file_changed = diff_file_changed;
  processor->file_deleted = diff_file_deleted;
  diff_processor = processor;
  if (show_copies_as_adds || use_git_diff_format)
    ignore_ancestry = FALSE;
  return svn_error_trace(do_diff(NULL, NULL, &dwi.ddi,
                                 path_or_url1, path_or_url2,
                                 revision1, revision2, &peg_revision,
                                 depth, ignore_ancestry, changelists,
                                 TRUE ,
                                 diff_processor, ctx, pool, pool));
}
svn_error_t * svn_client_diff6 ( const apr_array_header_t * options , const char * path_or_url1 , const svn_opt_revision_t * revision1 , const char * path_or_url2 , const svn_opt_revision_t * revision2 , const char * relative_to_dir , svn_depth_t depth , svn_boolean_t ignore_ancestry , svn_boolean_t no_diff_added , svn_boolean_t no_diff_deleted , svn_boolean_t show_copies_as_adds , svn_boolean_t ignore_content_type , svn_boolean_t ignore_properties , svn_boolean_t properties_only , svn_boolean_t use_git_diff_format , const char * header_encoding , svn_stream_t * outstream , svn_stream_t * errstream , const apr_array_header_t * changelists , svn_client_ctx_t * ctx , apr_pool_t * pool ) { diff_writer_info_t dwi = { 0 } ; svn_opt_revision_t peg_revision ; const svn_diff_tree_processor_t * diff_processor ; svn_diff_tree_processor_t * processor ; if ( ignore_properties && properties_only ) return svn_error_create ( SVN_ERR_INCORRECT_PARAMS , NULL , _ ( " " " " ) ) ; peg_revision . kind = svn_opt_revision_unspecified ; dwi . ddi . orig_path_1 = path_or_url1 ; dwi . ddi . orig_path_2 = path_or_url2 ; SVN_ERR ( create_diff_writer_info ( & dwi , options , ctx -> config , pool ) ) ; dwi . pool = pool ; dwi . outstream = outstream ; dwi . errstream = errstream ; dwi . header_encoding = header_encoding ; dwi . force_binary = ignore_content_type ; dwi . ignore_properties = ignore_properties ; dwi . properties_only = properties_only ; dwi . relative_to_dir = relative_to_dir ; dwi . use_git_diff_format = use_git_diff_format ; dwi . no_diff_added = no_diff_added ; dwi . no_diff_deleted = no_diff_deleted ; dwi . show_copies_as_adds = show_copies_as_adds ; dwi . cancel_func = ctx -> cancel_func ; dwi . cancel_baton = ctx -> cancel_baton ; dwi . wc_ctx = ctx -> wc_ctx ; dwi . ddi . session_relpath = NULL ; dwi . ddi . anchor = NULL ; processor = svn_diff__tree_processor_create ( & dwi , pool ) ; processor -> dir_added = diff_dir_added ; processor -> dir_changed = diff_dir_changed ; processor -> dir_deleted = diff_dir_deleted ; processor -> file_added = diff_file_added ; processor -> file_changed = diff_file_changed ; processor -> file_deleted = diff_file_deleted ; diff_processor = processor ; if ( show_copies_as_adds || use_git_diff_format ) ignore_ancestry = FALSE ; return svn_error_trace ( do_diff ( NULL , NULL , & dwi . ddi , path_or_url1 , path_or_url2 , revision1 , revision2 , & peg_revision , depth , ignore_ancestry , changelists , TRUE , diff_processor , ctx , pool , pool ) ) ; }
Display context diffs between two PATH/REVISION pairs.
Display context diffs between two PATH / REVISION pairs .
/* We will never do a pegged diff from here. */ /* setup callback and baton */ /* --show-copies-as-adds and --git imply --notice-ancestry */ /* text_deltas */