MetacelloVersionSpec.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 05 Sep 2012 18:56:24 +0000
changeset 8 e046a5b3427f
parent 1 9e312de5f694
permissions -rw-r--r--
- Fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     1
"{ Package: 'stx:goodies/metacello' }"
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     2
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     3
MetacelloSpec subclass:#MetacelloVersionSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     4
	instanceVariableNames:'versionString blessing description author timestamp preLoadDoIt
8
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
     5
		postLoadDoIt packages'
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     6
	classVariableNames:''
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     7
	poolDictionaries:''
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     8
	category:'Metacello-Core-Specs'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     9
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    10
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    11
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    12
!MetacelloVersionSpec methodsFor:'accessing'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    13
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    14
author
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    15
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    16
	author == nil 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    17
		ifTrue: [
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    18
			^self project valueHolderSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    19
				value: '';
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    20
				yourself].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    21
	^ author
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    22
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    23
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    24
author: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    25
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    26
	anObject setAuthorInMetacelloVersion: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    27
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    28
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    29
blessing
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    30
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    31
	blessing == nil 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    32
		ifTrue: [
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    33
			^self project valueHolderSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    34
				value: self project defaultBlessing;
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    35
				yourself].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    36
	^ blessing
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    37
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    38
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    39
blessing: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    40
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    41
	anObject setBlessingInMetacelloVersion: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    42
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    43
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    44
description
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    45
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    46
	description == nil 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    47
		ifTrue: [
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    48
			^self project valueHolderSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    49
				value: '';
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    50
				yourself].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    51
	^ description
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    52
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    53
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    54
description: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    55
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    56
	anObject setDescriptionInMetacelloVersion: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    57
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    58
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    59
getAuthor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    60
	^author
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    61
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    62
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    63
getBlessing
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    64
	^blessing
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    65
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    66
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    67
getDescription
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    68
	^description
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    69
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    70
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    71
getPostLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    72
	^postLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    73
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    74
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    75
getPreLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    76
	^preLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    77
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    78
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    79
getTimestamp
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    80
	^timestamp
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    81
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    82
8
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    83
packages
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    84
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    85
    packages == nil ifTrue: [ packages := self project packagesSpec ].
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    86
    ^ packages
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    87
!
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    88
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    89
packages:something
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    90
    packages := something.
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    91
!
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
    92
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    93
postLoadDoIt: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    94
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    95
	anObject setPostLoadDoItInMetacelloSpec: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    96
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    97
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    98
preLoadDoIt: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    99
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   100
	anObject setPreLoadDoItInMetacelloSpec: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   101
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   102
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   103
projectLabel
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   104
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   105
	^self project label
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   106
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   107
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   108
setAuthor: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   109
	author := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   110
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   111
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   112
setBlessing: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   113
	blessing := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   114
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   115
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   116
setDescription: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   117
	description := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   118
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   119
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   120
setPostLoadDoIt: aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   121
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   122
	postLoadDoIt := aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   123
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   124
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   125
setPreLoadDoIt: aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   126
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   127
	preLoadDoIt := aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   128
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   129
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   130
setTimestamp: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   131
	timestamp := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   132
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   133
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   134
timestamp
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   135
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   136
	timestamp == nil 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   137
		ifTrue: [
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   138
			^self project valueHolderSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   139
				value: '';
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   140
				yourself].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   141
	^ timestamp
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   142
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   143
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   144
timestamp: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   145
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   146
	anObject setTimestampInMetacelloVersion: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   147
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   148
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   149
versionString: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   150
	versionString := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   151
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   152
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   153
!MetacelloVersionSpec methodsFor:'construction'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   154
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   155
author: aBlockOrString constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   156
    aVersionConstructor authorForVersion: aBlockOrString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   157
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   158
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   159
blessing: aBlockOrString constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   160
    aVersionConstructor blessingForVersion: aBlockOrString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   161
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   162
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   163
description: aBlockOrString constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   164
    aVersionConstructor descriptionForVersion: aBlockOrString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   165
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   166
8
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
   167
package: aString constructor: aVersionConstructor
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
   168
    aVersionConstructor packageForVersion: aString
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
   169
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
   170
    "Created: / 05-09-2012 / 19:17:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
   171
