[gitg/wip/sindhus/interactive-rebase] Connect rebase start rebase button with controller



commit ab655a0b3654508c78901ce7d2143ba029aad33f
Author: Sindhu S <sindhus live in>
Date:   Fri Sep 13 20:12:34 2013 +0530

    Connect rebase start rebase button with controller

 gitg/gitg-rebase-controller.vala   |    8 ++++----
 gitg/gitg-rebase-start-dialog.vala |    1 +
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gitg/gitg-rebase-controller.vala b/gitg/gitg-rebase-controller.vala
index c339679..e688dea 100644
--- a/gitg/gitg-rebase-controller.vala
+++ b/gitg/gitg-rebase-controller.vala
@@ -51,7 +51,7 @@ namespace Gitg
                        return streamoutput;
                }
 
-               public void start_rebase()
+               public void start_rebase(string range)
                {
                        string gitg_path = "";
                        string git_path = "";
@@ -61,10 +61,10 @@ namespace Gitg
                        stdout.printf("gitg path: %s\n", gitg_path);
                        stdout.printf("git path: %s\n", git_path);
 
-                       string[] spawn_args = {"/usr/bin/git", "rebase", "-i", "HEAD~5"};
+                       string[] spawn_args = {"/usr/bin/git", "rebase", "-i", range};
                        string[] spawn_env = Environ.get ();
-                       spawn_env = Environ.set_variable(spawn_env, "GIT_SEQUENCE_EDITOR", "jhbuild run gitg 
--rebase", true);
-                       spawn_env = Environ.set_variable(spawn_env, "GIT_EDITOR", "jhbuild run gitg 
--rebase-commit-editor", true);
+                       spawn_env = Environ.set_variable(spawn_env, "GIT_SEQUENCE_EDITOR", "%s 
--rebase".printf(gitg_path), true);
+                       spawn_env = Environ.set_variable(spawn_env, "GIT_EDITOR", "%s 
--rebase-commit-editor".printf(gitg_path), true);
                        Pid child_pid;
 
                        int standard_input;
diff --git a/gitg/gitg-rebase-start-dialog.vala b/gitg/gitg-rebase-start-dialog.vala
index fe03274..67ceca5 100644
--- a/gitg/gitg-rebase-start-dialog.vala
+++ b/gitg/gitg-rebase-start-dialog.vala
@@ -40,6 +40,7 @@ namespace Gitg
                                int num_of_commits = 5;
                                // FIXME: User should be able to enter N
                                // int num_of_commits = r_rebase_spinbutton.get_value_as_int();
+                               rebase_controller.start_rebase("HEAD~%d".printf(num_of_commits));
                        }
                        destroy();
                }


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