--- a/VersionDiffBrowser.st Tue Jun 21 10:20:57 2016 +0200
+++ b/VersionDiffBrowser.st Tue Jun 21 10:26:33 2016 +0200
@@ -2298,32 +2298,34 @@
"update the labels of the diff text view. Show the version numbers
of the class."
- |theVersionA theVersionB builder revInfo labelA labelB date author|
-
+ |theVersionA theVersionB builder makeLabel|
+
+ makeLabel :=
+ [:theVersion |
+ |label date author revInfo|
+
+ label := theVersion.
+ versionInfoList notNil ifTrue:[
+ revInfo := versionInfoList detect:[:info | (info at:#revision) = theVersion] ifNone:nil.
+ revInfo notNil ifTrue:[
+ date := (Timestamp readGeneralizedFrom:(revInfo at:#date)) asDate.
+ author := (revInfo at:#author) ? '?'.
+ label := theVersion , ' [',date printString,' by ',author,']'.
+ ].
+ ].
+ label
+ ].
+
builder := self builder.
(theVersionA := self versionA) notNil ifTrue:[
- labelA := theVersionA.
- revInfo := versionInfoList detect:[:info | (info at:#revision) = theVersionA value] ifNone:nil.
- revInfo notNil ifTrue:[
- date := (Timestamp readGeneralizedFrom:(revInfo at:#date)) asDate.
- author := (revInfo at:#author) ? '?'.
- labelA := theVersionA , ' [',date printString,' by ',author,']'.
- ].
- self diffTextLabelA value:labelA.
+ self diffTextLabelA value:(makeLabel value:theVersionA).
self onlyInALabelHolder value:('Only in ' , theVersionA).
(self componentAt:#OnlyInALabel)
foregroundColor:Color white;
backgroundColor:Color green darkened.
].
(theVersionB :=self versionB) notNil ifTrue:[
- labelB := theVersionB.
- revInfo := versionInfoList detect:[:info | (info at:#revision) = theVersionB value] ifNone:nil.
- revInfo notNil ifTrue:[
- date := (Timestamp readGeneralizedFrom:(revInfo at:#date)) asDate.
- author := (revInfo at:#author) ? '?'.
- labelA := theVersionB , ' [',date printString,' by ',author,']'.
- ].
- self diffTextLabelB value:labelB.
+ self diffTextLabelB value:(makeLabel value:theVersionB).
self onlyInBLabelHolder value:('Only in ' , theVersionB).
(self componentAt:#OnlyInBLabel)
foregroundColor:Color white;