svn commit: r1921600 - in /subversion/trunk/subversion: include/private/svn_client_private.h libsvn_client/diff.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Sun Oct 27 19:29:58 2024
New Revision: 1921600

URL: http://svn.apache.org/viewvc?rev=1921600&view=rev
Log:
Move diff_driver_info_t structure definition from the diff.c file to a
private header svn_client_private.h, since it might be utilized by any
other diff writer, implemented in separate source file. Rename the struct
to include svn_client prefix in order to satisfy with naming conventions.

A comment describing the diff_driver_info_t structure states that
`used by the diff writer`, so should be accessible for the implementation.

This commit is a preparation to move a general diff writer (for unidiff)
to a separate file.

* subversion/include/private/svn_client_private.h
  (svn_client__diff_driver_info_t): Declare structure; moved from diff.c.
* subversion/libsvn_client/diff.c
  (diff_driver_info_t): Remove declaration; Moved to svn_client_private.h.
  (...everywhere): Adjust references to diff_driver_info_t to
   svn_client__diff_driver_info_t in order to deal with it renamed.

Modified:
    subversion/trunk/subversion/include/private/svn_client_private.h
    subversion/trunk/subversion/libsvn_client/diff.c

Modified: subversion/trunk/subversion/include/private/svn_client_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_client_private.h?rev=1921600&r1=1921599&r2=1921600&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_client_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_client_private.h Sun Oct 27 19:29:58 2024
@@ -160,6 +160,30 @@ const char *
 svn_client__pathrev_fspath(const svn_client__pathrev_t *pathrev,
                            apr_pool_t *result_pool);
 
+/* State provided by the diff drivers; used by the diff writer */
+typedef struct svn_client__diff_driver_info_t
+{
+  /* The anchor to prefix before wc paths */
+  const char *anchor;
+
+  /* Relative path of ra session from repos_root_url.
+
+     Used only in printing git diff headers. The repository-root-relative
+     path of ... ### what user-visible property of the diff? */
+  const char *session_relpath;
+
+  /* Used only in printing git diff headers. Used to find the
+     repository-root-relative path of a WC path. */
+  svn_wc_context_t *wc_ctx;
+
+  /* The original targets passed to the diff command.  We may need
+     these to construct distinctive diff labels when comparing the
+     same relative path in the same revision, under different anchors
+     (for example, when comparing a trunk against a branch). */
+  const char *orig_path_1;
+  const char *orig_path_2;
+} svn_client__diff_driver_info_t;
+
 /* Given PATH_OR_URL, which contains either a working copy path or an
    absolute URL, a peg revision PEG_REVISION, and a desired revision
    REVISION, create an RA connection to that object as it exists in

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1921600&r1=1921599&r2=1921600&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Sun Oct 27 19:29:58 2024
@@ -70,30 +70,6 @@
                           _("Path '%s' must be an immediate child of " \
                             "the directory '%s'"), path, relative_to_dir)
 
-/* State provided by the diff drivers; used by the diff writer */
-typedef struct diff_driver_info_t
-{
-  /* The anchor to prefix before wc paths */
-  const char *anchor;
-
-  /* Relative path of ra session from repos_root_url.
-
-     Used only in printing git diff headers. The repository-root-relative
-     path of ... ### what user-visible property of the diff? */
-  const char *session_relpath;
-
-  /* Used only in printing git diff headers. Used to find the
-     repository-root-relative path of a WC path. */
-  svn_wc_context_t *wc_ctx;
-
-  /* The original targets passed to the diff command.  We may need
-     these to construct distinctive diff labels when comparing the
-     same relative path in the same revision, under different anchors
-     (for example, when comparing a trunk against a branch). */
-  const char *orig_path_1;
-  const char *orig_path_2;
-} diff_driver_info_t;
-
 
 /* Calculate the repository relative path of DIFF_RELPATH, using
  * SESSION_RELPATH and WC_CTX, and return the result in *REPOS_RELPATH.
@@ -458,7 +434,7 @@ print_git_diff_header(svn_stream_t *os,
                       apr_hash_t *right_props,
                       const char *git_index_shas,
                       const char *header_encoding,
-                      const diff_driver_info_t *ddi,
+                      const svn_client__diff_driver_info_t *ddi,
                       apr_pool_t *scratch_pool)
 {
   const char *repos_relpath1;
@@ -613,7 +589,7 @@ display_prop_diffs(const apr_array_heade
                    svn_boolean_t show_diff_header,
                    svn_boolean_t use_git_diff_format,
                    svn_boolean_t pretty_print_mergeinfo,
-                   const diff_driver_info_t *ddi,
+                   const svn_client__diff_driver_info_t *ddi,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
                    apr_pool_t *scratch_pool)
@@ -748,7 +724,7 @@ typedef struct diff_writer_info_t
   svn_cancel_func_t cancel_func;
   void *cancel_baton;
 
-  struct diff_driver_info_t ddi;
+  struct svn_client__diff_driver_info_t ddi;
 } diff_writer_info_t;
 
 /* An helper for diff_dir_props_changed, diff_file_changed and diff_file_added
@@ -1917,7 +1893,7 @@ diff_wc_wc(const char *path1,
 
    All other options are the same as those passed to svn_client_diff7(). */
 static svn_error_t *
