#FEATURE
class: AbstractSourceCodeManager
changed: #writeRevisionLogMessagesFrom:withHeader:to:
colorize revision log
--- a/AbstractSourceCodeManager.st Sat Sep 05 12:09:30 2015 +0200
+++ b/AbstractSourceCodeManager.st Wed Sep 09 16:26:59 2015 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1995 by Claus Gittinger
All Rights Reserved
@@ -2511,12 +2509,12 @@
|versionString|
- versionString := aString copyWithout: $§.
+ versionString := aString copyWithout: $§.
^ self ensureKeywordExpansionWith: $$ inVersionMethod:versionString.
"
self ensureDollarsInVersionMethod:'foo ^ ''hello'' '
- self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' '
+ self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' '
self ensureDollarsInVersionMethod:'foo ^ '' hello '' '
self ensureDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '
-- errors:
@@ -2601,17 +2599,17 @@
,aCharacter asString ,(aString copyFrom:indexOfLastQuote)
"
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ '' hello '' '
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ '' hello '' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''hello'' '
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ '' hello '' '
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '
-- errors:
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '
"
!
@@ -2624,23 +2622,23 @@
ensureNoDollarsInVersionMethod:aString
"given the source code of another manager's version method, ensure that it does NOT
- contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
+ contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
|versionString|
versionString := aString copyWithout: $$.
- ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
+ ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
"
self ensureNoDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '
self ensureNoDollarsInVersionMethod:'foo ^ ''$','Head'' '
self ensureNoDollarsInVersionMethod:'foo ^ ''Header$'' '
- self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '
+ self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '
-- errors:
- self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '
- self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '
+ self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '
+ self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '
"
!
@@ -3734,24 +3732,29 @@
].
(log at:#revisions ifAbsent:#()) do:[:entry |
- |logMsg|
+ |logMsg color|
aStream cr.
aStream nextPutAll:' revision ';
- show:(entry at:#revision); tab.
+ show:(entry at:#revision) allBold; tab.
aStream nextPutAll:' date: ';
show:((entry at:#date ifAbsent:nil) ? '?'); space;
show:((entry at:#time ifAbsent:nil) ? '?'); tab.
aStream nextPutAll:' author: ';
- show:(entry at:#author ifAbsent:nil) ? '?'; tab.
+ show:((entry at:#author ifAbsent:nil) ? '?') allBold; tab.
aStream nextPutAll:' lines: ';
show:(entry at:#numberOfChangedLines ifAbsent:nil) ? '?'; cr.
logMsg := entry at:#logMessage ifAbsent:''.
+ color := Color orange.
(logMsg isBlank or:[logMsg withoutSeparators = '.']) ifTrue:[
- logMsg := '*** empty log message ***'
+ logMsg := '*** empty log message ***'.
+ color := Color red.
].
- aStream tab; nextPutLine:logMsg.
+ logMsg asCollectionOfLines do:[:eachLine |
+ aStream tab.
+ aStream nextPutAllText:(eachLine colorizeAllWith:color); cr.
+ ].
].
"Created: / 16-11-1995 / 13:25:30 / cg"