!
e046a5b3427f - Fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1
diff changeset
   172
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   173
postLoadDoIt: aSymbol constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   174
    aVersionConstructor postLoadDoItForVersion: aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   175
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   176
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   177
preLoadDoIt: aSymbol constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   178
    aVersionConstructor preLoadDoItForVersion: aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   179
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   180
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   181
repositories: aBlock constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   182
    aVersionConstructor repositoriesForVersion: aBlock
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   183
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   184
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   185
repository: anObject constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   186
    aVersionConstructor repositoryForVersion: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   187
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   188
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   189
repository: aString username: username password: password constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   190
    aVersionConstructor repositoryForVersion: aString username: username password: password
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   191
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   192
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   193
timestamp: aBlockOrStringOrDateAndTime constructor: aVersionConstructor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   194
    aVersionConstructor timestampForVersion: aBlockOrStringOrDateAndTime
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   195
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   196
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   197
!MetacelloVersionSpec methodsFor:'copying'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   198
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   199
postCopy
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   200
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   201
	super postCopy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   202
	blessing := blessing copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   203
	description := description copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   204
	author := author copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   205
	timestamp := timestamp copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   206
	
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   207
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   208
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   209
!MetacelloVersionSpec methodsFor:'merging'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   210
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   211
mergeMap
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   212
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   213
	| map |
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   214
	map := super mergeMap.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   215
	map at: #versionString put: versionString.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   216
	map at: #blessing put: blessing.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   217
	map at: #description put: description.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   218
	map at: #author put: author.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   219
	map at: #timestamp put: timestamp.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   220
	map at: #preLoadDoIt put: preLoadDoIt.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   221
	map at: #postLoadDoIt put: postLoadDoIt.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   222
	^map
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   223
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   224
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   225
!MetacelloVersionSpec methodsFor:'printing'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   226
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   227
configMethodOn: aStream for: spec selector: selector last: last indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   228
	spec == nil
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   229
		ifTrue: [ ^ self ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   230
	aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   231
		tab: indent;
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   232
		nextPutAll: 'spec ' , selector , ' [';
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   233
		cr.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   234
	spec configMethodOn: aStream indent: indent + 1.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   235
	aStream nextPutAll: ' ].'.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   236
	last
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   237
		ifFalse: [ aStream cr ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   238
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   239
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   240
configMethodOn: aStream indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   241
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   242
	self configMethodOn: aStream last: true indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   243
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   244
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   245
configMethodOn: aStream last: last indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   246
	| values lastIndex lastBlock |
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   247
	last
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   248
		ifTrue: [ 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   249
			"need to calculate last statement with a value"
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   250
			values := {(self getBlessing).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   251
			(self getDescription).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   252
			(self getPreLoadDoIt).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   253
			(self getPostLoadDoIt).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   254
			(self getAuthor).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   255
			(self getTimestamp)}.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   256
			1 to: values size do: [ :index | 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   257
				(values at: index) ~~ nil
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   258
					ifTrue: [ lastIndex := index ] ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   259
			lastBlock := [ :arg | arg = lastIndex ] ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   260
		ifFalse: [ lastBlock := [ :arg | false ] ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   261
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   262
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   263
		for: self getBlessing
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   264
		selector: 'blessing:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   265
		last: (lastBlock value: 1)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   266
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   267
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   268
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   269
		for: self getDescription
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   270
		selector: 'description:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   271
		last: (lastBlock value: 2)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   272
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   273
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   274
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   275
		for: self getPreLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   276
		selector: 'preLoadDoIt:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   277
		last: (lastBlock value: 3)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   278
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   279
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   280
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   281
		for: self getPostLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   282
		selector: 'postLoadDoIt:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   283
		last: (lastBlock value: 4)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   284
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   285
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   286
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   287
		for: self getAuthor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   288
		selector: 'author:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   289
		last: (lastBlock value: 5)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   290
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   291
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   292
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   293
		for: self getTimestamp
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   294
		selector: 'timestamp:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   295
		last: (lastBlock value: 6)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   296
		indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   297
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   298
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   299
configMethodValueOn: aStream for: spec selector: selector last: last indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   300
	| valuePrintString |
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   301
	spec == nil
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   302
		ifTrue: [ ^ self ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   303
	valuePrintString := spec value isSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   304
		ifTrue: [ '#' , spec value asString printString ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   305
		ifFalse: [ spec value printString ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   306
	aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   307
		tab: indent;
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   308
		nextPutAll: 'spec ' , selector , ' ' , valuePrintString , '.'.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   309
	last
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   310
		ifFalse: [ aStream cr ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   311
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   312
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   313
configSpawnMethodOn: aStream indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   314
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   315
	self configMethodValueOn: aStream for: self getBlessing selector: 'blessing:' last: false indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   316
	self configMethodValueOn: aStream for: self getAuthor selector: 'author:' last: false indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   317
	self configMethodValueOn: aStream for: self getTimestamp selector: 'timestamp:' last: false indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   318
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   319
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   320
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   321
label
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   322
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   323
	^self versionString, ' [', self projectLabel, ']'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   324
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   325
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   326
!MetacelloVersionSpec methodsFor:'private'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   327
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   328
createVersion
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   329
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   330
	^self versionClass fromSpec: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   331
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   332
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   333
versionClass
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   334
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   335
	^MetacelloVersion
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   336
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   337
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   338
versionNumber
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   339
    ^ self project versionNumberClass fromString: self versionString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   340
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   341
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   342
!MetacelloVersionSpec methodsFor:'querying'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   343
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   344
postLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   345
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   346
	^postLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   347
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   348
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   349
preLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   350
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   351
	^preLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   352
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   353
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   354
versionString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   355
	versionString == nil ifTrue: [ ^'' ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   356
	^ versionString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   357
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   358
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   359
!MetacelloVersionSpec methodsFor:'testing'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   360
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   361
isPartiallyCurrent: notLoadedMatters useEquality: useEquality
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   362
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   363
	self subclassResponsibility
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   364
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   365
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   366
isPossibleBaseline
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   367
    self subclassResponsibility
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   368
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   369
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   370
!MetacelloVersionSpec class methodsFor:'documentation'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   371
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   372
version_SVN
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   373
    ^ '$Id::                                                                                                                        $'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   374
! !