[anjuta/git-shell] git: Implement the Rebase pane



commit 39d08f811147d94d653d5ce96cce453ab396aa7f
Author: James Liggett <jrliggett cox net>
Date:   Wed Jul 28 21:12:53 2010 -0700

    git: Implement the Rebase pane

 plugins/git/Makefile.am       |    4 +-
 plugins/git/git-rebase-pane.c |   96 +++++++++++++++++++++++++++++++++++++++++
 plugins/git/git-rebase-pane.h |   32 ++++++++++++++
 plugins/git/plugin.c          |   42 +++++++++++++++++-
 4 files changed, 172 insertions(+), 2 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index cf9e55e..faab9de 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -213,7 +213,9 @@ libanjuta_git_la_SOURCES = \
 	git-drop-stash-pane.c \
 	git-drop-stash-pane.h \
 	git-clear-stash-pane.c \
-	git-clear-stash-pane.h
+	git-clear-stash-pane.h \
+	git-rebase-pane.c \
+	git-rebase-pane.h
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/git-rebase-pane.c b/plugins/git/git-rebase-pane.c
new file mode 100644
index 0000000..c588684
--- /dev/null
+++ b/plugins/git/git-rebase-pane.c
@@ -0,0 +1,96 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * git-shell-test
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * git-shell-test is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * git-shell-test is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "git-rebase-pane.h"
+
+static void
+start_rebase_command (Git *plugin, AnjutaCommand *command)
+{
+	git_pane_create_message_view (plugin);
+
+	g_signal_connect (G_OBJECT (command), "command-finished",
+	                  G_CALLBACK (git_pane_report_errors),
+	                  plugin);
+
+
+	g_signal_connect (G_OBJECT (command), "command-finished",
+	                  G_CALLBACK (g_object_unref),
+	                  NULL);
+
+	g_signal_connect (G_OBJECT (command), "data-arrived",
+	                  G_CALLBACK (git_pane_on_command_info_arrived),
+	                  plugin);
+	
+	anjuta_command_start (command);
+}
+
+void
+on_rebase_start_button_clicked (GtkAction *action, Git *plugin)
+{
+	gchar *remote;
+	GitRebaseStartCommand *start_command;
+
+	remote = git_remotes_pane_get_selected_remote (GIT_REMOTES_PANE (plugin->remotes_pane));
+
+	if (remote)
+	{
+		start_command = git_rebase_start_command_new (plugin->project_root_directory,
+		                                              remote);
+
+		g_free (remote);
+
+		start_rebase_command (plugin, ANJUTA_COMMAND (start_command));
+	}
+	else
+		anjuta_util_dialog_error (NULL, _("No remote selected"));
+}
+
+void
+on_rebase_continue_button_clicked (GtkAction *action, Git *plugin)
+{
+	GitRebaseContinueCommand *continue_command;
+
+	continue_command = git_rebase_continue_command_new (plugin->project_root_directory,
+	                                                    GIT_REBASE_CONTINUE_ACTION_CONTINUE);
+
+	start_rebase_command (plugin, ANJUTA_COMMAND (continue_command));
+}
+
+void
+on_rebase_skip_button_clicked (GtkAction *action, Git *plugin)
+{
+	GitRebaseContinueCommand *continue_command;
+
+	continue_command = git_rebase_continue_command_new (plugin->project_root_directory,
+	                                                    GIT_REBASE_CONTINUE_ACTION_SKIP);
+
+	start_rebase_command (plugin, ANJUTA_COMMAND (continue_command));
+}
+
+void
+on_rebase_abort_button_clicked (GtkAction *action, Git *plugin)
+{
+	GitRebaseContinueCommand *continue_command;
+
+	continue_command = git_rebase_continue_command_new (plugin->project_root_directory,
+	                                                    GIT_REBASE_CONTINUE_ACTION_ABORT);
+
+	start_rebase_command (plugin, ANJUTA_COMMAND (continue_command));
+}
+ 
\ No newline at end of file
diff --git a/plugins/git/git-rebase-pane.h b/plugins/git/git-rebase-pane.h
new file mode 100644
index 0000000..1d63cc2
--- /dev/null
+++ b/plugins/git/git-rebase-pane.h
@@ -0,0 +1,32 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * git-shell-test
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * git-shell-test is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * git-shell-test is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GIT_REBASE_PANE_H_
+#define _GIT_REBASE_PANE_H_
+
+#include "git-rebase-start-command.h"
+#include "git-rebase-continue-command.h"
+#include "git-remotes-pane.h"
+
+void on_rebase_start_button_clicked (GtkAction *action, Git *plugin);
+void on_rebase_continue_button_clicked (GtkAction *action, Git *plugin);
+void on_rebase_skip_button_clicked (GtkAction *action, Git *plugin);
+void on_rebase_abort_button_clicked (GtkAction *action, Git *plugin);
+
+#endif
\ No newline at end of file
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index 8699592..188fdcd 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -49,6 +49,7 @@
 #include "git-diff-stash-pane.h"
 #include "git-drop-stash-pane.h"
 #include "git-clear-stash-pane.h"
+#include "git-rebase-pane.h"
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -248,8 +249,47 @@ AnjutaCommandBarEntry remotes_entries[] =
 		N_("Fetch changes from remote repositories"),
 		GTK_STOCK_CONNECT,
 		G_CALLBACK (on_fetch_button_clicked)
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_FRAME,
+		"NULL",
+		N_("Rebase"),
+		NULL,
+		NULL,
+		NULL
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"RebaseStart",
+		N_("Rebase against selected remote"),
+		N_("Start a rebase operation relative to the selected remote repository"),
+		NULL,
+		G_CALLBACK (on_rebase_start_button_clicked)
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"RebaseContinue",
+		N_("Continue"),
+		N_("Continue a rebase with resolved conflicts"),
+		NULL,
+		G_CALLBACK (on_rebase_continue_button_clicked)
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"RebaseSkip",
+		N_("Skip"),
+		N_("Skip the current revision"),
+		NULL,
+		G_CALLBACK (on_rebase_skip_button_clicked)
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"RebaseAbort",
+		N_("Abort"),
+		N_("Abort the rebase and return the repository to its previous state"),
+		NULL,
+		G_CALLBACK (on_rebase_abort_button_clicked)
 	}
-	
 };
 
 AnjutaCommandBarEntry stash_entries[] =



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]