[Xfce4-commits] <thunar-vcs-plugin:master> Expose --notice-ancestry option in svn diff dialog.

Stefan Sperling noreply at xfce.org
Thu Sep 6 23:48:04 CEST 2012


Updating branch refs/heads/master
         to 12011959bcee30e48e420d064ebce90e06d737d2 (commit)
       from 2b5cc2bc0c0db2a3f8c23361235ac5c0c3b26274 (commit)

commit 12011959bcee30e48e420d064ebce90e06d737d2
Author: Stefan Sperling <stsp at stsp.name>
Date:   Wed Sep 5 22:08:08 2012 +0200

    Expose --notice-ancestry option in svn diff dialog.

 tvp-svn-helper/tsh-diff-dialog.c |   14 ++++++++++++++
 tvp-svn-helper/tsh-diff-dialog.h |    1 +
 tvp-svn-helper/tsh-diff.c        |    7 ++++---
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/tvp-svn-helper/tsh-diff-dialog.c b/tvp-svn-helper/tsh-diff-dialog.c
index e079d7f..23d12ad 100644
--- a/tvp-svn-helper/tsh-diff-dialog.c
+++ b/tvp-svn-helper/tsh-diff-dialog.c
@@ -47,6 +47,7 @@ struct _TshDiffDialog
   GtkWidget *refresh;
   gint current_line;
   GtkWidget *depth;
+  GtkWidget *notice_ancestry;
   GtkWidget *no_diff_deleted;
 #if CHECK_SVN_VERSION_S(1,7)
   GtkWidget *show_copies_as_adds;
@@ -96,6 +97,7 @@ tsh_diff_dialog_init (TshDiffDialog *dialog)
   GtkWidget *table;
   GtkTreeModel *model;
   GtkWidget *depth;
+  GtkWidget *notice_ancestry;
   GtkWidget *no_diff_deleted;
 #if CHECK_SVN_VERSION_S(1,7)
   GtkWidget *show_copies_as_adds;
@@ -198,6 +200,10 @@ tsh_diff_dialog_init (TshDiffDialog *dialog)
   gtk_table_attach (GTK_TABLE (table), depth, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (depth);
 
+  dialog->notice_ancestry = notice_ancestry = gtk_check_button_new_with_label (_("Notice ancestry"));
+  gtk_table_attach (GTK_TABLE (table), notice_ancestry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+  gtk_widget_show (notice_ancestry);
+
   dialog->no_diff_deleted = no_diff_deleted = gtk_check_button_new_with_label (_("Do not show differences for deleted files"));
   gtk_table_attach (GTK_TABLE (table), no_diff_deleted, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (no_diff_deleted);
@@ -349,3 +355,11 @@ tsh_diff_dialog_get_no_diff_deleted (TshDiffDialog *dialog)
 
   return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->no_diff_deleted));
 }
+
+gboolean
+tsh_diff_dialog_get_notice_ancestry (TshDiffDialog *dialog)
+{
+  g_return_val_if_fail (TSH_IS_DIFF_DIALOG (dialog), FALSE);
+
+  return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->notice_ancestry));
+}
diff --git a/tvp-svn-helper/tsh-diff-dialog.h b/tvp-svn-helper/tsh-diff-dialog.h
index cab61b4..7d273a9 100644
--- a/tvp-svn-helper/tsh-diff-dialog.h
+++ b/tvp-svn-helper/tsh-diff-dialog.h
@@ -48,6 +48,7 @@ void       tsh_diff_dialog_done      (TshDiffDialog *dialog);
 svn_depth_t tsh_diff_dialog_get_depth (TshDiffDialog *dialog);
 gboolean   tsh_diff_dialog_get_show_copies_as_adds (TshDiffDialog *dialog);
 gboolean   tsh_diff_dialog_get_no_diff_deleted (TshDiffDialog *dialog);
+gboolean   tsh_diff_dialog_get_notice_ancestry (TshDiffDialog *dialog);
 
 G_END_DECLS;
 
diff --git a/tvp-svn-helper/tsh-diff.c b/tvp-svn-helper/tsh-diff.c
index 8e1e7ce..7b6b331 100644
--- a/tvp-svn-helper/tsh-diff.c
+++ b/tvp-svn-helper/tsh-diff.c
@@ -60,8 +60,9 @@ static gpointer diff_thread (gpointer user_data)
   apr_pool_t *subpool, *pool = args->pool;
   TshDiffDialog *dialog = args->dialog;
   svn_depth_t depth = tsh_diff_dialog_get_depth(dialog);
-  svn_boolean_t show_copies_as_adds = tsh_diff_dialog_get_show_copies_as_adds(dialog);
+  svn_boolean_t notice_ancestry = tsh_diff_dialog_get_notice_ancestry(dialog);
   svn_boolean_t no_diff_deleted = tsh_diff_dialog_get_no_diff_deleted(dialog);
+  svn_boolean_t show_copies_as_adds = tsh_diff_dialog_get_show_copies_as_adds(dialog);
   gchar **files = args->files;
   gint size, i;
   GtkWidget *error;
@@ -117,12 +118,12 @@ static gpointer diff_thread (gpointer user_data)
 
 #if CHECK_SVN_VERSION_S(1,6)
     if ((err = svn_client_diff4(NULL, path, &revision1, path, &revision2,
-                                NULL, depth, FALSE,
+                                NULL, depth, !notice_ancestry,
                                 no_diff_deleted, FALSE, APR_LOCALE_CHARSET,
                                 outfile, errfile, NULL, ctx, subpool))) 
 #else /* CHECK_SVN_VERSION(1,7) */
     if ((err = svn_client_diff5(NULL, path, &revision1, path, &revision2,
-                                NULL, depth, FALSE, no_diff_deleted,
+                                NULL, depth, !notice_ancestry, no_diff_deleted,
                                 show_copies_as_adds, FALSE, FALSE, APR_LOCALE_CHARSET,
                                 outfile, errfile, NULL, ctx, subpool))) 
 #endif


More information about the Xfce4-commits mailing list