VersionInfo.st
author Claus Gittinger <cg@exept.de>
Mon, 20 Aug 2018 10:11:25 +0200
changeset 4346 6604af2f1554
parent 4163 32d1c2c5719b
child 4167 ee0c93ae59e0
child 4412 d939c96a62de
permissions -rw-r--r--
#OTHER by cg class: FileBasedSourceCodeManager class removed: #version_FileRepository
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
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   143
day
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   144
    ^ date
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   145
!
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   146
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
fileName
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    ^ fileName
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   151
fileName:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   152
    fileName := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
keysAndValuesDo:aBlock
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    self class instVarNames do:[:nm |
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   157
        nm ~= 'moreAttributes' ifTrue:[   
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   158
            aBlock value:(nm asSymbol) value:(self perform:nm asSymbol)
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   159
        ].
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
    moreAttributes notNil ifTrue:[
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   162
        moreAttributes keysAndValuesDo:aBlock
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
    
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   165
    "Created: / 22-10-2008 / 20:48:08 / cg"
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   166
!
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   168
logMessage
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   169
    ^ logMessage
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   170
!
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   171
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   172
logMessage:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   173
    logMessage := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
3745
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   176
majorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   177
    |v|
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   178
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   179
    v := self revision.
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   180
    v notEmptyOrNil ifTrue:[
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   181
        ^ v upTo:$.
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   182
    ].
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   183
    ^ nil
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   184
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   185
    "
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   186
     Array revisionInfo majorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   187
    "
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   188
!
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   189
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   190
minorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   191
    |v|
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   192
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   193
    v := self revision.
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   194
    v notEmptyOrNil ifTrue:[
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   195
        ^ v copyFrom:(v indexOf:$.)+1
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   196
    ].
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   197
    ^ nil
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   198
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
     Array revisionInfo minorVersion
0c3d925c0347 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
   201
    "
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
2608
vrany
parents: 2382
diff changeset
   204
repositoryPathName
vrany
parents: 2382
diff changeset
   205
    "raise an error: must be redefined in concrete subclass(es)"
vrany
parents: 2382
diff changeset
   206
vrany
parents: 2382
diff changeset
   207
    ^ nil "Not known"
vrany
parents: 2382
diff changeset
   208
vrany
parents: 2382
diff changeset
   209
    "Modified: / 23-11-2011 / 23:33:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2382
diff changeset
   210
!
vrany
parents: 2382
diff changeset
   211
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
revision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    ^ revision
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   216
revision:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   217
    revision := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
4142
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   220
state
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   221
    ^ state
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   222
!
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   223
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   224
state:something
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   225
    state := something.
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   226
!
30bea8affad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   227
3662
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   228
symbolicVersionName
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   229
    "iff that source code manager uses cryptic names for versions,
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   230
     (eg. dbManager, git and hg managers), we may add an additional symbolic
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   231
     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
   232
     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
   233
     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
   234
     user-friendly version number."
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   235
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   236
    ^ revision
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   237
!
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   238
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
time
4140
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   240
    timestamp notNil ifTrue:[^ timestamp asTime].
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    ^ time
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
time:something
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    time := something.
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
2640
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   248
timeStamp:aTimestamp
2667
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   249
    date := aTimestamp asDate.
c496ecfe718d added: #author
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   250
    time := aTimestamp asTime.
2640
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   251
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   252
    "Created: / 04-12-2011 / 10:06:02 / cg"
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   253
!
f214ff2248ed added: #timeStamp:
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   254
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   255
timestamp
4140
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   256
    timestamp notNil ifTrue:[^ timestamp].
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   257
    date isNil ifTrue:[^ nil].
4163
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   258
    time isNil ifTrue:[
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   259
        Error handle:[:ex |
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   260
            ^ nil
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   261
        ] do:[    
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   262
            ^ date asTimestamp
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   263
        ].
32d1c2c5719b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4161
diff changeset
   264
    ].
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   265
    ^ Timestamp fromDate:date andTime:time
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   266
!
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   267
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   268
timestamp:aTimestamp
4140
0f192ecaf39e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4137
diff changeset
   269
    timestamp := aTimestamp
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   270
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   271
    "Created: / 04-12-2011 / 10:06:02 / cg"
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   272
!
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   273
2608
vrany
parents: 2382
diff changeset
   274
timezone
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   275
    timestamp notNil ifTrue:[^ timestamp timezone].
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   276
    
2608
vrany
parents: 2382
diff changeset
   277
    ^ nil "Not known"
vrany
parents: 2382
diff changeset
   278
vrany
parents: 2382
diff changeset
   279
    "Modified: / 23-11-2011 / 13:54:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2382
diff changeset
   280
!
vrany
parents: 2382
diff changeset
   281
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
user
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
    ^ user
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
4161
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   286
user:aString
55ad833b981e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4142
diff changeset
   287
    user := aString.
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
! !
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
!VersionInfo class methodsFor:'documentation'!
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
3662
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   292
version
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   293
    ^ '$Header$'
3662
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   294
!
576a064f048e class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
   295
2177
ec8a8ef58c34 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
   296
version_CVS
4137
c0d64b4ef710 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3745
diff changeset
   297
    ^ '$Header$'
2028
1f54c88269b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
! !
3517
b94e2737c469 class: VersionInfo
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   299