You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/05/04 22:02:34 UTC

svn commit: r1334145 - /commons/proper/codec/trunk/src/changes/release-notes.vm

Author: sebb
Date: Fri May  4 20:02:34 2012
New Revision: 1334145

URL: http://svn.apache.org/viewvc?rev=1334145&view=rev
Log:
Handle all action processing in a single macro; simplifies rest of file
Fix up indentation for actions with no issue details
Fix up indentation for actions with shorter issue details

Modified:
    commons/proper/codec/trunk/src/changes/release-notes.vm

Modified: commons/proper/codec/trunk/src/changes/release-notes.vm
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/changes/release-notes.vm?rev=1334145&r1=1334144&r2=1334145&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/changes/release-notes.vm (original)
+++ commons/proper/codec/trunk/src/changes/release-notes.vm Fri May  4 20:02:34 2012
@@ -25,108 +25,67 @@ $introduction.replaceAll("(?<!\015)\012"
 $release.description.replaceAll("  ", "
 ")
 
-## Fix up indentation for multi-line action descriptions
-#macro ( indent )
-#set($action=$action.replaceAll("(?m)^  +","              "))
-#end
-#if ($release.getActions().size() == 0)
-No changes defined in this version.
-#else
-Changes in this version include:
-
-#if ($release.getActions('add').size() !=0)
-New features:
-#foreach($actionItem in $release.getActions('add'))
+## set up indent sizes. Only change indent1
+## indent1 =   CODEC-nnn:
+#set($indent1="          ")
+## indent2 allows for issue wrapper
+#set($indent2="$indent1    ")
+##
+#macro ( processaction )
 ## Use replaceAll to fix up LF-only line ends on Windows.
 #set($action=$actionItem.getAction().replaceAll("\n","
 "))
-#indent()
+## Fix up indentation for multi-line action descriptions
+#set($action=$action.replaceAll("(?m)^  +",$indent2))
 #if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
+#set($issue="$actionItem.getIssue():")
+## Pad shorter issue numbers
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
 #else
-#set($issue="")
+#set($issue=$indent1)
 #end
 #if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
+#set($dueto="Thanks to $actionItem.getDueTo(). ")
 #else
 #set($dueto="")
 #end
-o#if($!issue != "") $issue: #end ${action} #if($!dueto != "")Thanks to $dueto. #end
-
+o $issue  ${action} $dueto
+#set($action="")
 #set($issue="")
 #set($dueto="")
+#end
+##
+#if ($release.getActions().size() == 0)
+No changes defined in this version.
+#else
+Changes in this version include:
+
+#if ($release.getActions('add').size() !=0)
+New features:
+#foreach($actionItem in $release.getActions('add'))
+#processaction()
 #end 
 #end
 
 #if ($release.getActions('fix').size() !=0)
 Fixed Bugs:
 #foreach($actionItem in $release.getActions('fix'))
-## Use replaceAll to fix up LF-only line ends on Windows.
-#set($action=$actionItem.getAction().replaceAll("\n","
-"))
-#indent()
-#if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
-#else
-#set($issue="")
-#end
-#if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
-#else
-#set($dueto="")
-#end
-o#if($!issue != "") $issue: #end ${action} #if($!dueto != "")Thanks to $dueto. #end
-
-#set($issue="")
-#set($dueto="")
+#processaction()
 #end
 #end
 
 #if ($release.getActions('update').size() !=0)
 Changes:
 #foreach($actionItem in $release.getActions('update'))
-## Use replaceAll to fix up LF-only line ends on Windows.
-#set($action=$actionItem.getAction().replaceAll("\n","
-"))
-#indent()
-#if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
-#else
-#set($issue="")
-#end
-#if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
-#else
-#set($dueto="")
-#end
-o#if($!issue != "") $issue: #end ${action} #if($!dueto != "")Thanks to $dueto. #end
-
-#set($issue="")
-#set($dueto="")
+#processaction()
 #end
 #end
 
 #if ($release.getActions('remove').size() !=0)
 Removed:
 #foreach($actionItem in $release.getActions('remove'))
-## Use replaceAll to fix up LF-only line ends on Windows.
-#set($action=$actionItem.getAction().replaceAll("\n","
-"))
-#indent()
-#if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
-#else
-#set($issue="")
-#end
-#if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
-#else
-#set($dueto="")
-#end
-o#if($!issue != "") $issue. #end ${action} #if($!dueto != "")Thanks to $dueto. #end
-
-#set($issue="")
-#set($dueto="")
+#processaction()
 #end
 #end
 ## End of main loop