Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!metro!ipso!runxtsa!timm From: timm@runx.oz.au (Tim Menzies) Newsgroups: comp.lang.smalltalk Subject: Re: compressChanges (Smalltalk/V) Message-ID: <1991Feb9.154348.7753@runx.oz.au> Date: 9 Feb 91 15:43:48 GMT References: <1991Feb5.202908.3106@eng.umd.edu> Organization: RUNX Un*x Timeshare. Sydney, Australia. Lines: 76 In article <1991Feb5.202908.3106@eng.umd.edu> tpermutt@eng.umd.edu (Thomas Permutt) writes: >Why does compressChanges remove class definitions from the change log? >More importantly, how do people work around this? The following code generates a file "deltas.hdr" with all the class definitions of classes with changed methods. If this file is loaded before a compressed change.log, then the system status can be fully recreated from an off-the-shelf copy of Smalltalk. usage: select 'save code' from the Screen dispatcher/exit smalltalk menu. -- _--_|\ Tim Menzies (timm@runxtsa.oz) "Of course employers like grads. / \ HiSoft Expert Systems Group, A degree proves that you can \_.--._/ 2-6 Orion Rd, Lane Cove, NSW, 2066 do what you're told year after v 61 2 9297729(voice),61 2 4280200(fax) year after year after ..." --- cut here --- ! SystemDictionary methods ! storeHeaders "write the class definition of all classes with changed methods to a disc file. !!!! tjm 6-2-91" |headerFile| Scheduler clearScreen. 'Writing headers of changed classes to disc ..' displayAt: 8 @ 9 * SysFont charSize. headerFile := Directory current newFile: 'deltas.hdr'. self getSourceClasses do: [ :class | (self changedClass: class) ifTrue: [class fileOutOn: headerFile. headerFile nextPutAll: ' !!'; cr.]]. headerFile close. Scheduler displayAll. ! changedClass: aClass "Return true if aClass contains changed methods. !!!! tjm 6-2-91" aClass selectors asSortedCollection do: [ :s | (aClass compiledMethodAt: s) sourceIndex = 2 ifTrue: [^true]]. aClass class selectors asSortedCollection do: [ :s | (aClass class compiledMethodAt: s) sourceIndex = 2 ifTrue: [^true]]. ^false ! ! ! ScreenDispatcher methods ! exit "Pop-up the exit menu." (Menu labels: 'forget image continue save image save code' lines: #( 1 2) selectors: #(forgetImage continue saveExit saveWorkThenExit)) popUpAt: Cursor offset for: self ! saveWorkThenExit self saveWork; forgetImage. ! saveWork CursorManager execute change. Smalltalk storeHeaders; compressChanges. CursorManager normal change. ! !