[Xfce4-commits] [thunar-plugins/thunar-vcs-plugin] 01/01: Replace deprecated svn functions

noreply at xfce.org noreply at xfce.org
Wed May 30 05:12:14 CEST 2018


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository thunar-plugins/thunar-vcs-plugin.

commit 7215a0c1f37c6e73f47a240136923af37ebb189d
Author: Andre Miranda <andreldm at xfce.org>
Date:   Wed May 30 00:10:23 2018 -0300

    Replace deprecated svn functions
    
    Some functions were not straighforward to replace, part of code
    was based on wrappers from libsvn_client/deprecated.c.
---
 thunar-vcs-plugin/tvp-svn-backend.c        | 41 +++++++++++-----
 thunar-vcs-plugin/tvp-svn-backend.h        | 10 +++-
 tvp-svn-helper/tsh-add.c                   | 20 +++++++-
 tvp-svn-helper/tsh-blame.c                 |  1 -
 tvp-svn-helper/tsh-cleanup.c               | 23 ++++++++-
 tvp-svn-helper/tsh-commit.c                | 37 ++++++++++----
 tvp-svn-helper/tsh-common.c                |  5 +-
 tvp-svn-helper/tsh-common.h                | 14 ++++--
 tvp-svn-helper/tsh-copy.c                  | 20 +++++---
 tvp-svn-helper/tsh-delete.c                |  1 -
 tvp-svn-helper/tsh-diff-dialog.c           |  1 -
 tvp-svn-helper/tsh-diff.c                  | 24 ++++++---
 tvp-svn-helper/tsh-export.c                |  1 -
 tvp-svn-helper/tsh-file-selection-dialog.c | 78 +++++++++++++++++++++++++-----
 tvp-svn-helper/tsh-import.c                | 15 ++++--
 tvp-svn-helper/tsh-log.c                   |  1 -
 tvp-svn-helper/tsh-move.c                  | 14 ++++--
 tvp-svn-helper/tsh-properties.c            | 76 ++++++++++++++++++++++++++---
 tvp-svn-helper/tsh-relocate.c              |  1 -
 tvp-svn-helper/tsh-revert.c                |  5 ++
 tvp-svn-helper/tsh-status.c                | 27 ++++++++---
 tvp-svn-helper/tsh-switch.c                |  1 -
 tvp-svn-helper/tsh-update.c                |  1 -
 23 files changed, 329 insertions(+), 88 deletions(-)

diff --git a/thunar-vcs-plugin/tvp-svn-backend.c b/thunar-vcs-plugin/tvp-svn-backend.c
index fb44019..fc9a349 100644
--- a/thunar-vcs-plugin/tvp-svn-backend.c
+++ b/thunar-vcs-plugin/tvp-svn-backend.c
@@ -22,7 +22,6 @@
 
 #include <glib.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_cmdline.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
@@ -93,7 +92,11 @@ tvp_svn_backend_init (void)
 	}
 #endif
 
+#if CHECK_SVN_VERSION_G(1,8)
+	err = svn_client_create_context2 (&ctx, NULL, pool);
+#else
 	err = svn_client_create_context (&ctx, pool);
