Add test files for new merger tool and spawn/git
authorAlan Knowles <alan@akbkhome.com>
Sun, 18 Sep 2011 15:43:01 +0000 (23:43 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sun, 18 Sep 2011 15:43:01 +0000 (23:43 +0800)
test_git.js [new file with mode: 0644]
test_merger.js [new file with mode: 0644]

diff --git a/test_git.js b/test_git.js
new file mode 100644 (file)
index 0000000..aa68121
--- /dev/null
@@ -0,0 +1,22 @@
+var Gtk = imports.gi.Gtk;
+
+var Repo = imports.Scm.Git.Repo.Repo;
+
+
+Gtk.init(Seed.argv);
+
+File = imports.File.File;
+
+var repo = new Repo({ repopath : '/home/alan/gitlive/gitlive' });
+
+repo.applyPatch(File.read('/tmp/test1.txt'));
+//var hist = repo.history('/', false, 'rev', 'github..master');
+//var hist = repo.getBranches();
+
+//var hist = repo.changedFiles('/',   'rev', 'github..master');
+
+
+print(JSON.stringify(hist,null,4));
+  
+//Gtk.main();
\ No newline at end of file
diff --git a/test_merger.js b/test_merger.js
new file mode 100644 (file)
index 0000000..e04bbd3
--- /dev/null
@@ -0,0 +1,69 @@
+#!/usr/bin/seed 
+//<Script type="text/javascript">
+/**
+ * runtime file
+ * takes a gtk project directory, and turns it into an application!
+ * by compling the files into JS files..
+ * 
+ * Initially developed for runtime testing. (the vte runner)
+ * 
+ * Might be the way to go for full runtime 
+ * 
+ * 
+ * Usage: (call with wrapper to set up directories..)
+ *    sh builder.sh
+ * 
+ * Concepts.. 
+ * a) load dependancies.. (eg. gi's..) - derived later?
+ * Gtk.init()
+ * 
+ * loop the files (find .bjs)
+ *   - comple to js (if not exist // or force enabled..)
+ * b) load all the files
+ * 
+ * Gtk.main();
+ * 
+ */
+// autogen?
+
+// sort out import path - this is  a bit of a mess..
+GIRepository = imports.gi.GIRepository;
+GLib        = imports.gi.GLib;
+
+// we add this in, as it appears to get lost sometimes if we set it using the ENV. variable in builder.sh
+GIRepository.Repository.prepend_search_path(GLib.get_home_dir() + '/.Builder/girepository-1.2');
+//print(JSON.stringify(GIRepository.IRepository.get_search_path()));
+
+Gtk         = imports.gi.Gtk;
+Gdk         = imports.gi.Gdk;
+Pango       = imports.gi.Pango;
+
+Gio         = imports.gi.Gio;
+GObject     = imports.gi.GObject;
+GtkSource   = imports.gi.GtkSource;
+WebKit      = imports.gi.WebKit;
+Vte         = imports.gi.Vte;
+
+
+File    = imports.File.File;
+
+XObject = imports.XObject.XObject;
+//XObject.debug = true;
+Gtk.init(Seed.argv);
+
+
+imports.searchPath.push('/'); // allow global paths..
+// error checking todo..
+ var ret = imports.Clones.Clones.show();
+ //imports.Merger.Merger.repo = new imports.Scm.Git.Repo.Repo('/home/alan/gitlive/roojs1');
+var ret = imports.Merger.Merger.show();
+
+print("show returned\n");
+print(JSON.stringify(ret,null, 4));
+
+
+           
+//Gtk.main();