VersionInfo.st
author Stefan Vogel <sv@exept.de>
Tue, 12 Mar 2019 11:52:43 +0100
changeset 4412 d939c96a62de
parent 4163 32d1c2c5719b
child 4423 d9211217535a
permissions -rw-r--r--
#FEATURE by stefan class: VersionInfo added: #loggedReason removed: #day
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2177
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     1
"
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     2
 COPYRIGHT (c) 2008 by eXept Software AG
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     3
              All Rights Reserved
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     4
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     5
 This software is furnished under a license and may be used
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     6
 only in accordance with the terms of that license and with the
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
     9
 other person.  No title to or ownership of the software is
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    10
 hereby transferred.
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    11
"
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
3745
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
    14
"{ NameSpace: Smalltalk }"
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
    15
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
Object subclass:#VersionInfo
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    17
	instanceVariableNames:'moreAttributes logMessage revision binaryRevision user timestamp
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    18
		date time fileName state'
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'System-SourceCodeManagement'
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!VersionInfo class methodsFor:'documentation'!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
2177
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    26
copyright
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    27
"
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    28
 COPYRIGHT (c) 2008 by eXept Software AG
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    29
              All Rights Reserved
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    30
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    31
 This software is furnished under a license and may be used
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    32
 only in accordance with the terms of that license and with the
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    34
 be provided or otherwise made available to, or used by, any
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    35
 other person.  No title to or ownership of the software is
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    36
 hereby transferred.
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    37
"
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    38
!
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
    39
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
3655
2f83480a5df4 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3517
diff changeset
    42
    In ancient times, Class used to return a Dictionary when asked for versionInfo.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    This has been replaced by instances of this class and subclasses.
3655
2f83480a5df4 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3517
diff changeset
    44
2f83480a5df4 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3517
diff changeset
    45
    Notice, that subclasses may add more info for specific source repositories
2f83480a5df4 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3517
diff changeset
    46
    (CVSVersionInfo, MonticelloVersionInfo etc.).
2f83480a5df4 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3517
diff changeset
    47
    However, any generic tools/ui should only depend on the values (and getters) found here.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [author:]
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        cg (cg@AQUA-DUO)
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
! !
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!VersionInfo methodsFor:'accessing'!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    56
at:aSymbolKey
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    "backward compatible dictionary-like accessing"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    59
    ^ self 
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    60
        at:aSymbolKey 
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    61
        ifAbsent:[ self warn:'VersionInfo: no such property: ',aSymbolKey. nil]
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
     self new at:#binaryRevision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     self new at:#foo
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    "
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    "Modified: / 22-10-2008 / 20:23:31 / cg"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    71
at:aSymbolKey ifAbsent:replacement
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    "backward compatible dictionary-like accessing"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    74
    (self respondsTo:aSymbolKey) ifTrue:[
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    75
        ^ (self perform:aSymbolKey)
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    ].
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    77
    moreAttributes notNil ifTrue:[
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    78
        ^ moreAttributes at:aSymbolKey ifAbsent:replacement
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    79
    ].    
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    80
    ^ replacement value
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
     self new at:#binaryRevision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
     self new at:#foo ifAbsent:#bar
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    "
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "Created: / 22-10-2008 / 20:19:42 / cg"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    90
at:aSymbolKey put:value
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    "backward compatible dictionary-like accessing"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    93
    |setter|
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    94
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    95
    setter := aSymbolKey asMutator.
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    96
    (self respondsTo:setter) ifTrue:[
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
    97
        self perform:setter with:value.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
        ^ value "/ sigh
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    ].
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   100
    moreAttributes isNil ifTrue:[
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   101
        moreAttributes := IdentityDictionary new.
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   102
    ].
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   103
    moreAttributes at:aSymbolKey put:value.
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   104
    ^ value "/ sigh
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    "
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
     self new at:#binaryRevision put:#bar
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   108
     self new at:#foo put:#bar; yourself
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    "
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    "Created: / 22-10-2008 / 20:20:54 / cg"
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
2667
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   114
author
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   115
    ^ self user
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   116
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   117
    "Created: / 21-12-2011 / 23:09:54 / cg"
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   118
!
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   119
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   120
author:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   121
    ^ self user:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   122
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   123
    "Created: / 21-12-2011 / 23:09:54 / cg"
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   124
!
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   125
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
binaryRevision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    ^ binaryRevision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   130
binaryRevision:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   131
    binaryRevision := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
date
4140
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   135
    timestamp notNil ifTrue:[^ timestamp asDate].
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    ^ date
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
date:something
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    date := something.
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
fileName
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    ^ fileName
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   147
fileName:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   148
    fileName := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
