core/MetacelloVersionSpec.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 18 Sep 2012 18:24:44 +0000
changeset 16 25ac697dc747
parent 14 f01fe37493e9
permissions -rw-r--r--
- Updated from branch master
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
d354ac2af7ec Metacello package refactoring - phase 2~
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10
diff changeset
     1
"{ Package: 'stx:goodies/metacello/core' }"
1
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
14
f01fe37493e9 - MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 11
diff changeset
     5
		postLoadDoIt'
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
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    83
postLoadDoIt: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    84
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    85
	anObject setPostLoadDoItInMetacelloSpec: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    86
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    87
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    88
preLoadDoIt: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    89
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    90
	anObject setPreLoadDoItInMetacelloSpec: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    91
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    92
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    93
projectLabel
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    94
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    95
	^self project label
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    96
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    97
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    98
setAuthor: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    99
	author := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   100
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   101
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   102
setBlessing: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   103
	blessing := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   104
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   105
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   106
setDescription: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   107
	description := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   108
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   109
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   110
setPostLoadDoIt: aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   111
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   112
	postLoadDoIt := aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   113
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   114
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   115
setPreLoadDoIt: aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   116
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   117
	preLoadDoIt := aSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   118
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   119
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   120
setTimestamp: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   121
	timestamp := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   122
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   123
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   124
timestamp
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   125
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   126
	timestamp == nil 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   127
		ifTrue: [
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   128
			^self project valueHolderSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   129
				value: '';
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   130
				yourself].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   131
	^ timestamp
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: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   135
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   136
	anObject setTimestampInMetacelloVersion: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   137
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   138
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   139
versionString: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   140
	versionString := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   141
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   142
16
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   143
!MetacelloVersionSpec methodsFor:'construction'!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   144
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   145
author: aBlockOrString constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   146
    aVersionConstructor authorForVersion: aBlockOrString
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   147
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   148
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   149
blessing: aBlockOrString constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   150
    aVersionConstructor blessingForVersion: aBlockOrString
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   151
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   152
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   153
description: aBlockOrString constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   154
    aVersionConstructor descriptionForVersion: aBlockOrString
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   155
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   156
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   157
postLoadDoIt: aSymbol constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   158
    aVersionConstructor postLoadDoItForVersion: aSymbol
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   159
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   160
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   161
preLoadDoIt: aSymbol constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   162
    aVersionConstructor preLoadDoItForVersion: aSymbol
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   163
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   164
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   165
repositories: aBlock constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   166
    aVersionConstructor repositoriesForVersion: aBlock
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   167
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   168
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   169
repository: anObject constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   170
    aVersionConstructor repositoryForVersion: anObject
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   171
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   172
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   173
repository: aString username: username password: password constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   174
    aVersionConstructor repositoryForVersion: aString username: username password: password
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   175
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   176
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   177
timestamp: aBlockOrStringOrDateAndTime constructor: aVersionConstructor
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   178
    aVersionConstructor timestampForVersion: aBlockOrStringOrDateAndTime
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   179
! !
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   180
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   181
!MetacelloVersionSpec methodsFor:'copying'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   182
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   183
postCopy
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   184
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   185
	super postCopy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   186
	blessing := blessing copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   187
	description := description copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   188
	author := author copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   189
	timestamp := timestamp copy.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   190
	
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   191
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   192
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   193
!MetacelloVersionSpec methodsFor:'merging'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   194
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   195
mergeMap
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   196
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   197
	| map |
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   198
	map := super mergeMap.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   199
	map at: #versionString put: versionString.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   200
	map at: #blessing put: blessing.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   201
	map at: #description put: description.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   202
	map at: #author put: author.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   203
	map at: #timestamp put: timestamp.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   204
	map at: #preLoadDoIt put: preLoadDoIt.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   205
	map at: #postLoadDoIt put: postLoadDoIt.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   206
	^map
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:'printing'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   210
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   211
configMethodOn: aStream for: spec selector: selector last: last indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   212
	spec == nil
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   213
		ifTrue: [ ^ self ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   214
	aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   215
		tab: indent;
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   216
		nextPutAll: 'spec ' , selector , ' [';
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   217
		cr.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   218
	spec configMethodOn: aStream indent: indent + 1.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   219
	aStream nextPutAll: ' ].'.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   220
	last
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   221
		ifFalse: [ aStream cr ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   222
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   223
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   224
configMethodOn: aStream indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   225
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   226
	self configMethodOn: aStream last: true indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   227
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   228
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   229
configMethodOn: aStream last: last indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   230
	| values lastIndex lastBlock |
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   231
	last
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   232
		ifTrue: [ 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   233
			"need to calculate last statement with a value"
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   234
			values := {(self getBlessing).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   235
			(self getDescription).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   236
			(self getPreLoadDoIt).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   237
			(self getPostLoadDoIt).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   238
			(self getAuthor).
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   239
			(self getTimestamp)}.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   240
			1 to: values size do: [ :index | 
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   241
				(values at: index) ~~ nil
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   242
					ifTrue: [ lastIndex := index ] ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   243
			lastBlock := [ :arg | arg = lastIndex ] ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   244
		ifFalse: [ lastBlock := [ :arg | false ] ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   245
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   246
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   247
		for: self getBlessing
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   248
		selector: 'blessing:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   249
		last: (lastBlock value: 1)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   250
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   251
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   252
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   253
		for: self getDescription
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   254
		selector: 'description:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   255
		last: (lastBlock value: 2)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   256
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   257
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   258
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   259
		for: self getPreLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   260
		selector: 'preLoadDoIt:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   261
		last: (lastBlock value: 3)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   262
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   263
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   264
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   265
		for: self getPostLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   266
		selector: 'postLoadDoIt:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   267
		last: (lastBlock value: 4)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   268
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   269
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   270
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   271
		for: self getAuthor
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   272
		selector: 'author:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   273
		last: (lastBlock value: 5)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   274
		indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   275
	self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   276
		configMethodValueOn: aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   277
		for: self getTimestamp
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   278
		selector: 'timestamp:'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   279
		last: (lastBlock value: 6)
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   280
		indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   281
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   282
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   283
configMethodValueOn: aStream for: spec selector: selector last: last indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   284
	| valuePrintString |
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   285
	spec == nil
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   286
		ifTrue: [ ^ self ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   287
	valuePrintString := spec value isSymbol
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   288
		ifTrue: [ '#' , spec value asString printString ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   289
		ifFalse: [ spec value printString ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   290
	aStream
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   291
		tab: indent;
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   292
		nextPutAll: 'spec ' , selector , ' ' , valuePrintString , '.'.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   293
	last
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   294
		ifFalse: [ aStream cr ]
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   295
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   296
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   297
configSpawnMethodOn: aStream indent: indent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   298
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   299
	self configMethodValueOn: aStream for: self getBlessing selector: 'blessing:' last: false indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   300
	self configMethodValueOn: aStream for: self getAuthor selector: 'author:' last: false indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   301
	self configMethodValueOn: aStream for: self getTimestamp selector: 'timestamp:' last: false indent: indent.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   302
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   303
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   304
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   305
label
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   306
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   307
	^self versionString, ' [', self projectLabel, ']'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   308
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   309
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   310
!MetacelloVersionSpec methodsFor:'private'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   311
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   312
createVersion
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   313
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   314
	^self versionClass fromSpec: self
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   315
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   316
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   317
versionClass
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   318
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   319
	^MetacelloVersion
16
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   320
!
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   321
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   322
versionNumber
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   323
    ^ self project versionNumberClass fromString: self versionString
1
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:'querying'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   327
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   328
postLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   329
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   330
	^postLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   331
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   332
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   333
preLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   334
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   335
	^preLoadDoIt
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   336
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   337
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   338
versionString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   339
	versionString == nil ifTrue: [ ^'' ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   340
	^ versionString
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   341
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   342
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   343
!MetacelloVersionSpec methodsFor:'testing'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   344
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   345
isPartiallyCurrent: notLoadedMatters useEquality: useEquality
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   346
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   347
	self subclassResponsibility
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   348
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   349
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   350
isPossibleBaseline
16
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
   351
    self subclassResponsibility
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   352
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   353
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   354
!MetacelloVersionSpec class methodsFor:'documentation'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   355
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   356
version_SVN
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   357
    ^ '$Id::                                                                                                                        $'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
   358
! !