'From etoys3.0 of 24 February 2008 [latest update: #2147] on 16 September 2008 at 10:33:12 pm'! "Change Set: condenseSources-yo Date: 16 September 2008 Author: Yoshiki Ohshima Make condense sources work after EtoysV3. Take out the line that specifies the MacRoman converter, and also edit a method that has stamp: near the end."! !ClassDescription methodsFor: 'fileIn/Out' stamp: 'yo 9/16/2008 22:24'! putClassCommentToCondensedChangesFile: aFileStream "Called when condensing changes. If the receiver has a class comment, and if that class comment does not reside in the .sources file, then write it to the given filestream, with the resulting RemoteString being reachable from the source file #2. Note that any existing backpointer into the .sources file is lost by this process -- a situation that maybe should be fixed someday." | header aStamp aCommentRemoteStr | self isMeta ifTrue: [^ self]. "bulletproofing only" ((aCommentRemoteStr _ self organization commentRemoteStr) isNil or: [aCommentRemoteStr sourceFileNumber == 1]) ifTrue: [^ self]. aFileStream cr; nextPut: $!!. header _ String streamContents: [:strm | strm nextPutAll: self name; nextPutAll: ' commentStamp: '. (aStamp _ self organization commentStamp ifNil: ['']) storeOn: strm. strm nextPutAll: ' prior: 0']. aFileStream nextChunkPut: header. aFileStream cr. self organization classComment: (RemoteString newString: self organization classComment onFileNumber: 2 toFile: aFileStream) stamp: aStamp "-------------------------------------------------------------------------------------------------------------------------------------- Here is a comment to protect the next method in the .sources file doesn't get confused with the ending stamp: keyword. ---------------------------------------------------------------------------------------------------------------------------------------"! ! !ClassDescription methodsFor: 'fileIn/Out' stamp: 'yo 9/16/2008 22:31'! reformatAll "Reformat all methods in this class. Leaves old code accessible to version browsing" self selectorsDo: [:sel | self reformatMethodAt: sel]! ! !SystemDictionary methodsFor: 'housekeeping' stamp: 'yo 9/16/2008 14:07'! condenseSourcesForVersion: aString "Move all the changes onto a compacted sources file." "Smalltalk condenseSources" | f classCount dir newVersionString | Utilities fixUpProblemsWithAllCategory. "The above removes any concrete, spurious '-- all --' categories, which mess up the process." dir _ FileDirectory default. newVersionString _ aString. 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" f _ FileStream newFileNamed: SmalltalkImage current sourcesName. f converter: UTF8TextConverter new. "This is needed only when converting from SqueakV3.sources." f header; timeStamp. 'Condensing Sources File...' displayProgressAt: Sensor cursorPoint from: 0 to: Smalltalk classNames size during: [:bar | classCount _ 0. Smalltalk allClassesDo: [:class | bar value: (classCount _ classCount + 1). class fileOutOn: f moveSource: true toFile: 1]]. f trailer; close. "Make a new empty changes file" SmalltalkImage current closeSourceFiles. dir rename: SmalltalkImage current changesName toBe: SmalltalkImage current changesName , '.old'. (FileStream newFileNamed: SmalltalkImage current changesName) header; timeStamp; close. SmalltalkImage current lastQuitLogPosition: 0. self setMacFileInfoOn: SmalltalkImage current changesName. self setMacFileInfoOn: SmalltalkImage current sourcesName. SmalltalkImage current openSourceFiles. self inform: 'Source files have been rewritten!! Check that all is well, and then save/quit.'! !