summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-01-25 15:03:25 +0000
committerMika Havela <mika.havela@gmail.com>2008-01-25 15:03:25 +0000
commit09f7e1155da35b0462596eb72aa982ca72f0826d (patch)
tree70f1a838723d2e056872fe33ad39181167824ab1
parente5bb516b9c951b6bf7b6d9db2a0c8939af4f9712 (diff)
downloadacf-devtools-09f7e1155da35b0462596eb72aa982ca72f0826d.tar.bz2
acf-devtools-09f7e1155da35b0462596eb72aa982ca72f0826d.tar.xz
Now you can look at svn log 1 week back in time.
git-svn-id: svn://svn.alpinelinux.org/acf/devtools/trunk@651 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--acfupdate-controller.lua4
-rw-r--r--acfupdate-html.lsp5
-rw-r--r--acfupdate-model.lua25
3 files changed, 31 insertions, 3 deletions
diff --git a/acfupdate-controller.lua b/acfupdate-controller.lua
index 3d4e9da..65c3f60 100644
--- a/acfupdate-controller.lua
+++ b/acfupdate-controller.lua
@@ -34,3 +34,7 @@ status = function (self )
return ({projects = self.model:get(),updates = self.model:status(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} )
end
+log = function (self )
+ return ({projects = self.model:get(),updates = self.model:log(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} )
+end
+
diff --git a/acfupdate-html.lsp b/acfupdate-html.lsp
index 0b61e7f..c2b7d94 100644
--- a/acfupdate-html.lsp
+++ b/acfupdate-html.lsp
@@ -11,15 +11,14 @@ But if you have manually checked it out, you will get a update on it by pressing
<pre><?= view.projects ?></pre>
<? if (view.updates) then ?>
- <h2>New updates</h2>
+ <h2>Summary</h2>
<? for i = 1, table.maxn(view["updates"]["cmdresult"]) do ?>
<? if (view["updates"]["cmdresult"][i]["updates"] ~= "") then ?>
<h3><?= view["updates"]["cmdresult"][i]["name"] ?></h3>
<pre><?= view["updates"]["cmdresult"][i]["updates"] ?></pre>
<? end ?>
<? end ?>
- <h3>Summary</h3>
- <pre>-- End of updates --</pre>
+ <h3>-- End of updates --</h3>
<? end ?>
<?
diff --git a/acfupdate-model.lua b/acfupdate-model.lua
index 82ee059..b713c18 100644
--- a/acfupdate-model.lua
+++ b/acfupdate-model.lua
@@ -85,3 +85,28 @@ status = function (self)
updates.cmdresult = cmdresult
return updates
end
+log = function (self)
+ local svnurl = "svn://svn.alpinelinux.org/acf/"
+ local updates = {}
+ local cmdresult = {}
+ local enddate = tostring(os.date("%Y-%m-%d", (os.time() - (3600 * 24) * 7)))
+ local svnresult = querycmd("/usr/bin/svn log -v -rHEAD:{".. enddate .. "} " .. svnurl )
+-- for k,v in pairs(format.string_to_table("r%d+%s+", svnresult)) do
+ local svnheader = os.date("%Y-%m-%d")
+ local svnupdates = ""
+ table.insert(cmdresult, {name="INFORMATION", updates="<p>This is the result of svn log 1 week back in time.</p><p> svn log -v -rHEAD:{".. enddate .. "} " .. svnurl .. "</p>"})
+
+ for v in string.gmatch(svnresult,"(.-\n)") do
+ local svnheader_tmp = string.match(v, "r%d+%s+.-(%d+%-%d+%-%d+)")
+ if (svnheader_tmp) and (svnheader_tmp ~= svnheader) then
+ table.insert(cmdresult,{
+ ["updates"] = svnupdates,
+ ["name"] = svnheader, })
+ svnheader = svnheader_tmp
+ svnupdates = ""
+ end
+ svnupdates = svnupdates .. v
+ end
+ updates.cmdresult = cmdresult
+ return updates
+end