From 93b9f65b236e84be3c0d7d14af39766bbd78119c Mon Sep 17 00:00:00 2001 From: Julian Buliga Date: Wed, 19 Jun 2019 11:06:57 -0700 Subject: [PATCH 1/2] update to latest API --- .../recipe-577013.js | 2 +- .../recipe-578537.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/JavaScript/577013_Komodo_JS_Macro__show_svn_blame_current_editor/recipe-577013.js b/recipes/JavaScript/577013_Komodo_JS_Macro__show_svn_blame_current_editor/recipe-577013.js index 680d3c957..5f10c9565 100644 --- a/recipes/JavaScript/577013_Komodo_JS_Macro__show_svn_blame_current_editor/recipe-577013.js +++ b/recipes/JavaScript/577013_Komodo_JS_Macro__show_svn_blame_current_editor/recipe-577013.js @@ -14,5 +14,5 @@ var retval = process.wait(-1); if (retval == 0) { var stdout = process.getStdout(); var lines = stdout.split("\n"); - StatusBar_AddMessage("BLAME: " + lines[linenum], "editor", 10000, true); + ko.statusBar.AddMessage("BLAME: " + lines[linenum], "editor", 10000, true); } diff --git a/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js b/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js index 7e116d61b..e73289e5f 100644 --- a/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js +++ b/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js @@ -18,6 +18,6 @@ if (retval == 0) { var re = new RegExp("[0-9a-f]* \\((.*? [12][09][0-9]{2}-[0-9]{2}-[0-9]{2}) "); var match = re.exec(lines[linenum]); if (match) { - StatusBar_AddMessage("BLAME: " + match[1], "editor", 10000, true); + ko.statusBar.AddMessage("BLAME: " + match[1], "editor", 10000, true); } } From c2fd102e92c205ee21ccd21f5ce6b20c4fcc17ca Mon Sep 17 00:00:00 2001 From: Julian Buliga Date: Wed, 19 Jun 2019 14:16:00 -0700 Subject: [PATCH 2/2] add commit message after blame user --- .../recipe-578537.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js b/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js index e73289e5f..94bcae18c 100644 --- a/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js +++ b/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js @@ -4,7 +4,7 @@ var linenum = scimoz.lineFromPosition(scimoz.currentPos); var basename = ko.views.manager.currentView.koDoc.file.baseName; var dirname = ko.views.manager.currentView.koDoc.file.dirName; -// Run the svn blame process. +// Run the git blame process. var runSvc = Components.classes["@activestate.com/koRunService;1"]. createInstance(Components.interfaces.koIRunService); var cmd = 'git blame ' + basename; @@ -15,9 +15,15 @@ var retval = process.wait(-1); if (retval == 0) { var stdout = process.getStdout(); var lines = stdout.split("\n"); - var re = new RegExp("[0-9a-f]* \\((.*? [12][09][0-9]{2}-[0-9]{2}-[0-9]{2}) "); + var re = new RegExp("([0-9a-f]*) \\((.*? [12][09][0-9]{2}-[0-9]{2}-[0-9]{2}) "); var match = re.exec(lines[linenum]); if (match) { - ko.statusBar.AddMessage("BLAME: " + match[1], "editor", 10000, true); + cmd = 'git log --format=%s -n 1 ' + match[1]; + process = runSvc.RunAndNotify(cmd, dirname, '', ''); + retval = process.wait(-1); + ko.statusBar.AddMessage("BLAME: " + match[2], "editor", 10000, true); + if (retval == 0) { + ko.statusBar.AddMessage( process.getStdout(), "editor", 10000, true); + } } }