A new version of MonticelloConfigurations was added to project The Inbox:
http://source.squeak.org/inbox/MonticelloConfigurations-dtl.163.mcz ==================== Summary ==================== Name: MonticelloConfigurations-dtl.163 Author: dtl Time: 14 April 2020, 12:11:50.986346 am UUID: 81f8b3a4-f7a7-47dc-ae6d-d06e7a9b2854 Ancestors: MonticelloConfigurations-dtl.162 Add a UUID identifier field to MCConfigurationExtended =============== Diff against MonticelloConfigurations-dtl.162 =============== Item was changed: ----- Method: MCConfiguration class>>copyWithoutKeyPrefix: (in category 'private') ----- copyWithoutKeyPrefix: configArray "Tokens in the version history portion of configArray are prefixed with $X to prevent them being parsed in the original implementation of MCConfiguration. Here we remove the prefixes prior to processing in the current implementation with MCConfigurationExtended support." | strm | strm := #() writeStream. configArray do: [ :token | token caseOf: { [#Xname ] -> [ strm nextPut: #name] . [#Xrepository ] -> [ strm nextPut: #repository] . [#Xdependency ] -> [ strm nextPut: #dependency] . [#XmcmVersion] -> [ strm nextPut: #mcmVersion] . + [#Xid] -> [ strm nextPut: #id] . [#XauthorInitials ] -> [ strm nextPut: #authorInitials] . [#XtimeStamp ] -> [ strm nextPut: #timeStamp] . [#Xcomment ] -> [ strm nextPut: #comment] } otherwise: [ strm nextPut: token] ]. ^ strm contents. ! Item was changed: ----- Method: MCConfigurationBrowser>>store (in category 'actions') ----- store (self checkRepositories and: [self checkDependencies]) ifFalse: [^self]. self pickName ifNotNil: [:name | configuration name: name. self pickRepository ifNotNil: [:repo | configuration comment: self enterVersionComment. configuration authorInitials: Utilities authorInitials. configuration timeStamp: ((DateAndTime fromSeconds: (DateAndTime now asSeconds)) printString). + configuration id: UUID new asString. repo storeVersion: self configuration]].! Item was changed: MCConfiguration subclass: #MCConfigurationExtended + instanceVariableNames: 'mcmVersion id authorInitials timeStamp comment priorVersions' - instanceVariableNames: 'mcmVersion authorInitials timeStamp comment priorVersions' classVariableNames: '' poolDictionaries: '' category: 'MonticelloConfigurations'! !MCConfigurationExtended commentStamp: 'dtl 4/13/2020 13:57' prior: 0! A MCConfigurationExtended is a configuration with author initials, timestamp, comment, and a list of prior versions. Its external storage format is organized for compatibility with MCConfiguration, such that an image wtih support for only MCConfiguration can use configurations saved from a MCConfigurationExtended. The intended use is to enable documentation of configuration maps, and to allow modifications to a configuration map without loss of version history.! Item was changed: ----- Method: MCConfigurationExtended>>= (in category 'comparing') ----- = configuration + ^ (((super = configuration - ^ ((super = configuration and: [configuration authorInitials = authorInitials]) and: [configuration timeStamp = timeStamp]) + and: [configuration id = id]) + and: [configuration comment = comment]. - and: [configuration comment = comment]. ! Item was changed: ----- Method: MCConfigurationExtended>>contentsOn:keyPrefix: (in category 'printing') ----- contentsOn: aStream keyPrefix: prefix super contentsOn: aStream keyPrefix: prefix. mcmVersion ifNotNil: [:ver | aStream cr. aStream nextPutAll: prefix,'mcmVersion '. aStream print: ver]. + id ifNotNil: [:uuid | + aStream cr. + aStream nextPutAll: prefix,'id '. + aStream print: uuid]. + authorInitials ifNotNil: [:initials | aStream cr. aStream nextPutAll: prefix,'authorInitials '. aStream print: initials]. timeStamp ifNotNil: [:ts | aStream cr. aStream nextPutAll: prefix,'timeStamp '. aStream print: ts]. comment ifNotNil: [:c | aStream cr. aStream nextPutAll: prefix,'comment '. aStream print: c]. "Keys in the prior versions have a prefix to prevent them being parsed into a MCConfiguration when an image that does not contain support for the newer MCConfigurationExtended format. This allows older images to read an MCM file with extended format and version history, treating it as if it were data for the original MCConfiguration." priorVersions do: [:e | e copyWithoutHistory contentsOn: aStream keyPrefix: 'X']. ! Item was changed: ----- Method: MCConfigurationExtended>>hash (in category 'comparing') ----- hash + ^ (super hash bitOr: timeStamp hash) bitXor: id. - ^ super hash bitOr: timeStamp hash ! Item was added: + ----- Method: MCConfigurationExtended>>id (in category 'accessing') ----- + id + ^ id! Item was added: + ----- Method: MCConfigurationExtended>>id: (in category 'accessing') ----- + id: uuid + id := uuid! Item was changed: ----- Method: MCConfigurationExtended>>initializeFromKey:value: (in category 'initialize') ----- initializeFromKey: key value: value super initializeFromKey: key value: value. key = #mcmVersion ifTrue: [mcmVersion := value]. + key = #id + ifTrue: [id := value]. key = #authorInitials ifTrue: [authorInitials := value]. key = #timeStamp ifTrue: [timeStamp := value]. key = #comment ifTrue: [comment := value]. ! Item was changed: ----- Method: MCConfigurationExtended>>printOn: (in category 'printing') ----- printOn: aStream super printOn: aStream. + aStream nextPutAll: ' ', name asString, ' ', timeStamp asString, ' (', id asString, ')'.! - aStream nextPutAll: ' named ', name asString, ' (', timeStamp asString, ')'.! |
Free forum by Nabble | Edit this page |