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