[squeak-dev] The Inbox: MonticelloConfigurations-dtl.162.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 15 23:57:06 UTC 2020


A new version of MonticelloConfigurations was added to project The Inbox:
http://source.squeak.org/inbox/MonticelloConfigurations-dtl.162.mcz

==================== Summary ====================

Name: MonticelloConfigurations-dtl.162
Author: dtl
Time: 13 April 2020, 8:54:26.587016 pm
UUID: bef0e458-d6fc-4c36-ba94-db31bbd0c804
Ancestors: MonticelloConfigurations-dtl.161

Update MCConfigurationBrowser to use extended MCConfiguration with version history. Add a button to view version history. The browser new behaves reasonably with both old and new format MCConfiguration.

=============== Diff against MonticelloConfigurations-dtl.161 ===============

Item was changed:
  ----- Method: MCConfiguration>>browse (in category 'actions') -----
  browse
  	| browser |
+ 	browser := MCConfigurationBrowser new configuration: self copyForEdit.
- 	browser := MCConfigurationBrowser new configuration: self.
  	name ifNotNil: [:nm | browser label: browser defaultLabel , ' ' , nm].
  	browser show!

Item was changed:
  ----- Method: MCConfiguration>>copyForEdit (in category 'copying') -----
  copyForEdit
  	"Preparing to edit a configuration. Answer a new copy with the original
  	instance saved in version history, and with no author initials or timestamp.
  	The initials and timestamp are to be set immediately prior to saving an edited
  	version."
  	| config |
  	config := MCConfigurationExtended new.
+ 	config name: name copy.
+ 	config dependencies: dependencies copy.
+ 	config repositories: repositories copy.
- 	config name: name.
- 	config dependencies: dependencies.
- 	config repositories: repositories.
  	config priorVersions addFirst: self.
  	^ config!

Item was changed:
  ----- Method: MCConfigurationBrowser>>buttonSpecs (in category 'morphic ui') -----
  buttonSpecs
  	^ #(('Add' addDependency 'Add a dependency')
  		('Update' updateMenu 'Update dependencies')
  		('Install' installMenu 'Load/Merge/Upgrade into image')
  		('Up' up 'Move item up in list' canMoveUp)
  		('Down' down 'Move item down in list' canMoveDown)
  		('Remove' remove 'Remove item' canRemove)
  		('Save' store 'Store the configuration to a repository')
+ 		('Versions' versions 'Show prior versions of this configuration')
  		)!

Item was changed:
  ----- Method: MCConfigurationBrowser>>defaultExtent (in category 'morphic ui') -----
  defaultExtent
+ 	^ 450 at 500!
- 	^ 360 at 500!

Item was added:
+ ----- Method: MCConfigurationBrowser>>enterVersionComment (in category 'morphic ui') -----
+ enterVersionComment
+ 	^ UIManager default
+ 		request: 'Comment for this configuration update'
+ 		initialAnswer: (self configuration comment ifNil: ['']).
+ !

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 configuration name: name.
  		self pickRepository ifNotNil: [:repo |
+ 			configuration comment: self enterVersionComment.
+ 			configuration authorInitials: Utilities authorInitials.
+ 			configuration timeStamp: ((DateAndTime fromSeconds: (DateAndTime now asSeconds)) printString).
  			repo storeVersion: self configuration]].!

Item was added:
+ ----- Method: MCConfigurationBrowser>>versions (in category 'actions') -----
+ versions
+ 	configuration priorVersions explore!

Item was changed:
  ----- Method: MCConfigurationExtended>>copyForEdit (in category 'copying') -----
  copyForEdit
  	"Preparing to edit a configuration. Answer a new copy with the original
  	instance saved in version history, and with no author initials or timestamp.
  	The initials and timestamp are to be set immediately prior to saving an edited
  	version."
  	| config |
+ 	config := super copyForEdit.
+ 	config priorVersions: priorVersions copy.
- 	config := self copy.
  	config priorVersions addFirst: self.
  	config authorInitials: nil.
  	config timeStamp: nil.
+ 	config comment: self comment copy.
  	^ config!

Item was changed:
  ----- Method: MCConfigurationExtended>>copyWithoutHistory (in category 'copying') -----
  copyWithoutHistory
  	"When a configuration is part of a version history, do not repeatedly
  	export its history."
  
  	| config |
  	config := self copy.
+ 	config priorVersions: OrderedCollection new.
- 	config priorVersions removeAll.
  	^ config!

Item was added:
+ ----- Method: MCConfigurationExtended>>printOn: (in category 'printing') -----
+ printOn: aStream
+ 	super printOn: aStream.
+ 	aStream nextPutAll: ' named ', name asString, ' (', timeStamp asString, ')'.!

Item was added:
+ ----- Method: MCConfigurationExtended>>priorVersions: (in category 'accessing') -----
+ priorVersions: collection
+ 	priorVersions := collection
+ !



More information about the Squeak-dev mailing list