[Goodies-commits] r7297 - in thunar-svn-plugin/trunk: . thunar-svn-plugin tsp-svn-helper
Peter de Ridder
peter at xfce.org
Thu Apr 30 18:02:34 CEST 2009
Author: peter
Date: 2009-04-30 16:02:34 +0000 (Thu, 30 Apr 2009)
New Revision: 7297
Modified:
thunar-svn-plugin/trunk/configure.ac.in
thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-provider.c
thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.c
thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.h
thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.c
thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.h
thunar-svn-plugin/trunk/tsp-svn-helper/tsh-copy.c
thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-selection-dialog.c
thunar-svn-plugin/trunk/tsp-svn-helper/tsh-log.c
thunar-svn-plugin/trunk/tsp-svn-helper/tsh-properties-dialog.c
thunar-svn-plugin/trunk/tsp-svn-helper/tsh-status.c
Log:
* configure.ac.in: version incremented after release
* thunar-svn-plugin tsp-svn-helper: changed functions to svn 1.6 api
Modified: thunar-svn-plugin/trunk/configure.ac.in
===================================================================
--- thunar-svn-plugin/trunk/configure.ac.in 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/configure.ac.in 2009-04-30 16:02:34 UTC (rev 7297)
@@ -12,9 +12,9 @@
dnl ***************************
m4_define([tsp_version_major], [0])
m4_define([tsp_version_minor], [0])
-m4_define([tsp_version_micro], [3])
+m4_define([tsp_version_micro], [4])
m4_define([tsp_version_build], [r at REVISION@])
-m4_define([tsp_version_tag], []) # Leave empty for releases
+m4_define([tsp_version_tag], [svn]) # Leave empty for releases
m4_define([tsp_version], [tsp_version_major().tsp_version_minor().tsp_version_micro()ifelse(tsp_version_tag(), [], [], [tsp_version_tag()-tsp_version_build()])])
dnl *******************************************
Modified: thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-provider.c
===================================================================
--- thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-provider.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-provider.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -433,7 +433,7 @@
/* append the svn submenu action */
action = tsp_svn_action_new ("Tsp::svn", _("SVN"), files, window, FALSE, parent_wc, directory_is_wc, directory_is_not_wc, file_is_vc, file_is_not_vc);
- g_signal_connect(action, "new-watch", G_CALLBACK(tsp_new_process), menu_provider);
+ g_signal_connect(action, "new-process", G_CALLBACK(tsp_new_process), menu_provider);
actions = g_list_append (actions, action);
return actions;
Modified: thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.c
===================================================================
--- thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -152,7 +152,7 @@
static void
-status_callback (void *baton, const char *path, svn_wc_status2_t *status)
+status_callback2 (void *baton, const char *path, svn_wc_status2_t *status)
{
GSList **list = baton;
TspSvnFileStatus *entry = g_new (TspSvnFileStatus, 1);
@@ -180,7 +180,15 @@
}
+static svn_error_t *
+status_callback3 (void *baton, const char *path, svn_wc_status2_t *status, apr_pool_t *pool)
+{
+ status_callback2(baton, path, status);
+ return SVN_NO_ERROR;
+}
+
+
GSList *
tsp_svn_backend_get_status (const gchar *uri)
{
@@ -206,7 +214,11 @@
subpool = svn_pool_create (pool);
/* get the status of all files in the directory */
- err = svn_client_status3 (NULL, path, &revision, status_callback, &list, svn_depth_immediates, TRUE, FALSE, TRUE, TRUE, NULL, ctx, subpool);
+#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);
+#else /* 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);
+#endif
svn_pool_destroy (subpool);
Modified: thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.h
===================================================================
--- thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.h 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/thunar-svn-plugin/tsp-svn-backend.h 2009-04-30 16:02:34 UTC (rev 7297)
@@ -59,6 +59,8 @@
void tsp_svn_info_free (TspSvnInfo *info);
+#define CHECK_SVN_VERSION(major, minor) ((major == SVN_VER_MAJOR) && (minor == SVN_VER_MINOR))
+
G_END_DECLS;
#endif /* !__TSP_SVN_BACKEND_H__ */
Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -34,6 +34,7 @@
#include <subversion-1/svn_pools.h>
#include <subversion-1/svn_fs.h>
#include <subversion-1/svn_time.h>
+#include <subversion-1/svn_props.h>
#include "tsh-dialog-common.h"
#include "tsh-login-dialog.h"
@@ -48,6 +49,7 @@
#include "tsh-common.h"
+static svn_error_t* tsh_auth_simple_plaintext_prompt(svn_boolean_t*, const char*, void*, apr_pool_t*);
static svn_error_t* tsh_auth_simple_prompt(svn_auth_cred_simple_t**, void*, const char*, const char*, svn_boolean_t, apr_pool_t*);
static svn_error_t* tsh_auth_username_prompt(svn_auth_cred_username_t**, void*, const char*, svn_boolean_t, apr_pool_t*);
static svn_error_t* tsh_auth_ssl_server_trust_prompt(svn_auth_cred_ssl_server_trust_t**, void*, const char*, apr_uint32_t, const svn_auth_ssl_server_cert_info_t*, svn_boolean_t, apr_pool_t*);
@@ -78,8 +80,10 @@
*ppool = pool = svn_pool_create (NULL);
- /* Initialize utf routines */
- svn_utf_initialize (pool);
+ /* Initialize utf routines.
+ * This is only for performance, don't think the plugin actualy uses it.
+ * Removed because of compile error with libsvn 1.6 */
+ /* svn_utf_initialize (pool); */
/* Initialize FS lib */
if ((err = svn_fs_initialize (pool)))
@@ -165,7 +169,11 @@
svn_auth_get_keychain_simple_provider (&provider, pool);
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
#endif
+#if CHECK_SVN_VERSION(1,5)
svn_auth_get_simple_provider (&provider, pool);
+#else /* CHECK_SVN_VERSION(1,6)*/
+ svn_auth_get_simple_provider2 (&provider, tsh_auth_simple_plaintext_prompt, NULL, pool);
+#endif
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
svn_auth_get_username_provider (&provider, pool);
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
@@ -175,7 +183,11 @@
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
svn_auth_get_ssl_client_cert_file_provider (&provider, pool);
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
+#if CHECK_SVN_VERSION(1,5)
svn_auth_get_ssl_client_cert_pw_file_provider (&provider, pool);
+#else /* CHECK_SVN_VERSION(1,6)*/
+ svn_auth_get_ssl_client_cert_pw_file_provider2 (&provider, tsh_auth_simple_plaintext_prompt, NULL, pool);
+#endif
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
/* Prompt providers */
@@ -246,6 +258,29 @@
}
static svn_error_t*
+tsh_auth_simple_plaintext_prompt(svn_boolean_t *may_save_plaintext,
+ const char *realm,
+ void *baton,
+ apr_pool_t *pool)
+{
+ gint result;
+
+ gdk_threads_enter();
+
+ GtkWidget *dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _("Store password a plaintext?"));
+
+ result = gtk_dialog_run(GTK_DIALOG(dialog));
+
+ gtk_widget_destroy(dialog);
+
+ gdk_threads_leave();
+
+ *may_save_plaintext = (result == GTK_RESPONSE_YES);
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t*
tsh_auth_simple_prompt(svn_auth_cred_simple_t **cred,
void *baton,
const char *realm,
@@ -487,7 +522,18 @@
N_("Changelist moved"),
N_("Merge begin"),
N_("Foreign merge begin"),
- N_("Replace")
+ N_("Replace"),
+#if CHECK_SVN_VERSION_G(1,6)
+ N_("Property added"),
+ N_("Property modified"),
+ N_("Property deleted"),
+ N_("Property nonexisting"),
+ N_("Revision property set"),
+ N_("Revision property deleted"),
+ N_("Merge completed"),
+ N_("Tree conflict"),
+ N_("External failed"),
+#endif
};
const gchar *action_string = N_("Unknown");
@@ -526,6 +572,17 @@
case svn_wc_notify_merge_begin:
case svn_wc_notify_foreign_merge_begin:
case svn_wc_notify_update_replace:
+#if CHECK_SVN_VERSION_G(1,6)
+ case svn_wc_notify_property_added:
+ case svn_wc_notify_property_modified:
+ case svn_wc_notify_property_deleted:
+ case svn_wc_notify_property_deleted_nonexistent:
+ case svn_wc_notify_revprop_set:
+ case svn_wc_notify_revprop_deleted:
+ case svn_wc_notify_merge_completed:
+ case svn_wc_notify_tree_conflict:
+ case svn_wc_notify_failed_external:
+#endif
action_string = action_table[action];
break;
}
@@ -681,6 +738,13 @@
gdk_threads_leave();
}
+svn_error_t *
+tsh_status_func3(void *baton, const char *path, svn_wc_status2_t *status, apr_pool_t *pool)
+{
+ tsh_status_func2(baton, path, status);
+ return SVN_NO_ERROR;
+}
+
svn_error_t*
tsh_log_msg_func2(const char **log_msg, const char **tmp_file, const apr_array_header_t *commit_items, void *baton, apr_pool_t *pool)
{
Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.h
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.h 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-common.h 2009-04-30 16:02:34 UTC (rev 7297)
@@ -29,6 +29,7 @@
void tsh_notify_func2 (void *, const svn_wc_notify_t *, apr_pool_t *);
void tsh_status_func2 (void *, const char *, svn_wc_status2_t *);
+svn_error_t *tsh_status_func3 (void *, const char *, svn_wc_status2_t *, apr_pool_t *);
svn_error_t *tsh_log_msg_func2 (const char **, const char **, const apr_array_header_t *, void *, apr_pool_t *);
svn_error_t *tsh_log_func (void *, svn_log_entry_t *, apr_pool_t *);
svn_error_t *tsh_blame_func2 (void *, apr_int64_t, svn_revnum_t, const char *, const char *, svn_revnum_t, const char *, const char *, const char *, const char *, apr_pool_t *);
@@ -40,6 +41,10 @@
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)))
+
G_END_DECLS
#endif /*__TSH_COMMON_H__*/
Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-copy.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-copy.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-copy.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -74,7 +74,11 @@
copy_source.peg_revision = &revision;
APR_ARRAY_PUSH (paths, svn_client_copy_source_t *) = ©_source;
+#if CHECK_SVN_VERSION(1,5)
if ((err = svn_client_copy4(&commit_info, paths, to, FALSE, FALSE, NULL, ctx, subpool)))
+#else /* CHECK_SVN_VERSION(1,6) */
+ if ((err = svn_client_copy5(&commit_info, paths, to, FALSE, FALSE, FALSE, NULL, ctx, subpool)))
+#endif
{
svn_pool_destroy (subpool);
Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-selection-dialog.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-selection-dialog.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-selection-dialog.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -31,6 +31,7 @@
#include "tsh-file-selection-dialog.h"
static void tsh_file_selection_status_func2 (void *, const char *, svn_wc_status2_t *);
+static svn_error_t *tsh_file_selection_status_func3 (void *, const char *, svn_wc_status2_t *, apr_pool_t *);
static void selection_cell_toggled (GtkCellRendererToggle *, gchar *, gpointer);
static void selection_all_toggled (GtkToggleButton *, gpointer);
@@ -166,7 +167,11 @@
{
while (*files)
{
+#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)))
+#else /* 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)))
+#endif
{
svn_pool_destroy (subpool);
@@ -180,7 +185,11 @@
}
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)))
+#else /* 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)))
+#endif
{
svn_pool_destroy (subpool);
@@ -275,6 +284,12 @@
}
}
+static svn_error_t *tsh_file_selection_status_func3(void *baton, const char *path, svn_wc_status2_t *status, apr_pool_t *pool)
+{
+ tsh_file_selection_status_func2(baton, path, status);
+ return SVN_NO_ERROR;
+}
+
static void selection_cell_toggled (GtkCellRendererToggle *renderer, gchar *path, gpointer user_data)
{
TshFileSelectionDialog *dialog = TSH_FILE_SELECTION_DIALOG (user_data);
Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-log.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-log.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-log.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -47,18 +47,20 @@
static gpointer log_thread (gpointer user_data)
{
struct thread_args *args = user_data;
- svn_opt_revision_t revision, start, end;
+ svn_opt_revision_t revision;
+ svn_opt_revision_range_t range;
svn_error_t *err;
svn_client_ctx_t *ctx = args->ctx;
apr_pool_t *subpool, *pool = args->pool;
TshLogDialog *dialog = args->dialog;
gchar **files = args->files;
apr_array_header_t *paths = args->paths;
+ apr_array_header_t *ranges;
gint size, i;
GtkWidget *error;
gchar *error_str;
- if(!args->paths)
+ if(!paths)
{
size = files?g_strv_length(files):0;
@@ -84,10 +86,16 @@
subpool = svn_pool_create (pool);
revision.kind = svn_opt_revision_unspecified;
- start.kind = svn_opt_revision_head;
- end.kind = svn_opt_revision_number;
- end.value.number = 0;
- if ((err = svn_client_log4(paths, &revision, &start, &end, 0, TRUE, FALSE, FALSE, NULL, tsh_log_func, dialog, ctx, subpool)))
+ range.start.kind = svn_opt_revision_head;
+ range.end.kind = svn_opt_revision_number;
+ range.end.value.number = 0;
+ ranges = apr_array_make (pool, 1, sizeof (svn_opt_revision_range_t *));
+ APR_ARRAY_PUSH (ranges, svn_opt_revision_range_t *) = ⦥
+#if CHECK_SVN_VERSION(1,5)
+ if ((err = svn_client_log4(paths, &revision, &range.start, &renge.end, 0, TRUE, FALSE, FALSE, NULL, tsh_log_func, dialog, ctx, subpool)))
+#else /* CHECK_SVN_VERSION(1,6) */
+ if ((err = svn_client_log5(paths, &revision, ranges, 0, TRUE, FALSE, FALSE, NULL, tsh_log_func, dialog, ctx, subpool)))
+#endif
{
svn_pool_destroy (subpool);
Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-properties-dialog.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-properties-dialog.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-properties-dialog.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -25,6 +25,7 @@
#include <gtk/gtk.h>
#include <subversion-1/svn_client.h>
+#include <subversion-1/svn_props.h>
#include "tsh-common.h"
#include "tsh-properties-dialog.h"
Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-status.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-status.c 2009-04-30 15:55:18 UTC (rev 7296)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-status.c 2009-04-30 16:02:34 UTC (rev 7297)
@@ -71,7 +71,11 @@
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)))
+#else /* 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)))
+#endif
{
svn_pool_destroy (subpool);
More information about the Goodies-commits
mailing list