+#endif
   if(err)
   {
     svn_error_clear (err);
@@ -249,12 +252,22 @@ tvp_svn_backend_get_status (const gchar *uri)
   subpool = svn_pool_create (pool);
 
   /* get the status of all files in the directory */
-#if CHECK_SVN_VERSION(1,5)
-  err = svn_client_status3 (NULL, path, &revision, status_callback2, &list, svn_depth_immediates, TRUE, FALSE, TRUE, TRUE, NULL, ctx, subpool);
-#elif CHECK_SVN_VERSION(1,6)
-  err = svn_client_status4 (NULL, path, &revision, status_callback3, &list, svn_depth_immediates, TRUE, FALSE, TRUE, TRUE, NULL, ctx, subpool);
-#else /* CHECK_SVN_VERSION(1,7) */
-  err = svn_client_status5 (NULL, ctx, path, &revision, svn_depth_immediates, TRUE, FALSE, TRUE, TRUE, TRUE, NULL, status_callback, &list, subpool);
+#if CHECK_SVN_VERSION_G(1,9)
+  err = svn_client_status6 (NULL, ctx, path, &revision, svn_depth_immediates,
+                            TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, NULL,
+                            status_callback, &list, subpool);
+#elif CHECK_SVN_VERSION_G(1,7)
+  err = svn_client_status5 (NULL, ctx, path, &revision, svn_depth_immediates,
+                            TRUE, FALSE, TRUE, TRUE, TRUE, NULL,
+                            status_callback, &list, subpool);
+#elif CHECK_SVN_VERSION_G(1,6)
+  err = svn_client_status4 (NULL, path, &revision, status_callback3, &list,
+                            svn_depth_immediates, TRUE, FALSE, TRUE, TRUE, NULL,
+                            ctx, subpool);
+#else
+  err = svn_client_status3 (NULL, path, &revision, status_callback2
+                            &list, svn_depth_immediates, TRUE, FALSE, TRUE,
+                            TRUE, NULL, ctx, subpool);
 #endif
 
   svn_pool_destroy (subpool);
@@ -346,12 +359,16 @@ tvp_svn_backend_get_info (const gchar *uri)
 
   subpool = svn_pool_create (pool);
 
-#if CHECK_SVN_VERSION(1,5) || CHECK_SVN_VERSION(1,6)
-  /* get svn info for this file or directory */
-  err = svn_client_info2 (path, &revision, &revision, info_callback, &info, svn_depth_empty, NULL, ctx, subpool);
-#else /* CHECK_SVN_VERSION(1,7) */
   /* get svn info for this file or directory */
-  err = svn_client_info3 (path, &revision, &revision, svn_depth_empty, FALSE, TRUE, NULL, info_callback, &info, ctx, subpool);
+#if CHECK_SVN_VERSION_G(1,9)
+  err = svn_client_info4 (path, &revision, &revision, svn_depth_empty, FALSE,
+                          TRUE, FALSE, NULL, info_callback, &info, ctx, subpool);
+#elif CHECK_SVN_VERSION_G(1,7)
+  err = svn_client_info3 (path, &revision, &revision, svn_depth_empty, FALSE,
+                          TRUE, NULL, info_callback, &info, ctx, subpool);
+#else
+  err = svn_client_info2 (path, &revision, &revision, info_callback, &info,
+                          svn_depth_empty, NULL, ctx, subpool);
 #endif
 
   svn_pool_destroy (subpool);
diff --git a/thunar-vcs-plugin/tvp-svn-backend.h b/thunar-vcs-plugin/tvp-svn-backend.h
index ed865cc..39278ea 100644
--- a/thunar-vcs-plugin/tvp-svn-backend.h
+++ b/thunar-vcs-plugin/tvp-svn-backend.h
@@ -21,6 +21,8 @@
 
 #include <glib.h>
 
+#include <subversion-1/svn_version.h>
+
 G_BEGIN_DECLS;
 
 typedef struct
@@ -60,8 +62,12 @@ TvpSvnInfo *tvp_svn_backend_get_info (const gchar *uri);
 
 void     tvp_svn_info_free (TvpSvnInfo *info);
 
-#define CHECK_SVN_VERSION(major, minor) ((major == SVN_VER_MAJOR) && (minor == SVN_VER_MINOR))
-#define CHECK_SVN_VERSION_G(major, minor) ((major < SVN_VER_MAJOR) || ((major == SVN_VER_MAJOR) && (minor <= SVN_VER_MINOR)))
+#define CHECK_SVN_VERSION(major, minor) \
+    (SVN_VER_MAJOR == (major) && SVN_VER_MINOR == (minor))
+#define CHECK_SVN_VERSION_G(major, minor) \
+    (SVN_VER_MAJOR > (major) || \
+    (SVN_VER_MAJOR == (major) && SVN_VER_MINOR > (minor)) || \
+    (SVN_VER_MAJOR == (major) && SVN_VER_MINOR == (minor)))
 
 G_END_DECLS;
 
diff --git a/tvp-svn-helper/tsh-add.c b/tvp-svn-helper/tsh-add.c
index e92139a..8cdf644 100644
--- a/tvp-svn-helper/tsh-add.c
+++ b/tvp-svn-helper/tsh-add.c
@@ -69,7 +69,17 @@ static gpointer add_thread (gpointer user_data)
       if (!(info->flags & TSH_FILE_INFO_INDIRECT))
       {
         svn_pool_clear(subpool);
-        if ((err = svn_client_add4(info->path, (info->flags&TSH_FILE_INFO_RECURSIVE)?svn_depth_infinity:svn_depth_empty, FALSE, FALSE, FALSE, ctx, subpool)))
+#if CHECK_SVN_VERSION_G(1,8)
+        if ((err = svn_client_add5(info->path,
+                                   (info->flags & TSH_FILE_INFO_RECURSIVE) ?
+                                     svn_depth_infinity : svn_depth_empty,
+                                   FALSE, FALSE, FALSE, FALSE, ctx, subpool)))
+#else
+        if ((err = svn_client_add4(info->path,
+                                   (info->flags & TSH_FILE_INFO_RECURSIVE) ?
+                                     svn_depth_infinity : svn_depth_empty,
+                                   FALSE, FALSE, FALSE, ctx, subpool)))
+#endif
         {
           error_str = tsh_strerror(err);
           gdk_threads_enter();
@@ -87,7 +97,13 @@ static gpointer add_thread (gpointer user_data)
   }
   else
   {
-    if ((err = svn_client_add4("", svn_depth_infinity, FALSE, FALSE, FALSE, ctx, subpool)))
+#if CHECK_SVN_VERSION_G(1,8)
+    if ((err = svn_client_add5("", svn_depth_infinity, FALSE, FALSE, FALSE,
+                               FALSE, ctx, subpool)))
+#else
+    if ((err = svn_client_add4("", svn_depth_infinity, FALSE, FALSE, FALSE,
+                               ctx, subpool)))
+#endif
     {
       error_str = tsh_strerror(err);
       gdk_threads_enter();
diff --git a/tvp-svn-helper/tsh-blame.c b/tvp-svn-helper/tsh-blame.c
index 419b40b..d765410 100644
--- a/tvp-svn-helper/tsh-blame.c
+++ b/tvp-svn-helper/tsh-blame.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
diff --git a/tvp-svn-helper/tsh-cleanup.c b/tvp-svn-helper/tsh-cleanup.c
index 2802c35..1e05f90 100644
--- a/tvp-svn-helper/tsh-cleanup.c
+++ b/tvp-svn-helper/tsh-cleanup.c
@@ -30,6 +30,7 @@
 #include <libxfce4util/libxfce4util.h>
 
 #include <subversion-1/svn_client.h>
+#include <subversion-1/svn_path.h>
 #include <subversion-1/svn_pools.h>
 
 #include "tsh-common.h"
@@ -44,6 +45,26 @@ struct thread_args {
 	gchar *path;
 };
 
+static svn_error_t * tsh_client_cleanup(const char *path,
+                                        svn_client_ctx_t *ctx,
+                                        apr_pool_t *scratch_pool)
+{
+#if CHECK_SVN_VERSION_G(1,9)
+  const char *local_abspath;
+
+  if (svn_path_is_url(path))
+    return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+                             _("'%s' is not a local path"), path);
+
+  svn_dirent_get_absolute(&local_abspath, path, scratch_pool);
+
+  return svn_client_cleanup2(local_abspath, TRUE, TRUE, TRUE, TRUE, FALSE, ctx,
+                             scratch_pool);
+#else
+  return svn_client_cleanup(path, ctx, scratch_pool);
+#endif
+}
+
 static gpointer cleanup_thread (gpointer user_data)
 {
 	struct thread_args *args = user_data;
@@ -58,7 +79,7 @@ static gpointer cleanup_thread (gpointer user_data)
 
   subpool = svn_pool_create (pool);
 
-	if ((err = svn_client_cleanup(path, ctx, subpool)))
+	if ((err = tsh_client_cleanup(path, ctx, subpool)))
 	{
     svn_pool_destroy (subpool);
 
diff --git a/tvp-svn-helper/tsh-commit.c b/tvp-svn-helper/tsh-commit.c
index 0275ed8..22c62ab 100644
--- a/tvp-svn-helper/tsh-commit.c
+++ b/tvp-svn-helper/tsh-commit.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -95,7 +94,17 @@ static gpointer commit_thread (gpointer user_data)
           delete = g_slist_prepend (delete, info);
           break;
         case TSH_FILE_STATUS_UNVERSIONED:
-          if ((err = svn_client_add4(info->path, (info->flags&TSH_FILE_INFO_RECURSIVE)?svn_depth_infinity:svn_depth_empty, FALSE, FALSE, FALSE, ctx, subpool)))
+#if CHECK_SVN_VERSION_G(1,8)
+          if ((err = svn_client_add5(info->path,
+                                     (info->flags & TSH_FILE_INFO_RECURSIVE) ?
+                                       svn_depth_infinity : svn_depth_empty,
+                                     FALSE, FALSE, FALSE, FALSE, ctx, subpool)))
+#else
+          if ((err = svn_client_add4(info->path,
+                                     (info->flags & TSH_FILE_INFO_RECURSIVE) ?
+                                       svn_depth_infinity : svn_depth_empty,
+                                     FALSE, FALSE, FALSE, ctx, subpool)))
+#endif
           {
             error_str = tsh_strerror(err);
             gdk_threads_enter();
@@ -124,10 +133,10 @@ static gpointer commit_thread (gpointer user_data)
       APR_ARRAY_PUSH (paths, const char *) = info->path;
     }
 
-#if CHECK_SVN_VERSION_S(1,6)
-    if ((err = svn_client_delete3(NULL, paths, FALSE, FALSE, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
+#if CHECK_SVN_VERSION_G(1,7)
     if ((err = svn_client_delete4(paths, FALSE, FALSE, NULL, NULL, NULL, ctx, subpool)))
+#else
+    if ((err = svn_client_delete3(NULL, paths, FALSE, FALSE, NULL, ctx, subpool)))
 #endif
     {
       svn_pool_destroy (subpool);
@@ -185,10 +194,20 @@ static gpointer commit_thread (gpointer user_data)
       APR_ARRAY_PUSH (paths, const char *) = ""; // current directory
     }
 
-#if CHECK_SVN_VERSION_S(1,6)
-    if ((err = svn_client_commit4(&commit_info, paths, recursive?svn_depth_infinity:svn_depth_empty, FALSE, FALSE, NULL, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
-    if ((err = svn_client_commit5(paths, recursive?svn_depth_infinity:svn_depth_empty, FALSE, FALSE, FALSE, NULL, NULL, tsh_commit_func2, dialog, ctx, subpool)))
+#if CHECK_SVN_VERSION_G(1,9)
+    if ((err = svn_client_commit6(paths,
+                                  recursive?svn_depth_infinity:svn_depth_empty,
+                                  FALSE, FALSE, FALSE, FALSE, FALSE, NULL, NULL,
+                                  tsh_commit_func2, dialog, ctx, subpool)))
+#elif CHECK_SVN_VERSION_G(1,7)
+    if ((err = svn_client_commit5(paths,
+                                  recursive?svn_depth_infinity:svn_depth_empty,
+                                  FALSE, FALSE, FALSE, NULL, NULL,
+                                  tsh_commit_func2, dialog, ctx, subpool)))
+#else
+    if ((err = svn_client_commit4(&commit_info, paths,
+                                  recursive?svn_depth_infinity:svn_depth_empty,
+                                  FALSE, FALSE, NULL, NULL, ctx, subpool)))
 #endif
     {
       svn_pool_destroy (subpool);
diff --git a/tvp-svn-helper/tsh-common.c b/tvp-svn-helper/tsh-common.c
index 38f4266..aaf8b0b 100644
--- a/tvp-svn-helper/tsh-common.c
+++ b/tvp-svn-helper/tsh-common.c
@@ -31,7 +31,6 @@
 
 #include <apr_lib.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_cmdline.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
@@ -139,7 +138,11 @@ gboolean tsh_create_context (svn_client_ctx_t **pctx, apr_pool_t *pool, svn_erro
 		return FALSE;
 
 	/* Create the client context */
+#if CHECK_SVN_VERSION_G(1,8)
+	if ((err = svn_client_create_context2 (pctx, NULL, pool)))
+#else
 	if ((err = svn_client_create_context (pctx, pool)))
+#endif
 	{
 		if (perr)
 			*perr = err;
diff --git a/tvp-svn-helper/tsh-common.h b/tvp-svn-helper/tsh-common.h
index b070c96..c49b8df 100644
--- a/tvp-svn-helper/tsh-common.h
+++ b/tvp-svn-helper/tsh-common.h
@@ -19,6 +19,8 @@
 #ifndef __TSH_COMMON_H__
 #define __TSH_COMMON_H__
 
+#include <subversion-1/svn_version.h>
+
 G_BEGIN_DECLS
 
 gboolean tsh_init (apr_pool_t**, svn_error_t**);
@@ -46,9 +48,15 @@ const gchar *tsh_status_to_string(enum svn_wc_status_kind status);
 
 gchar *tsh_is_working_copy (const gchar *, apr_pool_t *);
 
-#define CHECK_SVN_VERSION(major, minor) ((major == SVN_VER_MAJOR) && (minor == SVN_VER_MINOR))
-#define CHECK_SVN_VERSION_G(major, minor) ((major < SVN_VER_MAJOR) || ((major == SVN_VER_MAJOR) && (minor <= SVN_VER_MINOR)))
-#define CHECK_SVN_VERSION_S(major, minor) ((major > SVN_VER_MAJOR) || ((major == SVN_VER_MAJOR) && (minor >= SVN_VER_MINOR)))
+#define CHECK_SVN_VERSION(major, minor) \
+    (SVN_VER_MAJOR == (major) && SVN_VER_MINOR == (minor))
+#define CHECK_SVN_VERSION_G(major, minor) \
+    (SVN_VER_MAJOR > (major) || \
+    (SVN_VER_MAJOR == (major) && SVN_VER_MINOR > (minor)) || \
+    (SVN_VER_MAJOR == (major) && SVN_VER_MINOR == (minor)))
+#define CHECK_SVN_VERSION_S(major, minor) \
+    ((major > SVN_VER_MAJOR) || \
+    ((major == SVN_VER_MAJOR) && (minor >= SVN_VER_MINOR)))
 
 G_END_DECLS
 
diff --git a/tvp-svn-helper/tsh-copy.c b/tvp-svn-helper/tsh-copy.c
index 320dc53..51fb0c0 100644
--- a/tvp-svn-helper/tsh-copy.c
+++ b/tvp-svn-helper/tsh-copy.c
@@ -30,7 +30,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -79,12 +78,19 @@ static gpointer copy_thread (gpointer user_data)
   copy_source.peg_revision = &revision;
   APR_ARRAY_PUSH (paths, svn_client_copy_source_t *) = &copy_source;
 
-#if CHECK_SVN_VERSION(1,5)
-  if ((err = svn_client_copy4(&commit_info, paths, to, FALSE, FALSE, NULL, ctx, subpool)))
-#elif CHECK_SVN_VERSION(1,6)
-  if ((err = svn_client_copy5(&commit_info, paths, to, FALSE, FALSE, FALSE, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
-  if ((err = svn_client_copy6(paths, to, FALSE, FALSE, FALSE, NULL, tsh_commit_func2, dialog, ctx, subpool)))
+#if CHECK_SVN_VERSION_G(1,9)
+  if ((err = svn_client_copy7(paths, to, FALSE, FALSE, FALSE, FALSE, FALSE,
+                              NULL, NULL, tsh_commit_func2, dialog, ctx,
+                              subpool)))
+#elif CHECK_SVN_VERSION_G(1,7)
+  if ((err = svn_client_copy6(paths, to, FALSE, FALSE, FALSE, NULL,
+                              tsh_commit_func2, dialog, ctx, subpool)))
+#elif CHECK_SVN_VERSION_G(1,6)
+  if ((err = svn_client_copy5(&commit_info, paths, to, FALSE, FALSE, FALSE,
+                              NULL, ctx, subpool)))
+#else
+  if ((err = svn_client_copy4(&commit_info, paths, to, FALSE, FALSE, NULL,
+                              ctx, subpool)))
 #endif
   {
     svn_pool_destroy (subpool);
diff --git a/tvp-svn-helper/tsh-delete.c b/tvp-svn-helper/tsh-delete.c
index c5f3b54..557d338 100644
--- a/tvp-svn-helper/tsh-delete.c
+++ b/tvp-svn-helper/tsh-delete.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
diff --git a/tvp-svn-helper/tsh-diff-dialog.c b/tvp-svn-helper/tsh-diff-dialog.c
index a20e623..09efef6 100644
--- a/tvp-svn-helper/tsh-diff-dialog.c
+++ b/tvp-svn-helper/tsh-diff-dialog.c
@@ -26,7 +26,6 @@
 
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
-#include <subversion-1/svn_version.h>
 
 #include "tsh-common.h"
 #include "tsh-diff-dialog.h"
diff --git a/tvp-svn-helper/tsh-diff.c b/tvp-svn-helper/tsh-diff.c
index 99966cd..f0c79d7 100644
--- a/tvp-svn-helper/tsh-diff.c
+++ b/tvp-svn-helper/tsh-diff.c
@@ -32,7 +32,6 @@
 
 #include <apr.h>
 #include <apr_xlate.h>
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -118,16 +117,25 @@ static gpointer diff_thread (gpointer user_data)
     revision1.kind = svn_opt_revision_base;
     revision2.kind = svn_opt_revision_working;
 
-#if CHECK_SVN_VERSION_S(1,6)
-    if ((err = svn_client_diff4(NULL, path, &revision1, path, &revision2,
-                                NULL, depth, !notice_ancestry,
-                                no_diff_deleted, FALSE, APR_LOCALE_CHARSET,
-                                outfile, errfile, NULL, ctx, subpool))) 
-#else /* CHECK_SVN_VERSION(1,7) */
+#if CHECK_SVN_VERSION_G(1,9)
+    svn_stream_t *outstream = svn_stream_from_aprfile2(outfile, TRUE, pool);
+    svn_stream_t *errstream = svn_stream_from_aprfile2(errfile, TRUE, pool);
+
+    if ((err = svn_client_diff6(NULL, path, &revision1, path, &revision2,
+                                NULL, depth, !notice_ancestry, FALSE,
+                                no_diff_deleted, show_copies_as_adds,
+                                FALSE, FALSE, FALSE, FALSE, APR_LOCALE_CHARSET,
+                                outstream, errstream, NULL, ctx, subpool)))
+#elif CHECK_SVN_VERSION_G(1,7)
     if ((err = svn_client_diff5(NULL, path, &revision1, path, &revision2,
                                 NULL, depth, !notice_ancestry, no_diff_deleted,
                                 show_copies_as_adds, FALSE, FALSE, APR_LOCALE_CHARSET,
-                                outfile, errfile, NULL, ctx, subpool))) 
+                                outfile, errfile, NULL, ctx, subpool)))
+#else
+    if ((err = svn_client_diff4(NULL, path, &revision1, path, &revision2,
+                                NULL, depth, !notice_ancestry,
+                                no_diff_deleted, FALSE, APR_LOCALE_CHARSET,
+                                outfile, errfile, NULL, ctx, subpool)))
 #endif
     {
       goto on_error;
diff --git a/tvp-svn-helper/tsh-export.c b/tvp-svn-helper/tsh-export.c
index 24a0c03..e616fc0 100644
--- a/tvp-svn-helper/tsh-export.c
+++ b/tvp-svn-helper/tsh-export.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
diff --git a/tvp-svn-helper/tsh-file-selection-dialog.c b/tvp-svn-helper/tsh-file-selection-dialog.c
index ba7bfc9..cebf210 100644
--- a/tvp-svn-helper/tsh-file-selection-dialog.c
+++ b/tvp-svn-helper/tsh-file-selection-dialog.c
@@ -23,7 +23,6 @@
 #include <libxfce4util/libxfce4util.h>
 #include <gtk/gtk.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -191,12 +190,40 @@ tsh_file_selection_dialog_new (const gchar *title, GtkWindow *parent, GtkDialogF
     while (*files)
     {
       svn_pool_clear(subpool);
-#if CHECK_SVN_VERSION(1,5)
-      if((err = svn_client_status3(NULL, *files, &revision, tsh_file_selection_status_func2, dialog, (selection_flags&TSH_FILE_SELECTION_FLAG_RECURSIVE)?svn_depth_infinity:svn_depth_immediates, selection_flags&TSH_FILE_SELECTION_FLAG_UNCHANGED, FALSE, selection_flags&TSH_FILE_SELECTION_FLAG_IGNORED, TRUE, NULL, ctx, subpool)))
-#elif CHECK_SVN_VERSION(1,6)
-      if((err = svn_client_status4(NULL, *files, &revision, tsh_file_selection_status_func3, dialog, (selection_flags&TSH_FILE_SELECTION_FLAG_RECURSIVE)?svn_depth_infinity:svn_depth_immediates, selection_flags&TSH_FILE_SELECTION_FLAG_UNCHANGED, FALSE, selection_flags&TSH_FILE_SELECTION_FLAG_IGNORED, TRUE, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
-      if((err = svn_client_status5(NULL, ctx, *files, &revision, (selection_flags&TSH_FILE_SELECTION_FLAG_RECURSIVE)?svn_depth_infinity:svn_depth_immediates, selection_flags&TSH_FILE_SELECTION_FLAG_UNCHANGED, FALSE, selection_flags&TSH_FILE_SELECTION_FLAG_IGNORED, TRUE, TRUE, NULL, tsh_file_selection_status_func, dialog, subpool)))
+
+#if CHECK_SVN_VERSION_G(1,9)
+      if((err = svn_client_status6(NULL, ctx, *files, &revision,
+                                   (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                     svn_depth_infinity : svn_depth_immediates,
+                                   selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                                   FALSE, TRUE,
+                                   selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                                   TRUE, TRUE, NULL,
+                                   tsh_file_selection_status_func, dialog, subpool)))
+#elif CHECK_SVN_VERSION_G(1,7)
+      if((err = svn_client_status5(NULL, ctx, *files, &revision,
+                                   (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                     svn_depth_infinity : svn_depth_immediates,
+                                   selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                                   FALSE, selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                                   TRUE, TRUE, NULL,
+                                   tsh_file_selection_status_func, dialog, subpool)))
+#elif CHECK_SVN_VERSION_G(1,6)
+      if((err = svn_client_status4(NULL, *files, &revision,
+                                   tsh_file_selection_status_func3, dialog,
+                                   (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                     svn_depth_infinity : svn_depth_immediates,
+                                   selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                                   FALSE, selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                                   TRUE, NULL, ctx, subpool)))
+#else
+      if((err = svn_client_status3(NULL, *files, &revision,
+                                   tsh_file_selection_status_func2, dialog,
+                                   (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                     svn_depth_infinity : svn_depth_immediates,
+                                   selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                                   FALSE, selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                                   TRUE, NULL, ctx, subpool)))
 #endif
       {
 	svn_pool_destroy (subpool);
@@ -211,12 +238,39 @@ tsh_file_selection_dialog_new (const gchar *title, GtkWindow *parent, GtkDialogF
   }
   else
   {
-#if CHECK_SVN_VERSION(1,5)
-    if((err = svn_client_status3(NULL, "", &revision, tsh_file_selection_status_func2, dialog, (selection_flags&TSH_FILE_SELECTION_FLAG_RECURSIVE)?svn_depth_infinity:svn_depth_immediates, selection_flags&TSH_FILE_SELECTION_FLAG_UNCHANGED, FALSE, selection_flags&TSH_FILE_SELECTION_FLAG_IGNORED, TRUE, NULL, ctx, subpool)))
+
+#if CHECK_SVN_VERSION_G(1,9)
+  if((err = svn_client_status6(NULL, ctx, "", &revision,
+                               (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                 svn_depth_infinity : svn_depth_immediates,
+                               selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                               FALSE, TRUE, selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                               TRUE, TRUE, NULL, tsh_file_selection_status_func,
+                               dialog, subpool)))
+#elif CHECK_SVN_VERSION_G(1,7)
+  if((err = svn_client_status5(NULL, ctx, "", &revision,
+                               (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                 svn_depth_infinity : svn_depth_immediates,
+                               selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                               FALSE, selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                               TRUE, TRUE, NULL, tsh_file_selection_status_func,
+                               dialog, subpool)))
 #elif CHECK_SVN_VERSION(1,6)
-    if((err = svn_client_status4(NULL, "", &revision, tsh_file_selection_status_func3, dialog, (selection_flags&TSH_FILE_SELECTION_FLAG_RECURSIVE)?svn_depth_infinity:svn_depth_immediates, selection_flags&TSH_FILE_SELECTION_FLAG_UNCHANGED, FALSE, selection_flags&TSH_FILE_SELECTION_FLAG_IGNORED, TRUE, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
-    if((err = svn_client_status5(NULL, ctx, "", &revision, (selection_flags&TSH_FILE_SELECTION_FLAG_RECURSIVE)?svn_depth_infinity:svn_depth_immediates, selection_flags&TSH_FILE_SELECTION_FLAG_UNCHANGED, FALSE, selection_flags&TSH_FILE_SELECTION_FLAG_IGNORED, TRUE, TRUE, NULL, tsh_file_selection_status_func, dialog, subpool)))
+    if((err = svn_client_status4(NULL, "", &revision,
+                                 tsh_file_selection_status_func3, dialog,
+                                 (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                   svn_depth_infinity : svn_depth_immediates,
+                                 selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                                 FALSE, selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                                 TRUE, NULL, ctx, subpool)))
+#else
+    if((err = svn_client_status3(NULL, "", &revision, 
+                                 tsh_file_selection_status_func2, dialog,
+                                 (selection_flags & TSH_FILE_SELECTION_FLAG_RECURSIVE) ?
+                                   svn_depth_infinity : svn_depth_immediates,
+                                 selection_flags & TSH_FILE_SELECTION_FLAG_UNCHANGED,
+                                 FALSE, selection_flags & TSH_FILE_SELECTION_FLAG_IGNORED,
+                                 TRUE, NULL, ctx, subpool)))
 #endif
     {
       svn_pool_destroy (subpool);
diff --git a/tvp-svn-helper/tsh-import.c b/tvp-svn-helper/tsh-import.c
index 1d1e38e..ca6f009 100644
--- a/tvp-svn-helper/tsh-import.c
+++ b/tvp-svn-helper/tsh-import.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -68,10 +67,16 @@ static gpointer import_thread (gpointer user_data)
 
   subpool = svn_pool_create (pool);
 
-#if CHECK_SVN_VERSION_S(1,6)
-  if ((err = svn_client_import3(&commit_info, path, url, svn_depth_infinity, FALSE, FALSE, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
-  if ((err = svn_client_import4(path, url, svn_depth_infinity, FALSE, FALSE, NULL, tsh_commit_func2, dialog, ctx, subpool)))
+#if CHECK_SVN_VERSION_G(1,8)
+  if ((err = svn_client_import5(path, url, svn_depth_infinity, FALSE, FALSE,
+                                FALSE, NULL, NULL, NULL, tsh_commit_func2,
+                                dialog, ctx, subpool)))
+#elif CHECK_SVN_VERSION_G(1,6)
+  if ((err = svn_client_import4(path, url, svn_depth_infinity, FALSE, FALSE,
+                                NULL, tsh_commit_func2, dialog, ctx, subpool)))
+#else
+  if ((err = svn_client_import3(&commit_info, path, url, svn_depth_infinity,
+                                FALSE, FALSE, NULL, ctx, subpool)))
 #endif
   {
     svn_pool_destroy (subpool);
diff --git a/tvp-svn-helper/tsh-log.c b/tvp-svn-helper/tsh-log.c
index 79c32df..4ae9e42 100644
--- a/tvp-svn-helper/tsh-log.c
+++ b/tvp-svn-helper/tsh-log.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 #include <subversion-1/svn_props.h>
diff --git a/tvp-svn-helper/tsh-move.c b/tvp-svn-helper/tsh-move.c
index a47c7af..05f5b70 100644
--- a/tvp-svn-helper/tsh-move.c
+++ b/tvp-svn-helper/tsh-move.c
@@ -30,7 +30,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -73,10 +72,15 @@ static gpointer move_thread (gpointer user_data)
 
   APR_ARRAY_PUSH (paths, const char *) = from;
 
-#if CHECK_SVN_VERSION_S(1,6)
-  if ((err = svn_client_move5(&commit_info, paths, to, FALSE, FALSE, FALSE, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
-  if ((err = svn_client_move6(paths, to, FALSE, FALSE, NULL, tsh_commit_func2, dialog, ctx, subpool)))
+#if CHECK_SVN_VERSION_G(1,8)
+  if ((err = svn_client_move7(paths, to, FALSE, FALSE, TRUE, FALSE, NULL,
+                              tsh_commit_func2, dialog, ctx, subpool)))
+#elif CHECK_SVN_VERSION_G(1,7)
+  if ((err = svn_client_move6(paths, to, FALSE, FALSE, NULL, tsh_commit_func2,
+                              dialog, ctx, subpool)))
+#else
+  if ((err = svn_client_move5(&commit_info, paths, to, FALSE, FALSE, FALSE,
+                              NULL, ctx, subpool)))
 #endif
   {
     svn_pool_destroy (subpool);
diff --git a/tvp-svn-helper/tsh-properties.c b/tvp-svn-helper/tsh-properties.c
index 0f63cd0..651ca6a 100644
--- a/tvp-svn-helper/tsh-properties.c
+++ b/tvp-svn-helper/tsh-properties.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -49,6 +48,52 @@ struct thread_args {
   gboolean depth;
 };
 
+#if CHECK_SVN_VERSION_G(1,8)
+struct proplist_receiver_wrapper_baton {
+  void *baton;
+  svn_proplist_receiver_t receiver;
+};
+
+
+
+static svn_error_t *
+proplist_wrapper_receiver(void *baton,
+                          const char *path,
+                          apr_hash_t *prop_hash,
+                          apr_array_header_t *inherited_props,
+                          apr_pool_t *pool)
+{
+  struct proplist_receiver_wrapper_baton *plrwb = baton;
+
+  if (plrwb->receiver)
+    return plrwb->receiver(plrwb->baton, path, prop_hash, pool);
+
+  return SVN_NO_ERROR;
+}
+
+
+
+static void
+wrap_proplist_receiver(svn_proplist_receiver2_t *receiver2,
+                       void **receiver2_baton,
+                       svn_proplist_receiver_t receiver,
+                       void *receiver_baton,
+                       apr_pool_t *pool)
+{
+  struct proplist_receiver_wrapper_baton *plrwb = apr_palloc(pool,
+                                                             sizeof(*plrwb));
+
+  /* Set the user provided old format callback in the baton. */
+  plrwb->baton = receiver_baton;
+  plrwb->receiver = receiver;
+
+  *receiver2_baton = plrwb;
+  *receiver2 = proplist_wrapper_receiver;
+}
+#endif
+
+
+
 static gpointer properties_thread (gpointer user_data)
 {
   struct thread_args *args = user_data;
@@ -77,13 +122,16 @@ static gpointer properties_thread (gpointer user_data)
   {
     value = set_value?svn_string_create(set_value, subpool):NULL;
 
-#if CHECK_SVN_VERSION_S(1,6)
-    if ((err = svn_client_propset3(NULL, set_key, value, path, depth, FALSE, SVN_INVALID_REVNUM, NULL, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
+#if CHECK_SVN_VERSION_G(1,7)
     paths = apr_array_make (subpool, 1, sizeof (const char *));
     APR_ARRAY_PUSH (paths, const char *) = path;
 
-    if ((err = svn_client_propset_local(set_key, value, paths, depth, FALSE, NULL, ctx, subpool)))
+    if ((err = svn_client_propset_local(set_key, value, paths, depth, FALSE,
+                                        NULL, ctx, subpool)))
+#else
+    if ((err = svn_client_propset3(NULL, set_key, value, path, depth, FALSE,
+                                   SVN_INVALID_REVNUM, NULL, NULL, ctx,
+                                   subpool)))
 #endif
     {
       //svn_pool_destroy (subpool);
@@ -106,7 +154,23 @@ static gpointer properties_thread (gpointer user_data)
   g_free (set_value);
 
   revision.kind = svn_opt_revision_unspecified;
-  if ((err = svn_client_proplist3(path, &revision, &revision, svn_depth_empty, NULL, tsh_proplist_func, dialog, ctx, subpool)))
+
+
+#if CHECK_SVN_VERSION_G(1,8)
+  svn_proplist_receiver2_t receiver2;
+  void *receiver2_baton;
+
+  wrap_proplist_receiver(&receiver2, &receiver2_baton, tsh_proplist_func,
+                         dialog, pool);
+
+  if ((err = svn_client_proplist4(path, &revision, &revision, svn_depth_empty,
+                                  NULL, FALSE, receiver2, receiver2_baton, ctx,
+                                  subpool)))
+#else
+  if ((err = svn_client_proplist3(path, &revision, &revision, svn_depth_empty,
+                                  NULL, tsh_proplist_func, dialog, ctx,
+                                  subpool)))
+#endif
   {
     svn_pool_destroy (subpool);
 
diff --git a/tvp-svn-helper/tsh-relocate.c b/tvp-svn-helper/tsh-relocate.c
index ae42b74..9a32c7c 100644
--- a/tvp-svn-helper/tsh-relocate.c
+++ b/tvp-svn-helper/tsh-relocate.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
diff --git a/tvp-svn-helper/tsh-revert.c b/tvp-svn-helper/tsh-revert.c
index 5594bea..b9ace59 100644
--- a/tvp-svn-helper/tsh-revert.c
+++ b/tvp-svn-helper/tsh-revert.c
@@ -80,7 +80,12 @@ static gpointer revert_thread (gpointer user_data)
 		APR_ARRAY_PUSH (paths, const char *) = ""; // current directory
 	}
 
+#if CHECK_SVN_VERSION_G(1,9)
+	if ((err = svn_client_revert3(paths, svn_depth_empty, NULL, FALSE, FALSE,
+                                ctx, subpool)))
+#else
 	if ((err = svn_client_revert2(paths, svn_depth_empty, NULL, ctx, subpool)))
+#endif
 	{
     svn_pool_destroy (subpool);
 
diff --git a/tvp-svn-helper/tsh-status.c b/tvp-svn-helper/tsh-status.c
index 40206ad..2103abf 100644
--- a/tvp-svn-helper/tsh-status.c
+++ b/tvp-svn-helper/tsh-status.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
@@ -74,12 +73,26 @@ static gpointer status_thread (gpointer user_data)
   subpool = svn_pool_create (pool);
 
   revision.kind = svn_opt_revision_head;
-#if CHECK_SVN_VERSION(1,5)
-  if ((err = svn_client_status3(NULL, files?files[0]:"", &revision, tsh_status_func2, dialog, depth, get_all, update, no_ignore, ignore_externals, NULL, ctx, subpool)))
-#elif CHECK_SVN_VERSION(1,6)
-  if ((err = svn_client_status4(NULL, files?files[0]:"", &revision, tsh_status_func3, dialog, depth, get_all, update, no_ignore, ignore_externals, NULL, ctx, subpool)))
-#else /* CHECK_SVN_VERSION(1,7) */
-  if ((err = svn_client_status5(NULL, ctx, files?files[0]:"", &revision, depth, get_all, update, no_ignore, ignore_externals, TRUE, NULL, tsh_status_func, dialog, subpool)))
+
+#if CHECK_SVN_VERSION_G(1,9)
+  if ((err = svn_client_status6(NULL, ctx, files?files[0]:"", &revision, depth,
+                                get_all, update, no_ignore, TRUE,
+                                ignore_externals, TRUE, NULL, tsh_status_func,
+                                dialog, subpool)))
+#elif CHECK_SVN_VERSION_G(1,7)
+  if ((err = svn_client_status5(NULL, ctx, files?files[0]:"", &revision, depth,
+                                get_all, update, no_ignore, ignore_externals,
+                                TRUE, NULL, tsh_status_func, dialog, subpool)))
+#elif CHECK_SVN_VERSION_G(1,6)
+  if ((err = svn_client_status4(NULL, files?files[0]:"", &revision,
+                                tsh_status_func3, dialog, depth, get_all,
+                                update, no_ignore, ignore_externals, NULL, ctx,
+                                subpool)))
+#else
+  if ((err = svn_client_status3(NULL, files?files[0]:"", &revision,
+                                tsh_status_func2, dialog, depth, get_all,
+                                update, no_ignore, ignore_externals, NULL, ctx,
+                                subpool)))
 #endif
   {
     svn_pool_destroy (subpool);
diff --git a/tvp-svn-helper/tsh-switch.c b/tvp-svn-helper/tsh-switch.c
index 9dd8180..e4ed05c 100644
--- a/tvp-svn-helper/tsh-switch.c
+++ b/tvp-svn-helper/tsh-switch.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 
diff --git a/tvp-svn-helper/tsh-update.c b/tvp-svn-helper/tsh-update.c
index b625109..bf71b16 100644
--- a/tvp-svn-helper/tsh-update.c
+++ b/tvp-svn-helper/tsh-update.c
@@ -29,7 +29,6 @@
 
 #include <libxfce4util/libxfce4util.h>
 
-#include <subversion-1/svn_version.h>
 #include <subversion-1/svn_client.h>
 #include <subversion-1/svn_pools.h>
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list