SourceCodeManagerUtilities.st
changeset 4007 ffa3939cd5af
parent 3993 209a7d800ea0
child 4009 2289742cbd69
child 4037 fd687625bcad
equal deleted inserted replaced
4005:1005cc640f09 4007:ffa3939cd5af
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2000 eXept Software AG
     4  COPYRIGHT (c) 2000 eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  2627 "/            (info includesKey:#directory) ifTrue:[
  2629 "/            (info includesKey:#directory) ifTrue:[
  2628 "/                package := (info at:#directory).
  2630 "/                package := (info at:#directory).
  2629 "/            ].
  2631 "/            ].
  2630 "/        ].
  2632 "/        ].
  2631         fileName := mgr containerFromSourceInfo:info.
  2633         fileName := mgr containerFromSourceInfo:info.
       
  2634         fileName isNil ifTrue:[ fileName := aClass classFilename ].
  2632         (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
  2635         (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
  2633             nameSpacePrefix := nameSpace name , '::'.
  2636             nameSpacePrefix := nameSpace name , '::'.
  2634             fileName := fileName withoutPrefix:nameSpacePrefix.
  2637             fileName := fileName withoutPrefix:nameSpacePrefix.
  2635         ].
  2638         ].
  2636 "/        (info includesKey:#fileName) ifTrue:[
  2639 "/        (info includesKey:#fileName) ifTrue:[
  2882         ].
  2885         ].
  2883     ].
  2886     ].
  2884     ^ true
  2887     ^ true
  2885 
  2888 
  2886     "Created: / 21-12-2011 / 18:34:02 / cg"
  2889     "Created: / 21-12-2011 / 18:34:02 / cg"
       
  2890     "Modified: / 30-04-2016 / 11:58:11 / cg"
  2887 !
  2891 !
  2888 
  2892 
  2889 diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
  2893 diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
  2890     ^ self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
  2894     ^ self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
  2891 !
  2895 !
  4041                          collect:[:assoc | assoc key]) reverse.
  4045                          collect:[:assoc | assoc key]) reverse.
  4042             tagList remove:'stable' ifAbsent:[].
  4046             tagList remove:'stable' ifAbsent:[].
  4043             tagList notEmpty ifTrue:[tagList addFirst:'-'].
  4047             tagList notEmpty ifTrue:[tagList addFirst:'-'].
  4044             tagList addFirst:'stable'.
  4048             tagList addFirst:'stable'.
  4045         ].
  4049         ].
  4046             
  4050 
  4047         items := revisions collect:[:each | |rev date who flag|
  4051         "/ fill in timestamps
  4048                                         rev := each at:#revision.
  4052         revisions do:[:each |
  4049                                         date := (each at:#date ifAbsent:nil) ? '?'.
  4053             |timestampString timestamp|
  4050                                         who := (each at:#author ifAbsent:nil) ? '?'.
  4054 
  4051                                         rev = stableRevision ifTrue:[
  4055             timestampString := each at:#date ifAbsent:nil.
  4052                                             flag := ' Stable' allBold.
  4056             timestampString notNil ifTrue:[
  4053                                         ] ifFalse:[rev = releasedRevision ifTrue:[
  4057                 timestamp := Timestamp readFrom:timestampString onError:nil.
  4054                                             flag := ' Released' allBold.
  4058                 timestamp notNil ifTrue:[
  4055                                         ] ifFalse:[
  4059                     each at:#timestamp put:timestamp.
  4056                                             flag := ' '
  4060                     each at:#day put:timestamp asDate.
  4057                                         ]].
  4061                 ].
  4058                                         rev allBold , flag, ' [' , date , ' by ' , who , ']'
  4062             ].
  4059                                    ].
  4063         ].
       
  4064 
       
  4065         items := revisions 
       
  4066                     collectWithIndex:[:each :idx| 
       
  4067                         |rev timestamp date time dateAndTimeString who flag 
       
  4068                          prevInfo prevDate nextInfo nextDate dateDifferentToPrev dateDifferentToNext|
       
  4069 
       
  4070                         rev := each at:#revision.
       
  4071 
       
  4072                         timestamp := each at:#timestamp.
       
  4073                         timestamp notNil ifTrue:[
       
  4074                             date := each at:#day.
       
  4075                             date = Date today ifTrue:[
       
  4076                                 dateAndTimeString := timestamp asTime printString.
       
  4077                             ] ifFalse:[
       
  4078                                 "/ if date is different to both previous AND next,
       
  4079                                 "/ only show the date
       
  4080                                 dateDifferentToPrev := dateDifferentToNext := false.
       
  4081                                 (idx > 1) ifTrue:[
       
  4082                                     prevInfo := revisions at:idx-1.
       
  4083                                     prevDate := prevInfo at:#day ifAbsent:nil.
       
  4084                                     dateDifferentToPrev := (prevDate notNil and:[prevDate ~= date]).
       
  4085                                 ].
       
  4086                                 (idx < revisions size) ifTrue:[
       
  4087                                     nextInfo := revisions at:idx+1.
       
  4088                                     nextDate := nextInfo at:#day ifAbsent:nil.
       
  4089                                     dateDifferentToNext := (nextDate notNil and:[nextDate ~= date]).
       
  4090                                 ].
       
  4091                                 (dateDifferentToPrev and:[dateDifferentToPrev]) ifTrue:[
       
  4092                                     dateAndTimeString := date printString.
       
  4093                                 ] ifFalse:[
       
  4094                                     dateAndTimeString := date printString,' ',(timestamp asTime printString).
       
  4095                                 ]
       
  4096                             ].
       
  4097                         ] ifFalse:[
       
  4098                             dateAndTimeString := (each at:#date ifAbsent:nil) ? '(unknown time)'.
       
  4099                         ].
       
  4100                         who := (each at:#author ifAbsent:nil) ? '?'.
       
  4101                         rev = stableRevision ifTrue:[
       
  4102                             flag := ' Stable' allBold.
       
  4103                         ] ifFalse:[rev = releasedRevision ifTrue:[
       
  4104                             flag := ' Released' allBold.
       
  4105                         ] ifFalse:[
       
  4106                             flag := ''
       
  4107                         ]].
       
  4108                         '%1%2 [%3 by %4]' bindWith:rev allBold with:flag with:dateAndTimeString with:who 
       
  4109                    ].
       
  4110 
  4060         revisions := revisions collect:[:each | each at:#revision].
  4111         revisions := revisions collect:[:each | each at:#revision].
  4061     ] ifFalse:[
  4112     ] ifFalse:[
  4062         newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module.
  4113         newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module.
  4063         revisions := items := nil.
  4114         revisions := items := nil.
  4064 
  4115 
  4178         module:'stx'
  4229         module:'stx'
  4179         directory:'libbasic'
  4230         directory:'libbasic'
  4180         fileName:'Array.st'
  4231         fileName:'Array.st'
  4181     "
  4232     "
  4182 
  4233 
  4183     "Modified: / 21-12-2011 / 23:09:26 / cg"
  4234     "Modified: / 30-04-2016 / 14:32:17 / cg"
  4184 !
  4235 !
  4185 
  4236 
  4186 checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
  4237 checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
  4187     "check if a class contains message-sends to:
  4238     "check if a class contains message-sends to:
  4188         #halt , #halt:
  4239         #halt , #halt: