[squeak-dev] The Trunk: System-laza.266.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Feb 25 22:01:10 UTC 2010


Alexander Lazarević uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-laza.266.mcz

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

Name: System-laza.266
Author: laza
Time: 25 February 2010, 11:00:30.863 pm
UUID: aadb051d-e903-694c-8b57-4df33f99423f
Ancestors: System-bf.265

Changed SystemDictionary>>condenseSources to wirte the source file to the default directory

=============== Diff against System-bf.265 ===============

Item was changed:
  ----- Method: SystemDictionary>>condenseSources (in category 'housekeeping') -----
+ condenseSources
- condenseSources	
  	"Move all the changes onto a compacted sources file."
  	"Smalltalk condenseSources"
  
+ 	| newSourcesFile defaultDirectory newVersion currentVersion |
- 	| f dir newVersionString |
  	Utilities fixUpProblemsWithAllCategory.
  	"The above removes any concrete, spurious '-- all --' categories, which mess up the process."
+ 	defaultDirectory := FileDirectory default.
+ 	currentVersion := SmalltalkImage current sourceFileVersionString.
+ 	newVersion := UIManager default 
+ 		request: 'Please designate the version\for the new source code file...' withCRs
+ 		initialAnswer: currentVersion.
+ 	newVersion ifEmpty: [ ^ self ].
+ 	newVersion = currentVersion ifTrue: [ ^ self error: 'The new source file must not be the same as the old.' ].
+ 	SmalltalkImage current sourceFileVersionString: newVersion.
- 	dir := FileDirectory default.
- 	newVersionString := UIManager default request: 'Please designate the version
- for the new source code file...' initialAnswer: SmalltalkImage current sourceFileVersionString.
- 	newVersionString ifNil: [^ self].
- 	newVersionString = SmalltalkImage current sourceFileVersionString ifTrue:
- 		[^ self error: 'The new source file must not be the same as the old.'].
- 	SmalltalkImage current sourceFileVersionString: newVersionString.
  
  	"Write all sources with fileIndex 1"
+ 	newSourcesFile := defaultDirectory newFileNamed: (defaultDirectory localNameFor: SmalltalkImage current sourcesName).
+ 	newSourcesFile ifNil: [ ^ self error: 'Couldn''t create source code file in\' withCRs,  defaultDirectory name].
+ 	newSourcesFile
+ 		header;
+ 		timeStamp.
+ 	'Condensing Sources File...' 
+ 		displayProgressAt: Sensor cursorPoint
+ 		from: 0
+ 		to: self classNames size + self traitNames size
+ 		during: 
+ 			[ :bar | 
+ 			| count |
+ 			count := 0.
+ 			Smalltalk allClassesAndTraitsDo: 
+ 				[ :classOrTrait | 
+ 				bar value: (count := count + 1).
+ 				classOrTrait 
+ 					fileOutOn: newSourcesFile
+ 					moveSource: true
+ 					toFile: 1 ] ].
+ 	newSourcesFile
+ 		trailer;
+ 		close.
+ 		
- 	f := FileStream newFileNamed: SmalltalkImage current sourcesName.
- 	f header; timeStamp.
- 'Condensing Sources File...'
- 	displayProgressAt: Sensor cursorPoint
- 	from: 0 to: self classNames size + self traitNames size
- 	during:
- 		[:bar | | count | count := 0.
- 		Smalltalk allClassesAndTraitsDo:
- 			[:classOrTrait | bar value: (count := count + 1).
- 			classOrTrait fileOutOn: f moveSource: true toFile: 1]].
- 	f trailer; close.
- 
  	"Make a new empty changes file"
  	SmalltalkImage current closeSourceFiles.
+ 	defaultDirectory 
+ 		rename: SmalltalkImage current changesName
- 	dir rename: SmalltalkImage current changesName
  		toBe: SmalltalkImage current changesName , '.old'.
  	(FileStream newFileNamed: SmalltalkImage current changesName)
+ 		header;
+ 		timeStamp;
+ 		close.
- 		header; timeStamp; close.
  	SmalltalkImage current lastQuitLogPosition: 0.
- 
  	self setMacFileInfoOn: SmalltalkImage current changesName.
+ 	self setMacFileInfoOn: newSourcesFile name.
- 	self setMacFileInfoOn: SmalltalkImage current sourcesName.
  	SmalltalkImage current openSourceFiles.
+ 	self inform: 'Source files have been rewritten to\' withCRs, newSourcesFile name, '\Check that all is well,\and then save/quit.' withCRs!
- 	self inform: 'Source files have been rewritten!!
- Check that all is well,
- and then save/quit.'!




More information about the Squeak-dev mailing list