keysAndValuesDo:aBlock
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    self class instVarNames do:[:nm |
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   153
        nm ~= 'moreAttributes' ifTrue:[   
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   154
            aBlock value:(nm asSymbol) value:(self perform:nm asSymbol)
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   155
        ].
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   156
    ].
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   157
    moreAttributes notNil ifTrue:[
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   158
        moreAttributes keysAndValuesDo:aBlock
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    ].
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   160
    
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   161
    "Created: / 22-10-2008 / 20:48:08 / cg"
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   162
!
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   164
logMessage
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   165
    ^ logMessage
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   166
!
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   167
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   168
logMessage:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   169
    logMessage := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
4412
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   172
loggedReason
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   173
    "Answer the reason for the change extracted from the log message
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   174
     or empty string if unknown."
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   175
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   176
    |log|
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   177
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   178
    logMessage size < 2 ifTrue:[
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   179
        ^ ''.
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   180
    ].
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   181
    log := logMessage withoutSeparators.
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   182
    (log startsWith:$#) ifFalse:[
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   183
        ^ ''.
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   184
    ].
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   185
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   186
    ^ log readStream nextAlphaNumericWord ? ''.
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   187
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   188
    "Created: / 12-03-2019 / 11:36:04 / Stefan Vogel"
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   189
!
d939c96a62de #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4163
diff changeset
   190
3745
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   191
majorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   192
    |v|
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   193
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   194
    v := self revision.
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   195
    v notEmptyOrNil ifTrue:[
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   196
        ^ v upTo:$.
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   197
    ].
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   198
    ^ nil
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   199
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   200
    "
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   201
     Array revisionInfo majorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   202
    "
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   203
!
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   204
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   205
minorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   206
    |v|
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   207
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   208
    v := self revision.
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   209
    v notEmptyOrNil ifTrue:[
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   210
        ^ v copyFrom:(v indexOf:$.)+1
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   211
    ].
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   212
    ^ nil
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   213
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   214
    "
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   215
     Array revisionInfo minorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   216
    "
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   217
!
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   218
2608
vrany
parents: 2382
diff changeset
   219
repositoryPathName
vrany
parents: 2382
diff changeset
   220
    "raise an error: must be redefined in concrete subclass(es)"
vrany
parents: 2382
diff changeset
   221
vrany
parents: 2382
diff changeset
   222
    ^ nil "Not known"
vrany
parents: 2382
diff changeset
   223
vrany
parents: 2382
diff changeset
   224
    "Modified: / 23-11-2011 / 23:33:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2382
diff changeset
   225
!
vrany
parents: 2382
diff changeset
   226
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
revision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    ^ revision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   231
revision:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   232
    revision := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
4142
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   235
state
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   236
    ^ state
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   237
!
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   238
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   239
state:something
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   240
    state := something.
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   241
!
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   242
3662
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   243
symbolicVersionName
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   244
    "iff that source code manager uses cryptic names for versions,
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   245
     (eg. dbManager, git and hg managers), we may add an additional symbolic
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   246
     version name, which is used for human readers (and not required to be unique).
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   247
     Usually something like x.y-nn, where nn is the user name is returned there.
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   248
     Here, we return the revision proper, which is ok for cvs, svn and others with a 
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   249
     user-friendly version number."
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   250
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   251
    ^ revision
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   252
!
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   253
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
time
4140
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   255
    timestamp notNil ifTrue:[^ timestamp asTime].
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    ^ time
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
time:something
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    time := something.
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
2640
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   263
timeStamp:aTimestamp
2667
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   264
    date := aTimestamp asDate.
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   265
    time := aTimestamp asTime.
2640
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   266
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   267
    "Created: / 04-12-2011 / 10:06:02 / cg"
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   268
!
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   269
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   270
timestamp
4140
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   271
    timestamp notNil ifTrue:[^ timestamp].
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   272
    date isNil ifTrue:[^ nil].
4163
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   273
    time isNil ifTrue:[
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   274
        Error handle:[:ex |
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   275
            ^ nil
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   276
        ] do:[    
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   277
            ^ date asTimestamp
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   278
        ].
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   279
    ].
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   280
    ^ Timestamp fromDate:date andTime:time
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   281
!
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   282
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   283
timestamp:aTimestamp
4140
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   284
    timestamp := aTimestamp
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   285
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   286
    "Created: / 04-12-2011 / 10:06:02 / cg"
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   287
!
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   288
2608
vrany
parents: 2382
diff changeset
   289
timezone
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   290
    timestamp notNil ifTrue:[^ timestamp timezone].
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   291
    
2608
vrany
parents: 2382
diff changeset
   292
    ^ nil "Not known"
vrany
parents: 2382
diff changeset
   293
vrany
parents: 2382
diff changeset
   294
    "Modified: / 23-11-2011 / 13:54:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2382
diff changeset
   295
!
vrany
parents: 2382
diff changeset
   296
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
user
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    ^ user
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   301
user:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   302
    user := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
! !
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
!VersionInfo class methodsFor:'documentation'!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
3662
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   307
version
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   308
    ^ '$Header$'
3662
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   309
!
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   310
2177
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
   311
version_CVS
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   312
    ^ '$Header$'
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
! !
3517
b94e2737c469 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   314