From 33341f200e61f61eeb16d52fd588dd3bcb850905 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Tue, 22 Jan 2008 08:13:48 +0000 Subject: Perhibit the diff to be displayed as graphics git-svn-id: svn://svn.alpinelinux.org/acf/devtools/trunk@625 ab2d0c66-481e-0410-8bed-d214d4d58bed --- acfupdate-model.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'acfupdate-model.lua') diff --git a/acfupdate-model.lua b/acfupdate-model.lua index 7923c01..894889a 100644 --- a/acfupdate-model.lua +++ b/acfupdate-model.lua @@ -2,6 +2,7 @@ module (..., package.seeall) require("fs") +require("format") -- no initializer in model - use controller.init for that -- ############################################################### @@ -48,6 +49,7 @@ diffs = function (self) local updates = {} local cmdresult = {} updates.svnurl = svnurl + table.insert(cmdresult, {name="INFORMATION", updates="

Important information.

In the following output all html-brackets < and > are replaced to [ and ].
This is to be able to display the diffs in text (perhibit the browser to display the diff as graphics).

"}) for list in string.gmatch((querycmd("/usr/bin/svn list " .. svnurl )), "%S+") do local updateresult = "" if (list == "core/") then @@ -55,6 +57,9 @@ diffs = function (self) elseif ( fs.is_dir("/usr/share/acf/app/" .. list)) then updateresult = querycmd("/usr/bin/svn diff /usr/share/acf/app/" .. list .. " 2>&1") end + updateresult = format.search_replace({updateresult},"<","[") + updateresult = format.search_replace(updateresult,">","]") + updateresult = table.concat(updateresult, "\n") table.insert(cmdresult, {name=list, updates=updateresult}) end updates.cmdresult = cmdresult -- cgit v1.2.3