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