tools: dayssincerelease.hs -> dayssincetag.hs

This commit is contained in:
Simon Michael 2011-09-25 18:29:23 +00:00
parent 42df61393b
commit 7e753e13b5
2 changed files with 10 additions and 6 deletions

View File

@ -806,19 +806,21 @@ showreleasestats stats: \
# simplebench
# showerrors
FROMTAG=.
showreleasedays:
@echo Days since last release:
@tools/dayssincerelease.hs | head -1 | cut -d' ' -f-1
@tools/dayssincetag.hs $(FROMTAG) | head -1 | cut -d' ' -f-1
@echo
showunreleasedchangecount:
@echo Commits since last release:
@darcs changes --from-tag . --count
@darcs changes --from-tag $(FROMTAG) --count
@echo
showreleaseauthors:
@echo Patch authors since last release:
@darcs changes --from-tag . |grep '^\w' |cut -c 31- |sort |uniq
@darcs changes --from-tag $(FROMTAG) |grep '^\w' |cut -c 31- |sort |uniq
@echo
showloc sloccount:
@ -850,7 +852,7 @@ showunpushedchanges unpushed:
showunreleasedcodechanges unreleased:
@echo "hledger code changes since last release:"
@darcs changes --from-tag . --matches "not (name docs: or name doc: or name site: or name tools:)" | grep '*'
@darcs changes --from-tag $(FROMTAG) --matches "not (name docs: or name doc: or name site: or name tools:)" | grep '*'
@echo
showcodechanges:

View File

@ -5,15 +5,17 @@ Similar to:
$ darcs changes --to-tag . --from-tag .|head -n 1 |cut -d' ' -f-7 |xargs -I {} date -d "{}" +%s |xargs -I {} expr \( $(date +%s) - {} \) / 60 / 60 / 24
-}
import Data.Time
import System.Environment
import System.Locale
import System.Process
main = do
s <- readProcess "darcs" ["changes","--from-tag",".","--to-tag","."] ""
tag:_ <- getArgs
s <- readProcess "darcs" ["changes","--from-tag",tag,"--to-tag",tag] ""
let datestr = unwords $ take 6 $ words $ head $ lines s
date = readTime defaultTimeLocale "%a %b %e %H:%M:%S %Z %Y" datestr :: Day
today <- getCurrentDay
putStrLn $ show (diffDays today date) ++ " days since the last tag:\n"
putStrLn $ show (diffDays today date) ++ " days since tag "++tag++":\n"
putStr s
getCurrentDay = do