-diff_repos_repos(struct diff_driver_info_t *ddi,
+diff_repos_repos(struct svn_client__diff_driver_info_t *ddi,
                  const char *path_or_url1,
                  const char *path_or_url2,
                  const svn_opt_revision_t *revision1,
@@ -2095,7 +2071,7 @@ diff_repos_repos(struct diff_driver_info
 
    All other options are the same as those passed to svn_client_diff7(). */
 static svn_error_t *
-diff_repos_wc(struct diff_driver_info_t *ddi,
+diff_repos_wc(struct svn_client__diff_driver_info_t *ddi,
               const char *path_or_url1,
               const svn_opt_revision_t *revision1,
               const svn_opt_revision_t *peg_revision1,
@@ -2436,7 +2412,7 @@ diff_shelves(const apr_array_header_t *c
 
 /* This is basically just the guts of svn_client_diff[_summarize][_peg]6(). */
 static svn_error_t *
-do_diff(diff_driver_info_t *ddi,
+do_diff(svn_client__diff_driver_info_t *ddi,
         const char *path_or_url1,
         const char *path_or_url2,
         const svn_opt_revision_t *revision1,
@@ -2638,7 +2614,7 @@ create_diff_writer_info(diff_writer_info
  */
 static svn_error_t *
 get_diff_processor(svn_diff_tree_processor_t **diff_processor,
-                   struct diff_driver_info_t **ddi,
+                   struct svn_client__diff_driver_info_t **ddi,
                    const apr_array_header_t *options,
                    const char *relative_to_dir,
                    svn_boolean_t no_diff_added,
@@ -2720,7 +2696,7 @@ svn_client__get_diff_writer_svn(
                 svn_client_ctx_t *ctx,
                 apr_pool_t *pool)
 {
-  struct diff_driver_info_t *ddi;
+  struct svn_client__diff_driver_info_t *ddi;
 
   SVN_ERR(get_diff_processor(diff_processor, &ddi,
                              options,
@@ -2804,7 +2780,7 @@ svn_client_diff7(const apr_array_header_
 {
   svn_opt_revision_t peg_revision;
   svn_diff_tree_processor_t *diff_processor;
-  struct diff_driver_info_t *ddi;
+  struct svn_client__diff_driver_info_t *ddi;
 
   if (ignore_properties && properties_only)
     return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
@@ -2867,7 +2843,7 @@ svn_client_diff_peg7(const apr_array_hea
                      apr_pool_t *pool)
 {
   svn_diff_tree_processor_t *diff_processor;
-  struct diff_driver_info_t *ddi;
+  struct svn_client__diff_driver_info_t *ddi;
 
   if (ignore_properties && properties_only)
     return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.