PK x¥ svn status "%F" -v svn add "%F" svn diff -r %(ask:svn.revision:PREV:COMMITTED) "%F" svn delete "%F" svn info "%F" svn blame "%F" svn log "%F" svn log "%p" svn cleanup "%p" echo Updating project:;svn update "%p" echo SVN version:;svn --version --quiet; echo Last revision for active project:; svnversion "%p" svn status "%p" var runSvc = Components.classes["@activestate.com/koRunService;1"] .createInstance(Components.interfaces.koIRunService); var views = ko.views.manager.topView.getDocumentViews(true); for (var v in views) { var view = views[v]; if (view.document && view.document.file) { var tab = view.parentNode._tab; var cmd = 'svn status "' + view.document.file.path + '" -v'; var process = runSvc.RunAndNotify(cmd, "", "", ""); var retval = process.wait(-1); if (retval == 0) { var status = process.getStdout().substring(0, 1); // Note that there is tab.label and setAttribute + 'clean' + removeAttribute - action, status switch(status) { case " ": // Versioned and not modified tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_star.png'); //tab.style.cssText = 'background-image: url(chrome://famfamfamsilk/skin/icons/bullet_star.png) !important; background-repeat: no-repeat !important;'; break; case "M": // Modified tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_disk.png'); //tab.style.cssText = 'background-image: url(chrome://famfamfamsilk/skin/icons/bullet_disk.png) !important; background-repeat: no-repeat !important;'; break; case "A": // Add file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_add.png'); //tab.style.cssText = 'background-image: url(chrome://famfamfamsilk/skin/icons/bullet_add.png) !important; background-repeat: no-repeat !important;'; break; case "D": // Delete file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_delete.png'); //tab.style.cssText = 'background-image: url(chrome://famfamfamsilk/skin/icons/bullet_delete.png) !important; background-repeat: no-repeat !important;'; break; case "C": // Conflict for this file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_error.png'); //tab.style.cssText = 'background-image: url(chrome://famfamfamsilk/skin/icons/bullet_error.png) !important; background-repeat: no-repeat !important;'; break; default: tab.removeAttribute('action'); //tab.style.cssText = ""; } } else { tab.removeAttribute('action'); //tab.style.cssText = ""; } } } // The version of the current SVN toolbox SciViewsKtoolboxVersion = 0.1; SciViewsKtoolboxRelease = 0; if (typeof(sv.showVersion) == "undefined" | sv.showVersion) { alert(_("(highly experimental!) SVN toolbox version ") + SciViewsKtoolboxVersion + "." + SciViewsKtoolboxRelease); } svn diff "%F" var view = komodo.view; function revertCallbackHandler(retval) { if (retval == 0) { // Revert was successful, reload the file. view.revertUnconditionally(); var msg = "File was reverted"; StatusBar_AddMessage(msg, "scm", 5000, true); } } try { var cmd = 'svn revert "%f" { "cwd": "%D" }'; Run_RunEncodedCommand(window, cmd, revertCallbackHandler); } catch(ex) { alert(ex); } svn commit "%F" -m "%(ask:svn.message)" svn update "%F" var runSvc = Components.classes["@activestate.com/koRunService;1"] .createInstance(Components.interfaces.koIRunService); var view = komodo.view; if (view.document && view.document.file) { var tab = view.parentNode._tab; var cmd = 'svn status "' + view.document.file.path + '" -v'; var process = runSvc.RunAndNotify(cmd, "", "", ""); var retval = process.wait(-1); if (retval == 0) { var status = process.getStdout().substring(0, 1); switch(status) { case " ": // Versioned and not modified tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_star.png'); break; case "M": // Modified tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_disk.png'); break; case "A": // Add file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_add.png'); break; case "D": // Delete file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_delete.png'); break; case "C": // Conflict for this file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_error.png'); break; default: tab.removeAttribute('action'); } } else { tab.removeAttribute('action'); } } var runSvc = Components.classes["@activestate.com/koRunService;1"] .createInstance(Components.interfaces.koIRunService); var view = komodo.view; if (view.document && view.document.file) { var tab = view.parentNode._tab; var cmd = 'svn status "' + view.document.file.path + '" -v'; var process = runSvc.RunAndNotify(cmd, "", "", ""); var retval = process.wait(-1); if (retval == 0) { var status = process.getStdout().substring(0, 1); switch(status) { case " ": // Versioned and not modified tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_star.png'); break; case "M": // Modified tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_disk.png'); break; case "A": // Add file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_add.png'); break; case "D": // Delete file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_delete.png'); break; case "C": // Conflict for this file tab.setAttribute('action', 'chrome://famfamfamsilk/skin/icons/bullet_error.png'); break; default: tab.removeAttribute('action'); } } else { tab.removeAttribute('action'); } } var view = komodo.view; function revertCallbackHandler(retval) { if (retval == 0) { // Revert was successful, reload the file. view.revertUnconditionally(); var msg = "File was reverted"; StatusBar_AddMessage(msg, "scm", 5000, true); } } try { var cmd = 'svn revert "%f" { "cwd": "%D" }'; Run_RunEncodedCommand(window, cmd, revertCallbackHandler); } catch(ex) { alert(ex); } svn diff "%F" svn update "%F" svn commit "%F" -m "%(ask:svn.message)" 1 PK x¥