[gitg/wip/sindhus/interactive-rebase] Split git-rebase-todo file into lines and spit



commit 3f7ae1b9439060ba239671598452a20c74467a8a
Author: Sindhu S <sindhus live in>
Date:   Mon Sep 9 17:29:58 2013 +0530

    Split git-rebase-todo file into lines and spit

 gitg/gitg-rebase-parser.vala |   15 ++++++++++++++-
 gitg/gitg-rebase-window.vala |    2 +-
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gitg/gitg-rebase-parser.vala b/gitg/gitg-rebase-parser.vala
index f85283d..4f65fd7 100644
--- a/gitg/gitg-rebase-parser.vala
+++ b/gitg/gitg-rebase-parser.vala
@@ -28,8 +28,21 @@ namespace Gitg
                public void parse_rebase_todo(string filename)
                {
                        string contents;
-                       FileUtils.get_contents(filename, out contents);
+                       int line_number=0;
+
+                       try
+                       {
+                               FileUtils.get_contents(filename, out contents);
+                       }
+                       catch{}
+
                        stdout.printf("Contents: %s", contents);
+                       var file_lines = contents.split("\n");
+                       while (file_lines[line_number][0] != '#')
+                       {
+                               stdout.printf(file_lines[line_number]);
+                               line_number++;
+                       }
                }
        }
 }
diff --git a/gitg/gitg-rebase-window.vala b/gitg/gitg-rebase-window.vala
index 9c5d35a..f58a1bb 100644
--- a/gitg/gitg-rebase-window.vala
+++ b/gitg/gitg-rebase-window.vala
@@ -26,7 +26,7 @@ public class RebaseWindow : Gtk.Window
        public RebaseWindow()
        {
                this.title = "gitg Rebase";
-               
+
        }
 }
 


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