summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-01-22 08:13:48 +0000
committerMika Havela <mika.havela@gmail.com>2008-01-22 08:13:48 +0000
commit33341f200e61f61eeb16d52fd588dd3bcb850905 (patch)
tree8c7f45b8c8d6f1f55e1e64507549d061f7b33f83
parent533fece43d5a50d3fce6e39bbd2170fbd0cd730a (diff)
downloadacf-devtools-33341f200e61f61eeb16d52fd588dd3bcb850905.tar.bz2
acf-devtools-33341f200e61f61eeb16d52fd588dd3bcb850905.tar.xz
Perhibit the diff to be displayed as graphics
git-svn-id: svn://svn.alpinelinux.org/acf/devtools/trunk@625 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--acfupdate-model.lua5
1 files changed, 5 insertions, 0 deletions
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="<p class=attention>Important information.</p><p>In the following output all html-brackets < and > are replaced to [ and ].<BR>This is to be able to display the diffs in text (perhibit the browser to display the diff as graphics).</p>"})
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