[Pkg] The Trunk: MonticelloConfigurations-ul.84.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Mar 14 16:26:16 UTC 2011
Levente Uzonyi uploaded a new version of MonticelloConfigurations to project The Trunk:
http://source.squeak.org/trunk/MonticelloConfigurations-ul.84.mcz
==================== Summary ====================
Name: MonticelloConfigurations-ul.84
Author: ul
Time: 14 March 2011, 5:26:11.705 pm
UUID: 4cb988fd-3192-f549-b64f-7c646692bd2b
Ancestors: MonticelloConfigurations-cbc.83
Automatically increment the version number and take the author initials from the image when saving a new configuration.
=============== Diff against MonticelloConfigurations-cbc.83 ===============
Item was added:
+ ----- Method: MCConfiguration>>suggestedNameOfNextVersion (in category 'private') -----
+ suggestedNameOfNextVersion
+ "Suggest a name for the next version of this configuration. The format is assumed to be name-authorInitials.version. Automatically increments the version, takes author initials from Utilities."
+
+ ^'{1}-{2}.{3}' format: {
+ name
+ ifNil: [ 'newConfiguration' ]
+ ifNotNil: [ name copyUpTo: $- ].
+ Utilities authorInitials.
+ name
+ ifNil: [ 1 ]
+ ifNotNil: [ (name copyAfterLast: $.) asInteger + 1 ] }
+
+ !
Item was changed:
----- Method: MCConfigurationBrowser>>pickName (in category 'morphic ui') -----
pickName
| name |
name := UIManager default
request: 'Name (.', self configuration writerClass extension, ' will be appended):'
+ initialAnswer: self configuration suggestedNameOfNextVersion.
- initialAnswer: (self configuration name ifNil: ['']).
^ name isEmpty ifFalse: [name]!
Item was changed:
----- Method: MCConfigurationBrowser>>post (in category 'actions') -----
post
"Take the current configuration and post an update"
| name update managers names choice |
(self checkRepositories and: [self checkDependencies]) ifFalse: [^self].
name := UIManager default
request: 'Update name (.cs) will be appended):'
+ initialAnswer: self configuration suggestedNameOfNextVersion.
- initialAnswer: (self configuration name ifNil: ['']).
name isEmpty ifTrue:[^self].
self configuration name: name.
update := MCPseudoFileStream on: (String new: 100).
update localName: name, '.cs'.
update nextPutAll: '"Change Set: ', name.
update cr; nextPutAll: 'Date: ', Date today printString.
update cr; nextPutAll: 'Author: Posted by Monticello'.
update cr; cr; nextPutAll: 'This is a configuration map created by Monticello."'.
update cr; cr; nextPutAll: '(MCConfiguration fromArray: #'.
self configuration fileOutOn: update.
update nextPutAll: ') upgrade.'.
update position: 0.
managers := Smalltalk at: #UpdateManager ifPresent:[:mgr| mgr allRegisteredManagers].
managers ifNil:[managers := #()].
managers size > 0 ifTrue:[
| servers index |
servers := ServerDirectory groupNames asSortedArray.
names := (managers collect:[:each| each packageVersion]), servers.
index := UIManager default chooseFrom: names lines: {managers size}.
index = 0 ifTrue:[^self].
index <= managers size ifTrue:[
| mgr |
mgr := managers at: index.
^mgr publishUpdate: update.
].
choice := names at: index.
] ifFalse:[
names := ServerDirectory groupNames asSortedArray.
choice := UIManager default chooseFrom: names values: names.
choice == nil ifTrue: [^ self].
].
(ServerDirectory serverInGroupNamed: choice) putUpdate: update.!
More information about the Packages
mailing list