lists.squeakfoundation.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Packages
September 2009
----- 2024 -----
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
packages@lists.squeakfoundation.org
1 participants
34 discussions
Start a n
N
ew thread
DeltaStreams: DeltaStreams-Tests-gk.12.mcz
by squeak-dev-noreply@lists.squeakfoundation.org
04 Sep '09
04 Sep '09
A new version of DeltaStreams-Tests was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Tests-gk.12.mcz
==================== Summary ==================== Name: DeltaStreams-Tests-gk.12 Author: gk Time: 4 September 2009, 9:18:45 am UUID: ddd54af7-bd56-47b8-8cfb-26918a4a12c9 Ancestors: DeltaStreams-Tests-matthew_fulmer.11 Changes and fixes. =============== Diff against DeltaStreams-Tests-matthew_fulmer.11 =============== Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodSource (in category 'clean method tests') ----- testChangeClassMethodSource "Change the source of a class method" | change | change := DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeClassMethodSourceBadHistory "Change the source of an instance method, where the change history is wrong. Should succeed" | change | change := DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodSourceBadHistory "Change the source of a class method, where the change history is wrong. Should succeed" self applyChange: (DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self newStamp.! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantInstanceMethodSource (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodSource "Change source of unknown instance method. Should succeed" self applyChange: (DSMethodSourceChange new + className: class name; - setClass: class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself). self assert: (class selectors includes: self badSelector). self assert: (class organization categoryOfElement: self badSelector) = Categorizer default. self assert: (class sourceCodeAt: self badSelector) = self badSource. self assert: (class compiledMethodAt: self badSelector) timeStamp = self badStamp.! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodSourceBadHistory "Change the source of a class method, where the change history is wrong. Should succeed" | change | change := DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveNonExistantInstanceMethod (in category 'dirty method tests') ----- testRemoveNonExistantInstanceMethod "Remove a instance-side method, where the method does not exist. Invalid; should do nothing" self assert: (class selectors includes: self selectorA). self deny: (class selectors includes: self selectorB). self applyChange: (DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self assert: (class selectors includes: self selectorA). self deny: (class selectors includes: self selectorB). ! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantInstanceMethodSource (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodSource "Change source of unknown instance method. Should succeed" | change | change := DSMethodSourceChange new + className: class name; - setClass: class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testAddClassMethod (in category 'clean method tests') ----- testAddClassMethod "Create a new class side method" self deny: (class class selectors includes: self selectorB). self applyChange: (DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself). self assert: (class class selectors includes: self selectorB). self assert: (class class organization categoryOfElement: self selectorB) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorB) = self methodBSource. self assert: (class class compiledMethodAt: self selectorB) timeStamp = self oldStamp! Item was added: + ----- Method: DSDeltaTiradeFileOutTest>>createReaderWriter (in category 'as yet unclassified') ----- + createReaderWriter + | stream | + stream := RWBinaryOrTextStream on: String new. + reader := DSTiradeReader on: stream. + writer := DSTiradeWriter on: stream.! Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveNonExistantInstanceMethod (in category 'dirty method tests') ----- testRemoveNonExistantInstanceMethod "Remove a instance-side method, where the method does not exist. Invalid; should do nothing" | change | change := DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveInstanceMethod (in category 'clean method tests') ----- testRemoveInstanceMethod "Remove an instance side method" | change | change := DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaRevertTest>>testNoChange (in category 'as yet unclassified') ----- testNoChange "Make sure the system is exactly the way it was at the beginning of the test" "System Tests" self assert: (Smalltalk includesKey: self oldClassAName). self deny: (Smalltalk includesKey: self newClassAName). self deny: (Smalltalk includesKey: self classBName). "Class Tests" class := (Smalltalk classNamed: self oldClassAName). self assert: class isBehavior. self deny: class isMeta. self assert: class class isMeta. self assert: class isFixed. self assert: class name == self oldClassAName. self assert: class superclass == self oldSuperclass. self assert: class category == self oldClassCategory. self assert: class instanceVariablesString = self oldInstVarString. self assert: class class instanceVariablesString = self oldInstVarString. self assert: class classVariablesString = self oldClassVarString. self assert: class sharedPoolsString = self oldSharedPoolString. self assert: class methodDictionary size = 1. self assert: class class methodDictionary size = 1. "Organization Tests" self assert: class organization categories size = 1. self assert: class organization categories first = self oldProtocol. self assert: class class organization categories size = 1. self assert: class class organization categories first = self oldProtocol. self assert: class hasComment. + self assert: class organization classComment asString = self oldComment. - self assert: class organization classComment = self oldComment. self assert: class organization commentStamp = self oldStamp. "Instance method test" self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp. "Class method test" self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.! Item was changed: ----- Method: DSDeltaTiradeFileOutTest>>transformChange: (in category 'as yet unclassified') ----- transformChange: aChange + "Out and back in through Tirade." + + | delta | + self createReaderWriter. + delta := DSDelta new add: aChange; yourself. + writer nextPut: delta. - writer nextPut: aChange. reader reset. + ^reader next changes first! - ^reader next! Item was changed: ----- Method: DSDeltaValidationTest>>testAddInstanceMethod (in category 'clean method tests') ----- testAddInstanceMethod "Create a new instance side method" | change | change := DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaValidationTest>>testAddClassMethod (in category 'clean method tests') ----- testAddClassMethod "Create a new class side method" | change | change := DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testAddPreExistingInstanceMethod (in category 'dirty method tests') ----- testAddPreExistingInstanceMethod "Add a instance-side method that already exists. Invalid, but should succeed in changing it" self assert: (class class selectors includes: self selectorA). self applyChange: (DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self newStamp! Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveClassMethod (in category 'clean method tests') ----- testRemoveClassMethod "Remove a class side method" | change | change := DSMethodRemovedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testAddPreExistingClassMethod (in category 'dirty method tests') ----- testAddPreExistingClassMethod "Add a class-side method that already exists. Invalid, but should succeed in changing it" self assert: (class class selectors includes: self selectorA). self applyChange: (DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self newStamp! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantInstanceMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodProtocol "Classify a non-existant method. Should create a null method" self applyChange: (DSMethodProtocolChange new + className: class name; - setClass: class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class selectors includes: self badSelector). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp.! Item was changed: ----- Method: DSDeltaValidationTest>>testAddPreExistingInstanceMethod (in category 'dirty method tests') ----- testAddPreExistingInstanceMethod "Add a instance-side method that already exists Invalid, but should succeed in changing it" | change | change := DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantClassMethodSource (in category 'dirty method tests') ----- testChangeNonExistantClassMethodSource "Change source of unknown class method. Should succeed" self applyChange: (DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself). self assert: (class class selectors includes: self badSelector). self assert: (class class organization categoryOfElement: self badSelector) = Categorizer default. self assert: (class class sourceCodeAt: self badSelector) = self badSource. self assert: (class class compiledMethodAt: self badSelector) timeStamp = self badStamp.! Item was changed: ----- Method: DSDeltaValidationTest>>testAddPreExistingClassMethod (in category 'dirty method tests') ----- testAddPreExistingClassMethod "Add a class-side method that already exists. Invalid, but should succeed in changing it" | change | change := DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantInstanceMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodProtocol "Classify a non-existant method. Should create a null method" | change | change := DSMethodProtocolChange new + className: class name; - setClass: class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testBadClassChangeClassCategory (in category 'dirty class tests') ----- testBadClassChangeClassCategory "Change the category of a non-existant class. Not sure if the class should be created or not. The test assumes the test should be created" self deny: (Smalltalk includesKey: self badClassName). self applyChange: (DSClassCategoryChange className: self badClassName + category: self newClassCategory + oldCategory: self oldClassCategory - from: self oldClassCategory - to: self newClassCategory ). self assert: (Smalltalk includesKey: self badClassName). class := Smalltalk classNamed: self badClassName. self assert: class isBehavior. self deny: class isMeta. self assert: class class isMeta. self assert: class isFixed. self assert: class name == self badClassName. self assert: class superclass == Object. self assert: class category == self newClassCategory. self assert: class instanceVariablesString isEmpty. self assert: class class instanceVariablesString isEmpty. self assert: class classVariablesString isEmpty. self assert: class sharedPoolsString isEmpty. self deny: class hasComment.! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeClassMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" self applyChange: (DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.! Item was changed: ----- Method: DSDelta>>renameClassFrom:to: (in category '*deltastreams-tests') ----- renameClassFrom: oldName to: newName "A class is being renamed." + self add: (DSClassNameChange className: oldName to: newName)! - self addChange: (DSClassNameChange className: oldName to: newName)! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantClassMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantClassMethodProtocol "Classify a non-existant method. Should create a null method" self applyChange: (DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class class selectors includes: self badSelector). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodSource (in category 'clean method tests') ----- testChangeInstanceMethodSource "Change the source of a class method" self applyChange: (DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self newStamp.! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeClassMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" | change | change := DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantClassMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantClassMethodProtocol "Classify a non-existant method. Should create a null method" | change | change := DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodSource (in category 'clean method tests') ----- testChangeInstanceMethodSource "Change the source of a class method" | change | change := DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodProtocol (in category 'clean method tests') ----- testChangeInstanceMethodProtocol "Classify an instance method under a new protocol. should succeed" self applyChange: (DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp.! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodProtocol (in category 'clean method tests') ----- testChangeClassMethodProtocol "Classify a class method under a new protocol. should succeed" self applyChange: (DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.! Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveNonExistantClassMethod (in category 'dirty method tests') ----- testRemoveNonExistantClassMethod "Remove a class-side method, where the method does not exist. Invalid; should do nothing" self assert: (class class selectors includes: self selectorA). self deny: (class class selectors includes: self selectorB). self applyChange: (DSMethodRemovedChange new + className: class class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self assert: (class class selectors includes: self selectorA). self deny: (class class selectors includes: self selectorB). ! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodProtocol (in category 'clean method tests') ----- testChangeInstanceMethodProtocol "Classify an instance method under a new protocol. should succeed" | change | change := DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodProtocol (in category 'clean method tests') ----- testChangeClassMethodProtocol "Classify a class method under a new protocol. should succeed" | change | change := DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaTiradeFileOutTest>>setUp (in category 'as yet unclassified') ----- setUp + | | - | stream | super setUp. + self createReaderWriter ! - stream := RWBinaryOrTextStream on: String new. - reader := DSTiradeReader on: stream. - writer := DSTiradeWriter on: stream.! Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveNonExistantClassMethod (in category 'dirty method tests') ----- testRemoveNonExistantClassMethod "Remove a class-side method, where the method does not exist. Invalid; should do nothing" | change | change := DSMethodRemovedChange new + className: class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: + DSTestCase subclass: #DSDeltaTiradeTest - DSDeltaCreationTest subclass: #DSDeltaTiradeTest instanceVariableNames: 'writer reader' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Tests'! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantClassMethodSource (in category 'dirty method tests') ----- testChangeNonExistantClassMethodSource "Change source of unknown class method. Should succeed" | change | change := DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveInstanceMethod (in category 'clean method tests') ----- testRemoveInstanceMethod "Remove an instance side method" self assert: (class selectors includes: self selectorA). self applyChange: (DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self deny: (class selectors includes: self selectorA).! Item was changed: ----- Method: DSDeltaApplyTest>>testAddInstanceMethod (in category 'clean method tests') ----- testAddInstanceMethod "Create a new instance side method" self deny: (class selectors includes: self selectorB). self applyChange: (DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself). self assert: (class selectors includes: self selectorB). self assert: (class organization categoryOfElement: self selectorB) = self oldProtocol. self assert: (class sourceCodeAt: self selectorB) = self methodBSource. self assert: (class compiledMethodAt: self selectorB) timeStamp = self oldStamp! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" self applyChange: (DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp.! Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveClassMethod (in category 'clean method tests') ----- testRemoveClassMethod "Remove a class side method" self assert: (class class selectors includes: self selectorA). self applyChange: (DSMethodRemovedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self deny: (class class selectors includes: self selectorA).! Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" | change | change := DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodSource (in category 'clean method tests') ----- testChangeClassMethodSource "Change the source of a class method" self applyChange: (DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self newStamp.! Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeClassMethodSourceBadHistory "Change the source of an instance method, where the change history is wrong. Should succeed" self applyChange: (DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self newStamp.! Item was removed: - ----- Method: DSClassNameChange class>>changing:to: (in category '*deltastreams-tests') ----- - changing: aClass to: newName - ^ self changing: aClass from: aClass name to: newName! Item was removed: - ----- Method: DSDeltaClassifyTest>>setUp (in category 'as yet unclassified') ----- - setUp - delta := DSDelta new.! Item was removed: - DSTestCase subclass: #DSDeltaClassifyTest - instanceVariableNames: 'delta' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'! Item was removed: - ----- Method: DSDeltaChangeSetTest>>applyChange: (in category 'as yet unclassified') ----- - applyChange: aChange - | stream writer readerClassName readerClass | - stream := RWBinaryOrTextStream on: ''. - writer := DSDstWriter on: stream. - aChange entryWriters do: [:ea | ea writeOn: writer]. - readerClassName := #DSDstReader. - readerClass := Smalltalk at: readerClassName. - [Smalltalk removeKey: readerClassName. stream fileIn] - ensure: [Smalltalk at: readerClassName put: readerClass]! Item was removed: - ----- Method: DSDeltaFileOutTest>>tearDown (in category 'as yet unclassified') ----- - tearDown - reader := writer := nil. - super tearDown! Item was removed: - ----- Method: DSDeltaClassifyTest>>tearDown (in category 'as yet unclassified') ----- - tearDown - delta stopLogging. - self removeTestClasses! Item was removed: - ----- Method: DSDeltaFileOutTest>>transformChange: (in category 'as yet unclassified') ----- - transformChange: aChange - aChange entryWriters do: [:ea | ea writeOn: writer]. - reader reset. - reader build. - ^ reader builtObject! Item was removed: - ----- Method: DSDeltaClassifyTest>>testClassifierAcrossRename (in category 'as yet unclassified') ----- - testClassifierAcrossRename - | classified classChanges | - delta startLogging. - class := self createClassAWithMethods. - class rename: self newClassAName. - self createMethodBIn: class. - delta stopLogging. - - classified := DSChangeCategorizer forClassesAndMethods withAll: delta changes. - self assert: classified dictionary size = 1. - classChanges := classified at: self newClassAName. - self assert: classChanges methodChanges dictionary size = 2. - self - assert: (classChanges methodChanges dictionary includesKey: self selectorA). - self - assert: (classChanges methodChanges dictionary includesKey: self selectorB). - self assert: classChanges classMethodChanges dictionary size = 1. - self assert: (classChanges classMethodChanges dictionary - includesKey: self selectorA)! Item was removed: - ----- Method: DSDeltaClassifyTest>>testClassifierForClasses (in category 'as yet unclassified') ----- - testClassifierForClasses - | classified classChanges | - delta startLogging. - class := self createClassAWithMethods. - self createClassB. - delta stopLogging. - classified := DSChangeCategorizer forClassesAndMethods withAll: delta changes. - self assert: classified dictionary size = 2. - classChanges := classified at: self oldClassAName. - self assert: classChanges methodChanges dictionary size = 1. - self - assert: (classChanges methodChanges dictionary includesKey: self selectorA). - self assert: classChanges classMethodChanges dictionary size = 1. - self assert: (classChanges classMethodChanges dictionary - includesKey: self selectorA). - classChanges := classified at: self classBName. - self assert: classChanges methodChanges dictionary size = 0. - self assert: classChanges classMethodChanges dictionary size = 0! Item was removed: - ----- Method: DSClassNameChange class>>changing:from:to: (in category '*deltastreams-tests') ----- - changing: aClass from: oldName to: newName - ^(self fromClass: aClass) - oldName: oldName; - newName: newName; - yourself! Item was removed: - ----- Method: DSDeltaFileOutTest>>setUp (in category 'as yet unclassified') ----- - setUp - | stream | - super setUp. - stream := RWBinaryOrTextStream on: String new. - reader := DSDstReader on: stream. - writer := DSDstWriter on: stream.! Item was removed: - DSDeltaApplyTest subclass: #DSDeltaChangeSetTest - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'! - - !DSDeltaChangeSetTest commentStamp: '<historical>' prior: 0! - Tests that the change-set representation of a Delta (as an interleaved change set) does the same thing on file-in as loading a delta normally! Item was removed: - DSDeltaCreationTest subclass: #DSDeltaFileOutTest - instanceVariableNames: 'writer reader' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'! - - !DSDeltaFileOutTest commentStamp: '<historical>' prior: 0! - Each test creates a change, files it out on a stream (as an interleaved change set). files it back in, then compares that the two are identical in all persistent state! Item was removed: - ----- Method: DSDeltaTiradeTest>>transformChange: (in category 'as yet unclassified') ----- - transformChange: aChange - aChange entryWriters do: [:ea | ea writeOn: writer]. - reader reset. - reader build. - ^ reader builtObject! Item was removed: - TestCase subclass: #DSDeltaBugs - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'! - - !DSDeltaBugs commentStamp: '<historical>' prior: 0! - An informal place to keep track of bugs not yet covered by other tests! Item was removed: - ----- Method: DSDeltaBugs>>testTotallyComplete (in category 'as yet unclassified') ----- - testTotallyComplete - self signalFailure: 'test isComplete: in the validation tests'. - self signalFailure: 'need more grouping and normalize tests'. - self signalFailure: 'get rid of deprecated classes'. - - !
1
0
0
0
DeltaStreams: DeltaStreams-Model-gk.14.mcz
by squeak-dev-noreply@lists.squeakfoundation.org
04 Sep '09
04 Sep '09
A new version of DeltaStreams-Model was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Model-gk.14.mcz
==================== Summary ==================== Name: DeltaStreams-Model-gk.14 Author: gk Time: 4 September 2009, 8:56:20 am UUID: d8611b99-d070-4753-8cf3-8fe090252412 Ancestors: DeltaStreams-Model-gk.13 Lots of changes, refactorings and greener tests. Tirade hooked in. =============== Diff against DeltaStreams-Model-gk.13 =============== Item was added: + ----- Method: DSMethodProtocolChange>>protocolChange: (in category 'accessing') ----- + protocolChange: assoc + self oldProtocol: assoc key. + self protocol: assoc value! Item was changed: ----- Method: DSClassChange>>initialize (in category 'initialize-release') ----- initialize + super initialize. self superclassName: #Object. self instVarNames: Array new. self classVarNames: Array new. self poolDictionaryNames: Array new. self category: Categorizer default. self type: #normal. self comment: ''. self stamp: nil. self classInstVarNames: Array new.! Item was changed: ----- Method: DSBasicClassChange>>fromClass: (in category 'initialize-release') ----- fromClass: aClass + "Always use the name." + self className: aClass name! - self setClass: aClass! Item was changed: ----- Method: DSAnnotatedObject>>timeStamp (in category 'accessing') ----- timeStamp + "If you just want to show it, use #timeStampString." + + ^TimeStamp fromString: self timeStampString! - ^timeStamp! Item was changed: ----- Method: DSMethodSourceChange>>newMethod: (in category 'accessing') ----- newMethod: aCompiledMethod + self method: aCompiledMethod! - self newSource: (self sourceFromMethod: aCompiledMethod). - self newStamp: aCompiledMethod timeStamp.! Item was changed: ----- Method: DSMethodChange>>fromClass:selector: (in category 'initialize-release') ----- fromClass: aClass selector: aSelector + "Initiate this method change from given class and selector + by extracting all attributes from it." + + self className: aClass name; + selector: aSelector; + method: (aClass methodDictionary at: aSelector); + protocol: (aClass organization categoryOfElement: aSelector) - super fromClass: aClass selector: aSelector. - self method: (aClass methodDictionary at: aSelector). - self protocol: (aClass organization categoryOfElement: aSelector) ! Item was added: + DSMethodChange subclass: #DSMethodSelectorChange + instanceVariableNames: 'oldSelector' + classVariableNames: '' + poolDictionaries: '' + category: 'DeltaStreams-Model-Method'! Item was added: + ----- Method: DSClassCategoryChange class>>className:category:oldCategory: (in category 'instance creation') ----- + className: aClassName + category: aCategory + oldCategory: oldCategory + + ^(self className: aClassName) + category: aCategory; + oldCategory: oldCategory; + yourself + ! Item was added: + ----- Method: DSClassCategoryChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp:oldCategory: (in category 'instance creation') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + oldCategory: oldCategory + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + oldCategory: oldCategory; + yourself + ! Item was added: + ----- Method: DSMethodChange>>fullClassName (in category 'accessing') ----- + fullClassName + "Copied from MCMethodDefinition." + + ^ meta + ifFalse: [self className] + ifTrue: [ + (self actualClass isNil or: [ self actualClass isTrait ]) + ifFalse: [self className, ' class'] + ifTrue: [self className, ' classSide']]! Item was added: + ----- Method: DSMethodChange class>>tiradeClassName:selector:category:source:stamp: (in category 'as yet unclassified') ----- + tiradeClassName: aClassName selector: selector category: aCategory source: source stamp: stamp + ^(self className: aClassName) + tiradeSelector: selector; + tiradeCategory: aCategory; + tiradeSource: source; + tiradeStamp: stamp; + yourself! Item was changed: Object subclass: #DSAnnotatedObject + instanceVariableNames: 'properties' - instanceVariableNames: 'timeStamp properties' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Model-Base'! + !DSAnnotatedObject commentStamp: 'gk 8/3/2009 16:37' prior: 0! - !DSAnnotatedObject commentStamp: 'gk 3/18/2009 16:06' prior: 0! An abstract superclass for anything that can have named properties and a creation timeStamp. + The properties Dictionary is lazily initialized, the timeStamp is set on creation.! - The properties Dictionary is lazily initialized.! Item was added: + ----- Method: DSMethodChange>>actualClass (in category 'accessing') ----- + actualClass + "Copied from MCMethodDefinition." + + ^Smalltalk at: className + ifPresent: [:class | meta ifTrue: [class classSide] ifFalse: [class]]! Item was changed: ----- Method: DSCompositeClassDeletedChange>>fromClass: (in category 'initialize-release') ----- fromClass: aClass "We add changes corresponding to removing every bit individually. + This is in order to be able to do a full revert later." - This is in order to be able to do a full revert later. - - NOTE: Do not use this method directly, use instead: - - DSClassRemovedChange fromClass: aClass - " aClass theNonMetaClass selectors do: [:sel | self add: (DSMethodRemovedChange fromClass: aClass theNonMetaClass selector: sel)]. aClass theMetaClass selectors do: [:sel | self add: (DSMethodRemovedChange fromClass: aClass theMetaClass selector: sel)]. self add: (DSClassRemovedChange new fromClass: aClass)! Item was changed: ----- Method: DSChange class>>fromChange: (in category 'instance creation') ----- fromChange: aChange + ^ self new fromChange: aChange; yourself! Item was added: + ----- Method: DSClassChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp: (in category 'instance creation') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + yourself! Item was added: + ----- Method: DSMethodChange>>category: (in category 'accessing') ----- + category: aCategory + + self protocol: aCategory! Item was added: + ----- Method: DSMethodChange>>selector: (in category 'accessing') ----- + selector: aString + selector := aString asSymbol! Item was added: + ----- Method: DSMethodSelectorChange>>oldSelector (in category 'accessing') ----- + oldSelector + ^ oldSelector! Item was changed: DSClassChange subclass: #DSClassCategoryChange instanceVariableNames: 'oldCategory' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Model-Class'! + + !DSClassCategoryChange commentStamp: 'gk 8/5/2009 23:41' prior: 0! + A change of category of a class.! Item was added: + ----- Method: DSMethodChange>>hash (in category 'comparing') ----- + hash + "This is just for comparing of group keys. See the comment in #=." + ^ (super hash bitXor: meta hash) bitXor: selector hash! Item was added: + ----- Method: DSMethodChange>>isMethodChange (in category 'testing') ----- + isMethodChange + ^ true! Item was added: + ----- Method: DSMethodSelectorChange>>asAntiChange (in category 'anti') ----- + asAntiChange + ^ super asAntiChange + oldSelector: selector; + newSelector: oldSelector; + yourself! Item was changed: ----- Method: DSChange>>fromChange: (in category 'initialize-release') ----- fromChange: aChange aChange propertiesDo: [:key :val | self propertyAt: key put: val]. + self timeStampString: aChange timeStampString! - timeStamp := aChange timeStamp.! Item was added: + ----- Method: DSAnnotatedObject>>timeStampString: (in category 'private') ----- + timeStampString: aString + self propertyAt: #timeStamp put: aString! Item was changed: ----- Method: DSClassChange>>fromClass: (in category 'initialize-release') ----- fromClass: aClass "We extract all needed attributes from the class so that we can recreate it." | class metaclass | - super fromClass: aClass. class := aClass theNonMetaClass. + self className: class name. metaclass := aClass theMetaClass. self superclassName: class superclass name. self instVarNames: class instVarNames. self classVarNames: class classVarNames asArray. self poolDictionaryNames: class poolDictionaryNames. self category: class category. self type: class typeOfClass. self classInstVarNames: metaclass instVarNames. + self comment: class organization classComment asString. - self comment: class organization classComment. self stamp: class organization commentStamp.! Item was added: + ----- Method: DSMethodSelectorChange>>newSelector (in category 'accessing') ----- + newSelector + ^ selector! Item was added: + ----- Method: DSMethodProtocolChange class>>className:selector:protocol:source:stamp:oldProtocol: (in category 'as yet unclassified') ----- + className: aClassName selector: selector protocol: newProtocol source: source stamp: stamp oldProtocol: oldProtocol + ^ (self className: aClassName) + selector: selector; + protocol: newProtocol; + source: source; + stamp: stamp; + oldProtocol: oldProtocol; + yourself! Item was changed: DSAnnotatedObject subclass: #DSChange + instanceVariableNames: '' - instanceVariableNames: 'number' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Model-Base'! + !DSChange commentStamp: 'gk 9/2/2009 19:02' prior: 0! + An abstract super class for all changes that a DSDelta can hold. A DSChange object should only hold "simple data" and not refer to the classes themselves. This makes them easy to construct, manipulate and serialize without affecting (or need) the real classes.! - !DSChange commentStamp: 'gk 4/21/2009 23:41' prior: 0! - An abstract super class for all changes that a DSDelta holds. A DSChange object should only hold "simple data" and not refer to the classes themselves. This makes them easy to construct, manipulate and serialize without affecting (or need) the real classes. - - A DSChange has a number to be able to maintain ordering - timestamping is not enough when things are going fast. A DSChange should ONLY exist in one given Delta at time, we verify this by checking that number is indeed nil when the change is added to the DSDelta.! Item was added: + ----- Method: DSDelta>>removeChange: (in category 'changes') ----- + removeChange: aChange + + | change | + change := self changes remove: change. + self grouper ifNotNil: [self grouper remove: change]. + self changed: #changeList. + ^ change! Item was changed: ----- Method: DSAnnotatedObject>>propertyAt:put: (in category 'properties') ----- propertyAt: aSymbol put: value + properties ifNil: [properties := Dictionary new: 1]. "often we just store timestamp" - properties ifNil: [properties := Dictionary new]. ^ properties at: aSymbol put: value! Item was added: + ----- Method: DSMethodChange>>category (in category 'accessing') ----- + category + ^protocol! Item was changed: ----- Method: DSMethodChange>>fromChange: (in category 'initialize-release') ----- fromChange: aChange super fromChange: aChange. + self className: aChange className. + self selector: aChange selector. + self meta: aChange meta. self source: aChange source. self protocol: aChange protocol. self stamp: aChange stamp. ! Item was added: + ----- Method: DSAnnotatedObject>>timeStampString (in category 'accessing') ----- + timeStampString + ^self propertyAt: #timeStamp! Item was added: + ----- Method: DSClassNameChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp:oldName: (in category 'instance creation') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + oldName: oldClassName + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + oldName: oldClassName; + yourself + ! Item was changed: + ----- Method: DSChange>>visitDecorators: (in category 'decorators') ----- - ----- Method: DSChange>>visitDecorators: (in category 'flags') ----- visitDecorators: aVisitor "here the visitor gives the decorators a chance to inject behavior" self decorators do: [:ea | ea accept: self for: aVisitor]! Item was added: + ----- Method: DSBasicClassChange class>>tiradeClassName: (in category 'instance creation') ----- + tiradeClassName: aName + ^ self new + tiradeClassName: aName; + yourself! Item was added: + ----- Method: DSMethodSelectorChange>>oldName: (in category 'accessing') ----- + oldName: aString + oldSelector := aString asSymbol! Item was added: + ----- Method: DSDelta>>addClassChange:from: (in category 'applying') ----- + addClassChange: changeClass from: event + "Extract all relevant information from the event + to create and add a class change of given class name." + + | class metaclass | + class := event itemClass theNonMetaClass. + metaclass := event itemClass theMetaClass. + ^self add: ( + self className: class name + changeClass: changeClass + superclassName: class superclass name + instVarNames: class instVarNames + classVarNames: class classVarNames asArray + poolDictionaryNames: class poolDictionaryNames + category: class category + type: class typeOfClass + classInstVarNames: metaclass instVarNames + comment: class organization classComment asString + stamp: class organization commentStamp)! Item was changed: ----- Method: DSClassChange>>poolDictionaryNames (in category 'accessing') ----- poolDictionaryNames ^poolDictionaryNames! Item was added: + ----- Method: DSDelta>>asAntiDelta (in category 'applying') ----- + asAntiDelta + "Return a new Delta that, when applied, reverts each change of this Delta + in reverse order. Each change should have enough information to create + an anti change from itself." + + | anti | + self isRevertable ifFalse: [DSDeltaNotRevertableException signal]. + anti := DSDelta name: 'undo ' translated, self name. + self propertiesDo: [:key :val | anti propertyAt: key put: val]. + self changes reverseDo: [:each | anti add: each asAntiChange]. + ^anti! Item was added: + ----- Method: DSDelta>>addMethodChange:from: (in category 'applying') ----- + addMethodChange: changeClass from: event + "Extract all relevant information from the event + to create and add a method change of given class name." + + | method selector class category | + category := event itemProtocol. + method := event item "Method". + "Do not ask me why we need to do it like the next three lines..." + selector := event itemSelector. + selector ifNil: [selector := event itemMethod sourceSelector]. + selector ifNil: [selector := event itemMethod selector]. + class := event itemClass. + ^self add: ( + self className: class name + selector: selector + change: changeClass + category: category + source: method getSource asString + stamp: method timeStamp)! Item was added: + ----- Method: DSMethodSelectorChange>>oldSelector: (in category 'accessing') ----- + oldSelector: aString + oldSelector := aString asSymbol! Item was changed: ----- Method: DSMethodChange>>protocol: (in category 'accessing') ----- protocol: aProtocol + protocol := aProtocol ifNil: [Categorizer default] ifNotNil: [aProtocol asSymbol]! Item was added: + ----- Method: DSMethodSelectorChange>>isMethodName (in category 'testing') ----- + isMethodName + ^true! Item was added: + ----- Method: DSDelta>>className:selector:change:category:source:stamp: (in category 'building') ----- + className: className + selector: selector + change: changeClassName + category: category + source: source + stamp: stamp + "Create and return a method change. + It is not added to this Delta." + + ^(self getClass: changeClassName) + className: className + selector: selector + category: category + source: source + stamp: stamp! Item was added: + ----- Method: DSMethodChange>>meta: (in category 'accessing') ----- + meta: aBoolean + + meta := aBoolean! Item was changed: ----- Method: DSMethodChange>>method: (in category 'initialize-release') ----- method: aCompiledMethod + self source: aCompiledMethod getSource asString. - self source: (self sourceFromMethod: aCompiledMethod). self stamp: aCompiledMethod timeStamp.! Item was changed: ----- Method: DSAnnotatedObject>>initialize (in category 'initialize-release') ----- initialize + self timeStamp: TimeStamp now! - timeStamp := TimeStamp now! Item was changed: + DSBasicClassChange subclass: #DSMethodChange + instanceVariableNames: 'selector meta source protocol stamp' - DSBasicMethodChange subclass: #DSMethodChange - instanceVariableNames: 'source protocol stamp' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Model-Method'! + + !DSMethodChange commentStamp: 'gk 8/3/2009 15:31' prior: 0! + An abstract super class for all actions affecting a specific method: + + selector: (Symbol) the method selector + meta: (Boolean) true if defined on the metaclass, false if defined on the class! Item was added: + ----- Method: DSMethodSourceChange class>>className:selector:method:oldMethod: (in category 'as yet unclassified') ----- + className: aClassName selector: selector method: newMethod oldMethod: oldMethod + ^ (self className: aClassName) + selector: selector; + oldMethod: oldMethod; + newMethod: newMethod; + yourself! Item was added: + ----- Method: DSMethodChange>>isMeta (in category 'testing') ----- + isMeta + ^ meta! Item was changed: ----- Method: DSDelta>>revert (in category 'applying') ----- revert "Revert this delta by applying its anti Delta to the image." + ^self asAntiDelta apply! - ^self asAntiChange apply! Item was changed: ----- Method: DSBasicClassChange class>>className: (in category 'instance creation') ----- + className: aName + ^ self new + className: aName; - className: aClassName - ^self new - className: aClassName; yourself! Item was changed: ----- Method: DSMethodProtocolChange>>newProtocol: (in category 'accessing') ----- newProtocol: aProtocol + self protocol: aProtocol! Item was added: + ----- Method: DSClassCommentChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:oldComment:stamp:oldStamp: (in category 'as yet unclassified') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + oldComment: oldComment + stamp: commentStamp + oldStamp: oldStamp + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + oldComment: oldComment; + oldStamp: oldStamp; + yourself + ! Item was added: + ----- Method: DSMethodSelectorChange>>isName (in category 'testing') ----- + isName + ^true! Item was changed: DSBasicClassChange subclass: #DSClassChange instanceVariableNames: 'superclassName instVarNames classVarNames classInstVarNames poolDictionaryNames category type comment stamp' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Model-Class'! + !DSClassChange commentStamp: 'gk 8/5/2009 23:50' prior: 0! + All class changes contain the full snapshot of all class attributes, then subclass have complementary "old" attributes. + This means we carry more information than needed, but that gives us a higher level of making sure changes may be safe. + For example, changing a class comment in a class that has a different super class than expected might be a good signal to not perform that change.! - !DSClassChange commentStamp: '<historical>' prior: 0! - This action must hold all information that is mandatory to supply in order to create (or remove) a class - which means quite a lot of fields. When we later change a class (the DSClassChanged* classes) we are much more fine granular. - - Note that this change only creates the class - it does not add methods or a class comment. See DSCompositeClassAddedChange.! Item was added: + ----- Method: DSMethodSelectorChange>>applyUsing: (in category 'applying') ----- + applyUsing: anApplier + ^ anApplier applyMethodName: self! Item was added: + ----- Method: DSDelta>>getClass: (in category 'private') ----- + getClass: classOrSymbol + "Lookup or return if not a symbol." + + classOrSymbol isSymbol ifTrue: [ + ^Smalltalk at: classOrSymbol]. + ^classOrSymbol! Item was added: + ----- Method: DSMethodChange>>= (in category 'comparing') ----- + = aChange + "This is just for comparing of group keys. See the comment in DSClassChange>>=. + + Group keys for method changes depend on the class/metaclass separation and the selector, in addition to what is required for class changes to group together" + ^ super = aChange and: [meta == aChange meta] and: [selector == aChange selector]! Item was added: + ----- Method: DSMethodChange class>>fromClass:selector: (in category 'as yet unclassified') ----- + fromClass: aClass selector: selector + "Create this method change from given class and selector + by extracting all attributes from it." + + ^ self new fromClass: aClass selector: selector; yourself! Item was added: + ----- Method: DSClassTypeChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp:oldType: (in category 'as yet unclassified') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + oldType: oldTypeOfClass + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + oldType: oldTypeOfClass; + yourself + ! Item was added: + ----- Method: DSMethodChange class>>className:selector:category:source:stamp: (in category 'as yet unclassified') ----- + className: aClassName selector: selector category: aCategory source: source stamp: stamp + ^(self className: aClassName) + selector: selector; + category: aCategory; + source: source; + stamp: stamp; + yourself! Item was added: + ----- Method: DSMethodSourceChange class>>className:selector:protocol:source:stamp:oldSource:oldStamp: (in category 'as yet unclassified') ----- + className: aClassName + selector: selector + protocol: protocol + source: source + stamp: stamp + oldSource: oldSource + oldStamp: oldStamp + + ^ (self className: aClassName) + selector: selector; + protocol: protocol; + source: source; + stamp: stamp; + oldSource: oldSource; + oldStamp: oldStamp; + yourself! Item was added: + ----- Method: DSMethodSelectorChange>>newName: (in category 'accessing') ----- + newName: aString + self selector: aString! Item was added: + ----- Method: DSVarsChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp:oldVars: (in category 'as yet unclassified') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + oldVars: oldVarNames + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + oldVars: oldVarNames; + yourself! Item was changed: + ----- Method: DSChange>>decorator:enable: (in category 'decorators') ----- - ----- Method: DSChange>>decorator:enable: (in category 'flags') ----- decorator: aClass enable: enable ^ enable ifTrue: [self addDecorator: aClass] ifFalse: [self removeDecorator: aClass]! Item was added: + ----- Method: DSClassCommentChange>>oldComment:stamp: (in category 'accessing') ----- + oldComment: aString stamp: aStamp + oldComment := aString. + oldStamp := aStamp! Item was added: + ----- Method: DSMethodSelectorChange>>newName (in category 'accessing') ----- + newName + ^ selector! Item was added: + ----- Method: DSClassSuperclassChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp:oldSuperclassName: (in category 'instance creation') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + oldSuperclassName: oldSuperclassName + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + oldSuperclassName: oldSuperclassName; + yourself + ! Item was added: + ----- Method: DSMethodSelectorChange>>oldName (in category 'accessing') ----- + oldName + ^ oldSelector! Item was changed: ----- Method: DSMethodSourceChange>>oldMethod: (in category 'accessing') ----- oldMethod: aCompiledMethod + self oldSource: aCompiledMethod getSource asString. - self oldSource: (self sourceFromMethod: aCompiledMethod). self oldStamp: aCompiledMethod timeStamp.! Item was added: + ----- Method: DSChangeSequence>>remove: (in category 'accessing') ----- + remove: aChange + + ^ self changes remove: aChange! Item was added: + ----- Method: DSMethodChange>>meta (in category 'accessing') ----- + meta + ^ meta! Item was changed: ----- Method: DSDelta>>initialize (in category 'initialize-release') ----- initialize super initialize. changeSequence := DSChangeSequence new. - changeCounter := 0. uuid := UUID new! Item was added: + ----- Method: DSDelta>>add: (in category 'changes') ----- + add: aChange + + self changes add: aChange. + self grouper ifNotNil: [self grouper add: aChange]. + self changed: #changeList. + ^ aChange! Item was added: + ----- Method: DSMethodChange>>className: (in category 'accessing') ----- + className: aString + "Based on the name we figure out if this is a meta change." + + ^(aString endsWith: ' class') + ifTrue: [self meta: true. super className: (aString copyUpTo: Character space)] + ifFalse: [self meta: false. super className: aString]! Item was added: + ----- Method: DSClassCommentChange class>>className:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp:oldComment:oldStamp: (in category 'as yet unclassified') ----- + className: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + oldComment: oldComment + oldStamp: oldStamp + + ^(self className: aClassName) + superclassName: superclassName; + instVarNames: instVarNames; + classVarNames: classVarNames; + poolDictionaryNames: poolDictionaryNames; + category: aCategory; + type: typeOfClass; + classInstVarNames: metaInstVarNames; + comment: classComment; + stamp: commentStamp; + oldComment: oldComment; + oldStamp: oldStamp; + yourself + ! Item was added: + ----- Method: DSDelta>>className:changeClass:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp: (in category 'building') ----- + className: className + changeClass: changeClassOrName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: category + type: typeOfClass + classInstVarNames: classInstVarNames + comment: comment + stamp: stamp + "Create and return a class change. + It is not added to the Delta." + + ^(self getClass: changeClassOrName) + className: className + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: category + type: typeOfClass + classInstVarNames: classInstVarNames + comment: comment + stamp: stamp! Item was changed: DSClassChange subclass: #DSClassCreatedChange instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Model-Class'! + !DSClassCreatedChange commentStamp: 'gk 8/5/2009 23:56' prior: 0! - !DSClassCreatedChange commentStamp: 'mtf 9/12/2007 11:12' prior: 0! - This action must hold all information that is mandatory to supply in order to create a class - which means quite a lot of fields. - When we later change a class (the DSClassChanged* classes) we are much more fine granular. - Note that this change only creates the class - it does not add methods or a class comment. See DSCompositeClassAddedChange.! Item was added: + ----- Method: DSMethodChange>>selector (in category 'accessing') ----- + selector + ^ selector! Item was added: + ----- Method: DSClassChange class>>tiradeClassName:superclassName:instVarNames:classVarNames:poolDictionaryNames:category:type:classInstVarNames:comment:stamp: (in category 'instance creation') ----- + tiradeClassName: aClassName + superclassName: superclassName + instVarNames: instVarNames + classVarNames: classVarNames + poolDictionaryNames: poolDictionaryNames + category: aCategory + type: typeOfClass + classInstVarNames: metaInstVarNames + comment: classComment + stamp: commentStamp + "Instantiate a class change from a Tirade message." + + ^(self tiradeClassName: aClassName) + tiradeSuperclassName: superclassName; + tiradeInstVarNames: instVarNames; + tiradeClassVarNames: classVarNames; + tiradePoolDictionaryNames: poolDictionaryNames; + tiradeCategory: aCategory; + tiradeType: typeOfClass; + tiradeClassInstVarNames: metaInstVarNames; + tiradeComment: classComment; + tiradeStamp: commentStamp; + yourself! Item was added: + ----- Method: DSMethodSelectorChange>>fromChange: (in category 'initialize-release') ----- + fromChange: aChange + + super fromChange: aChange. + self oldSelector: aChange oldSelector.! Item was changed: ----- Method: DSAnnotatedObject>>timeStamp: (in category 'accessing') ----- timeStamp: aTimeStamp + self propertyAt: #timeStamp put: aTimeStamp printString! - timeStamp := aTimeStamp! Item was added: + ----- Method: DSMethodChange>>isOrphanIn: (in category 'testing') ----- + isOrphanIn: environment + ^ (super isOrphanIn: environment) + or: [((self getClassFrom: environment) includesSelector: self selector) not]! Item was added: + ----- Method: DSMethodSelectorChange>>newSelector: (in category 'accessing') ----- + newSelector: aString + self selector: aString! Item was changed: DSAnnotatedObject subclass: #DSDelta + instanceVariableNames: 'uuid changeSequence' - instanceVariableNames: 'changes uuid changeCounter changeSequence' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Model-Base'! + !DSDelta commentStamp: 'gk 9/2/2009 19:02' prior: 0! + A Delta is much like a ChangeSet but improved and simplified. It can capture changes like a ChangeSet does (see #event:), but unlike ChangeSets multiple Deltas can be logging changes at the same time. A Delta maintains an ordered collection of change objects that is a true log unlike a ChangeSet which tries to normalize changes on the fly and does not maintain an order. - !DSDelta commentStamp: 'gk 6/30/2009 00:12' prior: 0! - A Delta is much like a ChangeSet but improved and simplified. It can capture changes like a ChangeSet does (see #event:), but unlike ChangeSets multiple Deltas can be logging changes at the same time. A Delta maintains a chronologically ordered collection of change objects that is a true log unlike a ChangeSet which tries to normalize changes on the fly and does not maintain an order. Also - each change object carries more information than a record in a ChangeSet does - and they know how to produce their anti change which in turn gives a Delta the ability to produce its own anti Delta. Such an anti Delta can be used to revert a Delta. Instance variables: changeSequence - an instance of DSChangeSequence. uuid - created when I am first instantiated, never changed. - changeCounter - a counter to ensure strict sorting of changes, timestamps are not sufficient. Standard properties: #revertable - if missing we presume true. Can be used to explicitly flag a Delta as revertable/not revertable. ! Item was added: + ----- Method: DSMethodChange>>printOn: (in category 'printing') ----- + printOn: aStream + aStream nextPutAll: self className. + self isMeta ifTrue: [aStream nextPutAll: ' class']. + aStream + nextPutAll: '>>'; + nextPutAll: self selector asString; + space; nextPutAll: self action! Item was removed: - ----- Method: DSBasicClassChange>>classGroupKey (in category 'grouping') ----- - classGroupKey - "See the comment in DSChange>>inClassGroupFor:" - ^ DSBasicClassChange fromChange: self! Item was removed: - ----- Method: DSBasicMethodChange>>fromClass:selector: (in category 'initialize-release') ----- - fromClass: aClass selector: aSelector - self class: aClass selector: aSelector! Item was removed: - ----- Method: DSCompositeMethodChange>>selector (in category 'accessing') ----- - selector - ^ self changes last selector! Item was removed: - ----- Method: DSClassSuperclassChange class>>class:from:to: (in category 'as yet unclassified') ----- - class: aClass from: oldSuperclass to: newSuperclass - ^(self class: aClass) oldSuperclass: oldSuperclass; newSuperclass: newSuperclass; yourself! Item was removed: - DSChangeSequence subclass: #DSCompositeMethodChange - instanceVariableNames: 'protocol' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Model-Composite'! Item was removed: - ----- Method: DSDelta>>isLogging (in category 'change logging') ----- - isLogging - "Is this Delta logging system changes?" - - ^SystemChangeNotifier uniqueInstance hasNotificationsFor: self! Item was removed: - ----- Method: DSDelta>>buildGrouper (in category 'accessing') ----- - buildGrouper - - ^self propertyAt: #grouper put: (DSGroupedClassChange withAll: self; yourself)! Item was removed: - ----- Method: DSMethodNameChange>>oldSelector (in category 'accessing') ----- - oldSelector - ^ oldSelector! Item was removed: - ----- Method: DSClassCommentChange class>>changing:from:to:oldStamp:newStamp: (in category 'as yet unclassified') ----- - changing: aClass from: oldComment to: newComment oldStamp: oldStamp newStamp: newStamp - ^(self fromClass: aClass) - oldComment: oldComment; - newComment: newComment; - oldStamp: oldStamp; - newStamp: newStamp; - yourself! Item was removed: - ----- Method: DSClassTypeChange class>>changing:from:to: (in category 'as yet unclassified') ----- - changing: aClass from: old to: new - ^ (self fromClass: aClass) - oldType: old; - newType: new; - yourself! Item was removed: - ----- Method: DSChange>>isRecord (in category 'testing') ----- - isRecord - ^false! Item was removed: - ----- Method: DSMethodNameChange>>newSelector (in category 'accessing') ----- - newSelector - ^ selector! Item was removed: - ----- Method: DSClassRemovedChange class>>fromClass: (in category 'instance creation') ----- - fromClass: aClass - "A class was removed from the system. If aClass - has methods we need to do create a composite delete change, - otheriwse this class change is enough." - - (aClass theNonMetaClass selectors isEmpty and: [aClass theMetaClass selectors isEmpty]) - ifTrue: [ ^ super fromClass: aClass] - ifFalse: [ ^ DSCompositeClassDeletedChange fromClass: aClass]! Item was removed: - ----- Method: DSMethodNameChange>>isName (in category 'testing') ----- - isName - ^true! Item was removed: - ----- Method: DSBasicClassChange>>setClass: (in category 'accessing') ----- - setClass: aClass - self className: aClass theNonMetaClass name! Item was removed: - ----- Method: DSBasicMethodChange>>selector: (in category 'accessing') ----- - selector: aString - selector := aString asSymbol! Item was removed: - ----- Method: DSChange>>inMergeGroupFor: (in category 'grouping') ----- - inMergeGroupFor: aChange - "See the comment in #inMergeGroupFor:withClassName:" - | myKey otherKey | - myKey := self mergeGroupKey ifNil: [^ false]. - otherKey := aChange mergeGroupKey ifNil: [^ false]. - ^ myKey = otherKey! Item was removed: - ----- Method: DSBasicMethodChange>>hash (in category 'comparing') ----- - hash - "This is just for comparing of group keys. See the comment in #=." - ^ (super hash bitXor: meta hash) bitXor: selector hash! Item was removed: - ----- Method: DSBasicMethodChange>>isMethodChange (in category 'testing') ----- - isMethodChange - ^ true! Item was removed: - ----- Method: DSBasicMethodChange>>name: (in category 'accessing') ----- - name: aSymbol - selector := aSymbol! Item was removed: - ----- Method: DSDelta>>addChange: (in category 'change logging') ----- - addChange: aChange - "Within a Delta we give a change a monotonically increasing number - in order to be able to sort changes chronologically. The TimeStamp does - not work if changes are created very fast, they end up the same and sorting - becomes undefined. The change is copied if it already has a number, - in that case it is already in a different delta and we do not want to share." - - | change | - change := aChange number ifNil: [aChange] ifNotNil: [aChange copy]. - change number: self incrementChangeCounter. - self changes add: change. - self grouper ifNotNil: [self grouper add: change]. - self changed: #changeList. - ^ change! Item was removed: - ----- Method: DSChange>>inMethodGroupFor:withClassName: (in category 'grouping') ----- - inMethodGroupFor: aChange withClassName: className - "Answers true if I am in the same method group as aChange. I answer true on two conditions: Either: - 1. both aChange and I are method changes, and we are both part of the same class or metaclass and have the same selector, or - 2. both aChange and I are class changes, are not method changes, and are part of the same class/metaclass pair - - As in #inClassGroupFor:withClassName:, aChange is treated as having the given name rather its real name to work around class renames" - | myKey otherKey | - myKey := self methodGroupKey ifNil: [^ false]. - otherKey := aChange methodGroupKey ifNil: [^ false]. - ^ myKey = (otherKey className: className)! Item was removed: - ----- Method: DSBasicMethodChange>>class:selector: (in category 'initialize-release') ----- - class: aClass selector: aSelector - self setClass: aClass. - self selector: aSelector! Item was removed: - ----- Method: DSClassChange>>mergeGroupKey (in category 'grouping') ----- - mergeGroupKey - "See the comment in DSDelta>>inMergeGroupFor:. My instances are asymmetric and cannot be merged, so return nil" - ^ nil! Item was removed: - ----- Method: DSBasicMethodChange>>name (in category 'accessing') ----- - name - ^ selector! Item was removed: - ----- Method: DSMethodNameChange>>newName: (in category 'accessing') ----- - newName: aString - self selector: aString! Item was removed: - ----- Method: DSClassCategoryChange class>>className:from:to: (in category 'as yet unclassified') ----- - className: aName from: oldCategory to: newCategory - ^(self className: aName) - oldCategory: oldCategory; - newCategory: newCategory; - yourself! Item was removed: - ----- Method: DSMethodNameChange>>oldName: (in category 'accessing') ----- - oldName: aString - oldSelector := aString asSymbol! Item was removed: - ----- Method: DSCompositeMethodChange>>protocol (in category 'accessing') ----- - protocol - protocol ifNotNil: [^ protocol]. - Smalltalk at: self className ifPresent: [:aClass | - ^ aClass organization categoryOfElement: self selector]. - ^ Categorizer default! Item was removed: - ----- Method: DSCompositeMethodChange>>className (in category 'accessing') ----- - className - ^ self changes last className! Item was removed: - ----- Method: DSMethodNameChange>>oldName (in category 'accessing') ----- - oldName - ^ oldSelector! Item was removed: - ----- Method: DSBasicMethodChange>>fromChange: (in category 'initialize-release') ----- - fromChange: aChange - super fromChange: aChange. - self className: aChange className. - self selector: aChange selector. - self meta: aChange meta.! Item was removed: - ----- Method: DSMethodNameChange>>isMethodName (in category 'testing') ----- - isMethodName - ^true! Item was removed: - ----- Method: DSCompositeMethodChange>>applyUsing: (in category 'applying') ----- - applyUsing: anApplier - ^ anApplier applyCompositeMethodChange: self! Item was removed: - ----- Method: DSCompositeMethodChange>>add: (in category 'accessing') ----- - add: aChange - aChange isMethodChange ifFalse: [^ nil]. - aChange isMethodAdded | aChange isMethodRemoved ifTrue: [protocol := aChange protocol]. - aChange isMethodProtocol ifTrue: [protocol := aChange newProtocol]. - ^ super add: aChange! Item was removed: - ----- Method: DSDelta>>incrementChangeCounter (in category 'private') ----- - incrementChangeCounter - "Monotonically increasing change counter to enable strict chronological sorting. - And no, we can't rely on the collection size - because changes may have been removed - causing holes in the sequence etc." - - ^changeCounter := changeCounter + 1! Item was removed: - ----- Method: DSBasicClassChange class>>class: (in category 'instance creation') ----- - class: aClass - ^ self new - setClass: aClass; - yourself! Item was removed: - DSMethodChange subclass: #DSMethodNameChange - instanceVariableNames: 'oldSelector' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Model-Method'! Item was removed: - ----- Method: DSMethodNameChange>>fromChange: (in category 'initialize-release') ----- - fromChange: aChange - - super fromChange: aChange. - self oldSelector: aChange oldSelector.! Item was removed: - ----- Method: DSSystemEditorApplier>>applyMethodSnapshot: (in category 'as yet unclassified') ----- - applyMethodSnapshot: snapshot - "Snapshots just record the old version; there is no new version. So, only apply them if there is nothing better." - (self classEditorForChange: snapshot) - edMethodAt: snapshot selector ifAbsent: [self applyMethodAdded: snapshot]! Item was removed: - ----- Method: DSChange>>inClassGroupFor: (in category 'grouping') ----- - inClassGroupFor: aChange - "Answers true if I am an the same class as aChange, false otherwise" - | myKey otherKey | - myKey := self classGroupKey ifNil: [^ false]. - otherKey := aChange classGroupKey ifNil: [^ false]. - ^ myKey = otherKey! Item was removed: - DSBasicClassChange subclass: #DSBasicMethodChange - instanceVariableNames: 'selector meta' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Model-Method'! - - !DSBasicMethodChange commentStamp: 'gk 8/28/2007 22:46' prior: 0! - An abstract super class for all actions affecting a specific method: - - selector: (Symbol) the method selector - className: (Symbol) the name of the defining class - metaclass: (Boolean) true if defined on the metaclass, false if defined on the class! Item was removed: - ----- Method: DSChange>>inClassGroupFor:withClassName: (in category 'grouping') ----- - inClassGroupFor: aChange withClassName: className - "Answers true if I am an the same class as aChange, false otherwise. For the purposes of comparison, aChange is assumed to have the given class name rather than its actual class name to work around renaming issues" - | myKey otherKey | - myKey := self classGroupKey ifNil: [^ false]. - otherKey := aChange classGroupKey ifNil: [^ false]. - ^ myKey = (otherKey className: className)! Item was removed: - ----- Method: DSCompositeMethodChange>>isClassChange (in category 'testing') ----- - isClassChange - ^ true! Item was removed: - ----- Method: DSBasicMethodChange>>meta: (in category 'accessing') ----- - meta: aBoolean - - meta := aBoolean! Item was removed: - ----- Method: DSDelta>>asAntiChange (in category 'applying') ----- - asAntiChange - "Return a new Delta that, when applied, reverts each change of this Delta - in reverse order. Each change should have enough information to create - an anti change from itself." - - | anti | - self isRevertable ifFalse: [DSDeltaNotRevertableException signal]. - anti := DSDelta name: 'undo ' translated, self name. - self propertiesDo: [:key :val | anti propertyAt: key put: val]. - self changes reverseDo: [:each | anti addChange: each asAntiChange]. - ^anti! Item was removed: - ----- Method: DSCompositeMethodChange>>isMethodChange (in category 'testing') ----- - isMethodChange - ^ true! Item was removed: - ----- Method: DSMethodNameChange>>applyUsing: (in category 'applying') ----- - applyUsing: anApplier - ^ anApplier applyMethodName: self! Item was removed: - ----- Method: DSBasicMethodChange>>isMeta (in category 'testing') ----- - isMeta - ^ meta! Item was removed: - ----- Method: DSChange>>number (in category 'accessing') ----- - number - ^number! Item was removed: - ----- Method: DSCompositeMethodChange>>category (in category 'accessing') ----- - category - "for compatability with DSChangeClassifier, letting it implement the Categorization protocol" - ^ self protocol! Item was removed: - ----- Method: DSCompositeMethodChange>>fromChange: (in category 'initialize-release') ----- - fromChange: aChange - - super fromChange: aChange. - protocol := aChange protocol! Item was removed: - ----- Method: DSBasicMethodChange>>= (in category 'comparing') ----- - = aChange - "This is just for comparing of group keys. See the comment in DSClassChange>>=. - - Group keys for method changes depend on the class/metaclass separation and the selector, in addition to what is required for class changes to group together" - ^ super = aChange and: [meta == aChange meta] and: [selector == aChange selector]! Item was removed: - ----- Method: DSChange>><= (in category 'comparing') ----- - <= other - "Sort by number per default, this represents order of addition." - - ^number <= other number! Item was removed: - ----- Method: DSMethodNameChange>>newName (in category 'accessing') ----- - newName - ^ selector! Item was removed: - ----- Method: DSBasicMethodChange class>>fromClass:selector: (in category 'instance creation') ----- - fromClass: aClass selector: selector - ^ self new fromClass: aClass selector: selector; yourself! Item was removed: - ----- Method: DSVisitor>>applyCategorizedCompositeChange: (in category 'composite changes') ----- - applyCategorizedCompositeChange: change - "Treat like a composite change by default" - - ^ self applyCompositeChange: change! Item was removed: - ----- Method: DSClassSuperclassChange class>>className:fromName:toName: (in category 'as yet unclassified') ----- - className: aName fromName: oldSuperclassName toName: newSuperclassName - ^(self className: aName) oldSuperclassName: oldSuperclassName; newSuperclassName: newSuperclassName; yourself! Item was removed: - ----- Method: DSMethodProtocolChange class>>class:selector:from:to: (in category 'as yet unclassified') ----- - class: aClass selector: selector from: oldProtocol to: newProtocol - ^ (self class: aClass selector: selector) - oldProtocol: oldProtocol; - newProtocol: newProtocol; - yourself! Item was removed: - ----- Method: DSChange>>classGroupKey (in category 'grouping') ----- - classGroupKey - "see the comment in #inClassGroupFor:. Changes are not groupable by default, so return nil" - ^ nil! Item was removed: - ----- Method: DSDelta>>stopLogging (in category 'change logging') ----- - stopLogging - "Make this Delta stop logging system changes. - ChangeSets only have one that is logging." - - self isLogging ifTrue: [ - SystemChangeNotifier uniqueInstance noMoreNotificationsFor: self]! Item was removed: - ----- Method: DSBasicMethodChange>>meta (in category 'accessing') ----- - meta - ^ meta! Item was removed: - ----- Method: DSBasicMethodChange>>sourceFromMethod: (in category 'convenience') ----- - sourceFromMethod: aCompiledMethod - ^ aCompiledMethod getSourceFor: self selector in: self getClass! Item was removed: - ----- Method: DSBasicMethodChange>>className: (in category 'accessing') ----- - className: aString - ^ (aString endsWith: ' class') - ifTrue: [self meta: true. super className: (aString copyUpTo: Character space)] - ifFalse: [self meta ifNil: [self meta: false]. super className: aString]! Item was removed: - ----- Method: DSDelta>>fixChangeNumbers (in category 'utilities') ----- - fixChangeNumbers - "Fix the change numbers to conform to the invariant that the number - of the change is the same as it's index in the change collection." - - | chgs | - chgs := self changes. - chgs withIndexDo: [:change :index | change number: index]. - changeCounter := chgs size! Item was removed: - ----- Method: DSMethodChange>>mergeGroupKey (in category 'grouping') ----- - mergeGroupKey - "See the comment in DSDelta>>inMergeGroupFor:. My instances are not symetric enough to be mergable, so return nil" - ^ nil! Item was removed: - ----- Method: DSBasicMethodChange>>selector (in category 'accessing') ----- - selector - ^ selector! Item was removed: - ----- Method: DSMethodNameChange>>newSelector: (in category 'accessing') ----- - newSelector: aString - self selector: aString! Item was removed: - ----- Method: DSBasicMethodChange>>setClass: (in category 'convenience') ----- - setClass: aClass - super setClass: aClass. - self meta: aClass isMeta! Item was removed: - ----- Method: DSCompositeMethodChange>>isMeta (in category 'accessing') ----- - isMeta - ^ self changes last isMeta! Item was removed: - ----- Method: DSMethodNameChange>>asAntiChange (in category 'anti') ----- - asAntiChange - ^ super asAntiChange - oldSelector: selector; - newSelector: oldSelector; - yourself! Item was removed: - ----- Method: DSBasicMethodChange class>>class:selector: (in category 'instance creation') ----- - class: aClass selector: selector - ^ (self class: aClass) - selector: selector; - yourself! Item was removed: - ----- Method: DSBasicMethodChange>>isOrphanIn: (in category 'validation') ----- - isOrphanIn: environment - ^ (super isOrphanIn: environment) - or: [((self getClassFrom: environment) includesSelector: self selector) not]! Item was removed: - ----- Method: DSChange>>number: (in category 'accessing') ----- - number: aNumber - number := aNumber! Item was removed: - ----- Method: DSBasicMethodChange>>methodGroupKey (in category 'grouping') ----- - methodGroupKey - "For grouping. See the comment in DSChange>>inMethodGroupFor:" - ^ DSBasicMethodChange fromChange: self! Item was removed: - ----- Method: DSBasicMethodChange>>printOn: (in category 'as yet unclassified') ----- - printOn: aStream - aStream nextPutAll: self className. - self isMeta ifTrue: [aStream nextPutAll: ' class']. - aStream - nextPutAll: '>>'; - nextPutAll: self selector; - space; nextPutAll: self action! Item was removed: - ----- Method: DSMethodSourceChange class>>class:selector:from:to: (in category 'as yet unclassified') ----- - class: aClass selector: selector from: oldMethod to: newMethod - ^ (self class: aClass selector: selector) - oldMethod: oldMethod; - newMethod: newMethod; - yourself! Item was removed: - ----- Method: DSChange>>inMergeGroupFor:withClassName: (in category 'grouping') ----- - inMergeGroupFor: aChange withClassName: className - "Answers true if both aChange and I: - 1. are primitive changes (ie not composite) - 2. are of the same class - 3. are non-shadowing changes - 4. satisfy all the conditions listed in the comment of #inMethodGroupFor:withClassName: - - As in #inClassGroupFor:withClassName:, aChange is treated as having the given name rather its real name to work around class renames - - If I answer true, aChange and I can be merged into a single change, though not necesarilly cleanly. Shadowing changes (additions and removals) do not have the before/after symmetry required to be in this equivilance group" - | myKey otherKey | - myKey := self mergeGroupKey ifNil: [^ false]. - otherKey := aChange mergeGroupKey ifNil: [^ false]. - ^ myKey = (otherKey className: className)! Item was removed: - ----- Method: DSBasicClassChange>>methodGroupKey (in category 'grouping') ----- - methodGroupKey - "See the comment in DSChange>>inMethodGroupFor:" - ^ self classGroupKey! Item was removed: - ----- Method: DSClassSuperclassChange class>>changing:from:to: (in category 'as yet unclassified') ----- - changing: aClass from: oldSuperclass to: newSuperclass - ^(self fromClass: aClass) - oldSuperclass: oldSuperclass; - newSuperclass: newSuperclass; - yourself! Item was removed: - ----- Method: DSChange>>methodGroupKey (in category 'grouping') ----- - methodGroupKey - "see the comment in #inMethodGroupFor:. Changes are not groupable by default, so return nil" - ^ nil! Item was removed: - ----- Method: DSClassChange class>>className: (in category 'instance creation') ----- - className: aClassName - ^self new className: aClassName; yourself! Item was removed: - ----- Method: DSMethodNameChange class>>class:selector:from:to: (in category 'as yet unclassified') ----- - class: aClass selector: selector from: oldSelector to: newSelector - ^ (self class: aClass selector: selector) - newSelector: newSelector; - yourself! Item was removed: - ----- Method: DSBasicClassChange>>mergeGroupKey (in category 'grouping') ----- - mergeGroupKey - "See the comment in DSChange>>inMergeGroupFor: Creates a blank instance of this class; only className is set; all other vars are nil. This sends the class message to determine the class to create rather than using a well-known class, like class group key and method group key do. Thus, merge group keys are specific to the change type, rather than generic for all class changes" - ^ self class new className: className! Item was removed: - ----- Method: DSDelta>>startLogging (in category 'change logging') ----- - startLogging - "Make this Delta start logging system changes. - ChangeSets only have one that is logging." - - self isLogging ifFalse: [ - SystemChangeNotifier uniqueInstance - notify: self - ofAllSystemChangesUsing: #event:]! Item was removed: - ----- Method: DSMethodNameChange>>oldSelector: (in category 'accessing') ----- - oldSelector: aString - oldSelector := aString asSymbol! Item was removed: - ----- Method: DSClassCategoryChange class>>changing:from:to: (in category 'as yet unclassified') ----- - changing: aClass from: oldCategory to: newCategory - ^(self fromClass: aClass) - oldCategory: oldCategory; - newCategory: newCategory; - yourself! Item was removed: - ----- Method: DSChange>>inMethodGroupFor: (in category 'grouping') ----- - inMethodGroupFor: aChange - "See the comment in #inMethodGroupFor:withClassChange: for the meaning of this method" - | myKey otherKey | - myKey := self methodGroupKey ifNil: [^ false]. - otherKey := aChange methodGroupKey ifNil: [^ false]. - ^ myKey = otherKey! Item was removed: - ----- Method: DSChange>>mergeGroupKey (in category 'grouping') ----- - mergeGroupKey - "see the comment in #inMergeGroupFor:. Changes are not groupable by default, so return nil" - ^ nil!
1
0
0
0
DeltaStreams: DeltaStreams-Logging-gk.6.mcz
by squeak-dev-noreply@lists.squeakfoundation.org
04 Sep '09
04 Sep '09
A new version of DeltaStreams-Logging was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Logging-gk.6.mcz
==================== Summary ==================== Name: DeltaStreams-Logging-gk.6 Author: gk Time: 4 September 2009, 8:54:13 am UUID: 08b08833-0a64-4cff-b111-2fa251e05122 Ancestors: DeltaStreams-Logging-gk.5 Lots of changes, refactoring and more green tests. =============== Diff against DeltaStreams-Logging-gk.5 =============== Item was changed: ----- Method: DSDelta>>logSharedPoolsChangedEvent: (in category '*deltastreams-logging') ----- + logSharedPoolsChangedEvent: event - logSharedPoolsChangedEvent: anEvent "Shared pools changed." + (self addClassChange: DSSharedPoolVarsChange from: event) + oldVars: event oldItem poolDictionaryNames! - self addChange: (DSSharedPoolVarsChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logClassTypeChangedEvent: (in category '*deltastreams-logging') ----- + logClassTypeChangedEvent: event - logClassTypeChangedEvent: anEvent "Type of class changed." + (self addClassChange: DSClassTypeChange from: event) + oldType: event oldTypeOfClass! - self addChange: (DSClassTypeChange fromEvent: anEvent)! Item was added: + ----- Method: DSDelta>>logMethodProtocolEvent:oldProtocol:newProtocol: (in category '*deltastreams-logging') ----- + logMethodProtocolEvent: anEvent oldProtocol: oldProtocol newProtocol: newProtocol + "A method is being categorized under a new protocol." + + (self addMethodChange: DSMethodProtocolChange from: anEvent) + newProtocol: newProtocol; "this is also odd, thought this was done in previous line" + oldProtocol: oldProtocol! Item was changed: ----- Method: DSDelta>>logClassCategoryChangedEvent: (in category '*deltastreams-logging') ----- + logClassCategoryChangedEvent: event - logClassCategoryChangedEvent: anEvent "Class Category changed." + (self addClassChange: DSClassCategoryChange from: event) + oldCategory: event oldCategory! - self addChange: (DSClassCategoryChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logClassVarsChangedEvent: (in category '*deltastreams-logging') ----- + logClassVarsChangedEvent: event - logClassVarsChangedEvent: anEvent "Class vars changed." + (self addClassChange: DSClassVarsChange from: event) + oldVars: event oldClassVarNames! - self addChange: (DSClassVarsChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logClassRemovedEvent: (in category '*deltastreams-logging') ----- + logClassRemovedEvent: event + "A class was removed from the system." - logClassRemovedEvent: anEvent - "A class was removed from the system" + | class metaclass | + class := event itemClass theNonMetaClass. + metaclass := event itemClass theMetaClass. + (class selectors isEmpty and: [metaclass selectors isEmpty]) + ifTrue: [ ^ self addClassChange: DSClassRemovedChange from: event] + ifFalse: [ ^ self add: (DSCompositeClassDeletedChange fromClass: class) ] + ! - self addChange: (DSClassRemovedChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logMethodRemovedEvent: (in category '*deltastreams-logging') ----- logMethodRemovedEvent: anEvent + "A method was removed." - "A new method was created." + self addMethodChange: DSMethodRemovedChange from: anEvent! - self addChange: (DSMethodRemovedChange fromEvent: anEvent)! Item was added: + ----- Method: DSDelta>>stopLogging (in category '*deltastreams-logging') ----- + stopLogging + "Make this Delta stop logging system changes. + ChangeSets only have one that is logging." + + self isLogging ifTrue: [ + SystemChangeNotifier uniqueInstance noMoreNotificationsFor: self]! Item was changed: ----- Method: DSDelta>>logMethodModifyEvent: (in category '*deltastreams-logging') ----- logMethodModifyEvent: anEvent + "A method was modified, also log a protocol change if needed." + anEvent isProtocolModified ifTrue: + [self logMethodProtocolEvent: anEvent oldProtocol: anEvent oldProtocol newProtocol: anEvent newProtocol]. + self logMethodSourceEvent: anEvent oldMethod: anEvent oldItem! - [self logMethodProtocolEvent: anEvent from: anEvent oldProtocol to: anEvent newProtocol]. - self logMethodSourceEvent: anEvent from: anEvent oldItem to: anEvent item! Item was added: + ----- Method: DSDelta>>startLogging (in category '*deltastreams-logging') ----- + startLogging + "Make this Delta start logging system changes. + ChangeSets only have one that is logging." + + self isLogging ifFalse: [ + SystemChangeNotifier uniqueInstance + notify: self + ofAllSystemChangesUsing: #event:]! Item was changed: ----- Method: DSDelta>>event: (in category '*deltastreams-logging') ----- event: anEvent "This is where events come in from the SystemChangeNotifier. This code is similar to the old code in ChangeSet." | class | anEvent itemKind = SystemChangeNotifier classKind ifTrue: [ class := anEvent item. class isBehavior ifFalse: [^ self]. "Ignore traits for now" class wantsChangeSetLogging ifFalse: [^self]. anEvent isAdded ifTrue: [self logClassCreatedEvent: anEvent]. anEvent isRemoved ifTrue: [self logClassRemovedEvent: anEvent]. anEvent isRenamed ifTrue: [self logClassRenamedEvent: anEvent]. + anEvent isCommented ifTrue: [self logClassCommentChangedEvent: anEvent]. - anEvent isCommented ifTrue: [self logClassCommentedEvent: anEvent]. anEvent isModified ifTrue: [class isMeta ifTrue: [self modifyMetaclass: class event: anEvent] ifFalse: [self modifyClass: class event: anEvent]]. anEvent isReorganized ifTrue: [self reorganizeClass: anEvent item]. anEvent isRecategorized ifTrue: [self logClassCategoryChangedEvent: anEvent]. ]. anEvent itemKind = SystemChangeNotifier methodKind ifTrue: [ class := anEvent itemClass. class isBehavior ifFalse: [^ self]. "Ignore traits for now" class wantsChangeSetLogging ifFalse: [^self]. anEvent isAdded ifTrue: [self logMethodAddedEvent: anEvent]. anEvent isRemoved ifTrue: [self logMethodRemovedEvent: anEvent]. + anEvent isRecategorized ifTrue: [self logMethodProtocolEvent: anEvent oldProtocol: anEvent oldCategory newProtocol: anEvent itemProtocol ]. - anEvent isRecategorized ifTrue: [self logMethodProtocolEvent: anEvent from: anEvent oldCategory to: anEvent itemProtocol]. anEvent isModified ifTrue: [self logMethodModifyEvent: anEvent]. ].! Item was added: + ----- Method: DSDelta>>isLogging (in category '*deltastreams-logging') ----- + isLogging + "Is this Delta logging system changes?" + + ^SystemChangeNotifier uniqueInstance hasNotificationsFor: self! Item was changed: ----- Method: DSDelta>>modifyMetaclass:event: (in category '*deltastreams-logging') ----- modifyMetaclass: class event: anEvent + "A metaclass definition was modified. This basically just means + the class instance variables were changed." - "A metaclass definition was modified. This basicly just means the class instance variables were changed" anEvent areInstVarsModified ifTrue: [self logClassInstVarsChangedEvent: anEvent]! Item was added: + ----- Method: DSDelta>>logMethodSourceEvent:oldMethod: (in category '*deltastreams-logging') ----- + logMethodSourceEvent: anEvent oldMethod: oldMethod + "A method has new source." + + (self addMethodChange: DSMethodSourceChange from: anEvent) + oldSource: oldMethod getSource asString; + oldStamp: oldMethod timeStamp! Item was changed: ----- Method: DSDelta>>logInstVarsChangedEvent: (in category '*deltastreams-logging') ----- + logInstVarsChangedEvent: event - logInstVarsChangedEvent: anEvent "Instvars changed." + (self addClassChange: DSInstVarsChange from: event) + oldVars: event oldInstVarNames! - self addChange: (DSInstVarsChange fromEvent: anEvent)! Item was added: + ----- Method: DSDelta>>logClassCommentChangedEvent: (in category '*deltastreams-logging') ----- + logClassCommentChangedEvent: event + "A class comment has been changed." + + (self addClassChange: DSClassCommentChange from: event) + oldComment: event oldComment stamp: event oldStamp! Item was changed: ----- Method: DSDelta>>logSuperclassChangedEvent: (in category '*deltastreams-logging') ----- + logSuperclassChangedEvent: event - logSuperclassChangedEvent: anEvent "Superclass changed." + (self addClassChange: DSClassSuperclassChange from: event) + oldSuperclassName: event oldSuperclass name! - self addChange: (DSClassSuperclassChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logClassInstVarsChangedEvent: (in category '*deltastreams-logging') ----- + logClassInstVarsChangedEvent: event - logClassInstVarsChangedEvent: anEvent "Instvars changed." + (self addClassChange: DSClassInstVarsChange from: event) + oldVars: event oldInstVarNames! - self addChange: (DSClassInstVarsChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logClassRenamedEvent: (in category '*deltastreams-logging') ----- + logClassRenamedEvent: event - logClassRenamedEvent: anEvent "A class is being renamed." + (self addClassChange: DSClassNameChange from: event) + oldName: event oldName! - self addChange: (DSClassNameChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logClassCreatedEvent: (in category '*deltastreams-logging') ----- + logClassCreatedEvent: event - logClassCreatedEvent: anEvent "A new class was created." + self addClassChange: DSClassCreatedChange from: event + ! - self addChange: (DSClassCreatedChange fromEvent: anEvent)! Item was changed: ----- Method: DSDelta>>logMethodAddedEvent: (in category '*deltastreams-logging') ----- logMethodAddedEvent: anEvent "A new method was created." + self addMethodChange: DSMethodAddedChange from: anEvent! - self addChange: (DSMethodAddedChange fromEvent: anEvent)! Item was removed: - ----- Method: DSMethodChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - method: anEvent itemMethod; - protocol: anEvent itemProtocol; - yourself! Item was removed: - ----- Method: DSSharedPoolVarsChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldVars: anEvent oldItem poolDictionaryNames; - yourself! Item was removed: - ----- Method: DSBasicClassChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^self fromClass: anEvent itemClass! Item was removed: - ----- Method: DSDelta>>logClassCommentedEvent: (in category '*deltastreams-logging') ----- - logClassCommentedEvent: anEvent - "A class comment has been changed." - - self addChange: (DSClassCommentChange fromEvent: anEvent)! Item was removed: - ----- Method: DSClassCategoryChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldCategory: anEvent oldCategory; - yourself! Item was removed: - ----- Method: DSClassCommentChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldComment: anEvent oldComment; - newComment: anEvent newComment; - oldStamp: anEvent oldStamp; - newStamp: anEvent newStamp; - yourself! Item was removed: - ----- Method: DSClassVarsChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldVars: anEvent oldClassVarNames; - yourself! Item was removed: - ----- Method: DSClassSuperclassChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldSuperclass: anEvent oldSuperclass; - yourself! Item was removed: - ----- Method: DSClassNameChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldName: anEvent oldName; - yourself! Item was removed: - ----- Method: DSInstVarsChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldVars: anEvent oldInstVarNames; - yourself! Item was removed: - ----- Method: DSDelta>>logMethodProtocolEvent:from:to: (in category '*deltastreams-logging') ----- - logMethodProtocolEvent: anEvent from: oldProtocol to: newProtocol - "A method is being categorized under a new protocol." - - | selector | - selector := anEvent itemSelector. - selector ifNil: [selector := anEvent itemMethod sourceSelector]. - selector ifNil: [selector := anEvent itemMethod selector]. - self addChange: (DSMethodProtocolChange - class: anEvent itemClass - selector: selector - from: oldProtocol - to: newProtocol)! Item was removed: - ----- Method: DSClassTypeChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldType: anEvent oldTypeOfClass; - yourself! Item was removed: - ----- Method: DSClassInstVarsChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ (super fromEvent: anEvent) - oldVars: anEvent oldInstVarNames; - yourself! Item was removed: - ----- Method: DSDelta>>logMethodSourceEvent:from:to: (in category '*deltastreams-logging') ----- - logMethodSourceEvent: anEvent from: oldMethod to: newMethod - "A method has new source." - - self addChange: (DSMethodSourceChange - class: anEvent itemClass - selector: anEvent itemSelector - from: oldMethod - to: newMethod)! Item was removed: - ----- Method: DSBasicMethodChange class>>fromEvent: (in category '*deltastreams-logging') ----- - fromEvent: anEvent - ^ self class: anEvent itemClass selector: anEvent itemSelector!
1
0
0
0
DeltaStreams: DeltaStreams-Deprecated-gk.4.mcz
by squeak-dev-noreply@lists.squeakfoundation.org
03 Sep '09
03 Sep '09
A new version of DeltaStreams-Deprecated was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Deprecated-gk.4.mcz
==================== Summary ==================== Name: DeltaStreams-Deprecated-gk.4 Author: gk Time: 3 September 2009, 4:25:52 pm UUID: 38b0222f-d09e-45ce-b178-d0e7cd84358d Ancestors: DeltaStreams-Deprecated-gk.3 Removals. =============== Diff against DeltaStreams-Deprecated-gk.3 =============== Item was changed: ----- Method: DSDeltaEditor>>comment:stamp: (in category 'editing') ----- comment: aComment stamp: aStamp class ifNotNil: [ ^delta commentClass: class + from: class organization classComment asString - from: class organization classComment to: aComment oldStamp: class organization commentStamp newStamp: aStamp] ifNil: [ ^delta commentClassName: className from: '' to: aComment oldStamp: nil newStamp: aStamp]! Item was changed: ----- Method: DSDeltaEditor>>createClassName: (in category 'editing') ----- createClassName: aName "Add an existing class." className := aName. + ^delta add: (DSClassCreatedChange className: className)! - ^delta addChange: (DSClassCreatedChange className: className)! Item was removed: - ----- Method: DSChangeCategorizer class>>forMethods (in category 'as yet unclassified') ----- - forMethods - ^ self - default: [:aSymbol | DSCompositeMethodChange new] - classify: [:aChange | aChange selector]! Item was removed: - ----- Method: DSGroupedClassChange>>do: (in category 'enumerating') ----- - do: aBlock - super do: aBlock. - self methodChanges do: aBlock. - self classMethodChanges do: aBlock! Item was removed: - ----- Method: DSChangeCategorizer>>groupsDo: (in category 'enumerating') ----- - groupsDo: aBlock - self dictionary do: [:ea | ea groupsDo: aBlock]! Item was removed: - ----- Method: DSGroupedClassChange>>classMethodChanges (in category 'accessing') ----- - classMethodChanges - ^ classMethodChanges - ifNil: [classMethodChanges := DSChangeCategorizer forMethods]! Item was removed: - ----- Method: DSClassRecord>>initializeFrom: (in category 'initialize-release') ----- - initializeFrom: aClass - super initializeFrom: aClass. - classInstVarNames := aClass class instVarNames. - comment := aClass organization classComment. - stamp := aClass organization commentStamp.! Item was removed: - ----- Method: DSSystemEditorMarker>>editor: (in category 'initialize-release') ----- - editor: aSystemEditor - - editor := aSystemEditor! Item was removed: - ----- Method: DSGroupedClassChange>>add: (in category 'accessing') ----- - add: aChange - aChange isMethodChange ifTrue: [^ self addMethodChange: aChange]. - ^ super add: aChange! Item was removed: - ----- Method: DSChangeCategorizer>>keys (in category 'accessing') ----- - keys - ^ self dictionary keys! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassVarsChanged: (in category 'class changes') ----- - applyClassVarsChanged: change - "Changed class vars, we ignore ordering as it is irrelevant - - they are actually kept in a Dictionary." - - | classEditor | - classEditor := self classEditorForChange: change. - change added do: [:each | classEditor addClassVarName: each]. - change removed do: [:each | classEditor removeClassVarName: each]! Item was removed: - ----- Method: DSClassRecord>>asAntiChange (in category 'anti') ----- - asAntiChange - ^ self copy! Item was removed: - ----- Method: DSMethodRecord>>asAntiChange (in category 'anti') ----- - asAntiChange - ^ self! Item was removed: - ----- Method: DSSystemEditorMarker>>ensureSharedPools: (in category 'private') ----- - ensureSharedPools: anArray - anArray do: [:name | Smalltalk at: name asSymbol ifAbsentPut: [Dictionary new]]! Item was removed: - ----- Method: DSGroupedClassChange>>groupsDo: (in category 'enumerating') ----- - groupsDo: aBlock - super groupsDo: aBlock. - self methodChanges groupsDo: aBlock. - self classMethodChanges groupsDo: aBlock! Item was removed: - ----- Method: DSSystemEditorMarker>>applyMethodRemoved: (in category 'method changes') ----- - applyMethodRemoved: change - "remove a method from a class. Does nothing if class does not exist." - - | classEditor | - classEditor := editor at: change className ifAbsent: [^ self]. - change isMeta ifTrue: [classEditor := classEditor class]. - classEditor removeSelector: change selector! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassRemoved: (in category 'class changes') ----- - applyClassRemoved: change - "Remove a class. Do nothing if it isn't there'" - - | classEditor | - classEditor := editor at: change className ifAbsent: [^ self]. - classEditor removeFromSystem! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassSuperclassChanged: (in category 'class changes') ----- - applyClassSuperclassChanged: change - "Changed a class superclass." - - (self classEditorForChange: change) - superclass: (editor at: change newSuperclassName ifAbsent: [editor at: #Object])! Item was removed: - ----- Method: DSSystemEditorMarker>>applySuperclassChanged: (in category 'class changes') ----- - applySuperclassChanged: change - "Change the superclass of a class." - - | classEditor superEditor | - classEditor := editor ensureClassNamed: change className. - superEditor := editor at: change newSuperclassName ifAbsent: [^ self]. - classEditor superclass: superEditor! Item was removed: - ----- Method: DSMethodRecord>>isRecord (in category 'testing') ----- - isRecord - ^ true! Item was removed: - ----- Method: DSSystemEditorMarker class>>on: (in category 'as yet unclassified') ----- - on: aSystemEditor - ^ self new editor: aSystemEditor ! Item was removed: - DSClassChange subclass: #DSClassRecord - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Deprecated'! - - !DSClassRecord commentStamp: 'mtf 9/12/2007 18:17' prior: 0! - My instances are responsible for storing the state of the class if there is no other change that can do that. For example, if the only change in a delta is an inst var change, there is no way to get the old class comment. In that case, a record would be logged prior to the inst var change so that the other class data is in the delta. This is not a change. - - A record can go in a Delta, and can be applied, but it should do nothing when applied, unless there is no other source available. So, it mostly serves as a marker in a stream of changes! Item was removed: - ----- Method: DSSystemEditorMarker>>applyMethodSourceChanged: (in category 'method changes') ----- - applyMethodSourceChanged: change - "Apply a method source change. If class or method is missing, create and categorize under default category." - - (self methodEditorForChange: change) - source: change newSource; - stamp: change newStamp! Item was removed: - ----- Method: DSChangeCategorizer>>add:classified: (in category 'accessing') ----- - add: aChange classified: aSymbol - (self at: aSymbol) add: aChange. - categorizer ifNotNil: [categorizer classify: aSymbol under: (self at: aSymbol) category]. - ^ aChange! Item was removed: - ----- Method: DSChangeCategorizer>>dictionary (in category 'accessing') ----- - dictionary - ^ dict ifNil: [dict := Dictionary new]! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassCommentChanged: (in category 'class changes') ----- - applyClassCommentChanged: change - "Changed a class comment." - - (self classEditorForChange: change) classComment: change newComment stamp: change newStamp! Item was removed: - ----- Method: DSSystemEditorMarker>>methodEditorForChange: (in category 'private') ----- - methodEditorForChange: aMethodChange - "answer the method editor for the change, creating a new, empty method if absent" - - | classEditor | - classEditor := self classEditorForChange: aMethodChange. - classEditor edMethodAt: aMethodChange selector ifAbsent: [classEditor - compile: aMethodChange selector nullMethodSource - classified: Categorizer default]. - ^ classEditor edMethodAt: aMethodChange selector! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassNameChanged: (in category 'class changes') ----- - applyClassNameChanged: change - "Changed a class name. If the old class does not exist, do nothing. If the new name already exists, the behavior is not implemented" - - (editor includesKey: change oldName) ifFalse: [^ self]. - (editor includesKey: change newName) ifTrue: [^ self error: 'Class rename conflict. See the comment in DSDeltaDirtyApplyTest>>testClassRenameConfict']. - (self classEditorForChange: change) rename: change newName.! Item was removed: - ----- Method: DSChangeCategorizer>>buildCategorizer (in category 'accessing') ----- - buildCategorizer - | aCategorizer | - aCategorizer := Categorizer defaultList: Array new. - self dictionary keysAndValuesDo: [:name :group | aCategorizer classify: name under: group category]. - ^ aCategorizer! Item was removed: - ----- Method: DSGroupedClassChange>>reverseDo: (in category 'enumerating') ----- - reverseDo: aBlock - self classMethodChanges reverseDo: aBlock. - self methodChanges reverseDo: aBlock. - super reverseDo: aBlock. - ! Item was removed: - ----- Method: DSClassRecord>>classInstVarChange (in category 'convenience') ----- - classInstVarChange - ^ DSClassInstVarsChange className: className - from: Array new - to: classInstVarNames! Item was removed: - ----- Method: DSSystemEditorMarker>>applyMethodSnapshot: (in category 'as yet unclassified') ----- - applyMethodSnapshot: snapshot - "Snapshots just record the old version; there is no new version. So, only apply them if there is nothing better." - (self classEditorForChange: snapshot) - edMethodAt: snapshot selector ifAbsent: [self applyMethodAdded: snapshot]! Item was removed: - ----- Method: DSChangeCategorizer>>at: (in category 'accessing') ----- - at: aSymbol - ^ self dictionary at: aSymbol ifAbsentPut: [defaultBlock value: aSymbol]! Item was removed: - ----- Method: DSClassRecord>>isChange (in category 'testing') ----- - isChange - ^ false! Item was removed: - ----- Method: DSMethodRecord>>isChange (in category 'testing') ----- - isChange - ^ false! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassInstVarsChanged: (in category 'class changes') ----- - applyClassInstVarsChanged: change - "Changed class instvars." - - | classEditor | - classEditor := self classEditorForChange: change. - change added do: [:each | classEditor addInstVarName: each]. - change removed do: [:each | classEditor removeInstVarName: each]. - change moved notEmpty ifTrue: [ - classEditor rearrangeInstVarNames: change movedWithIndices]! Item was removed: - ----- Method: DSGroupedClassChange>>addMethodChange: (in category 'private') ----- - addMethodChange: aChange - ^ (aChange isMeta - ifFalse: [self methodChanges] - ifTrue: [self classMethodChanges] - ) add: aChange! Item was removed: - ----- Method: DSGroupedClassChange>>methodChanges (in category 'accessing') ----- - methodChanges - ^ methodChanges ifNil: [methodChanges := DSChangeCategorizer forMethods]! Item was removed: - ----- Method: DSSystemEditorMarker>>applyMethodProtocolChanged: (in category 'method changes') ----- - applyMethodProtocolChanged: change - "Change the protocol of a method, Does nothing if either the class or the method don't exist'" - - (self methodEditorForChange: change) - category: change newProtocol! Item was removed: - ----- Method: DSSystemEditorMarker>>applyMethodAdded: (in category 'method changes') ----- - applyMethodAdded: change - "Add a method to the class." - - (self classEditorForChange: change) - compile: change source - classified: change protocol - withStamp: change stamp - notifying: nil - logSource: true! Item was removed: - DSCompositeClassChange subclass: #DSGroupedClassChange - instanceVariableNames: 'methodChanges classMethodChanges' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Deprecated'! - - !DSGroupedClassChange commentStamp: 'mtf 9/21/2007 12:55' prior: 0! - My instances represent changes made to a specific class, grouped by method for easy lookup. This is especially useful when browsing a delta - - I may be superceded by DSChangeCategorizer, but am still referenced. I may be removed in the future! Item was removed: - ----- Method: DSClassRecord>>isRecord (in category 'testing') ----- - isRecord - ^ true! Item was removed: - ----- Method: DSChangeCategorizer>>applyUsing: (in category 'applying') ----- - applyUsing: anApplier - anApplier applyCategorizedCompositeChange: self! Item was removed: - ----- Method: DSChangeCategorizer>>do: (in category 'enumerating') ----- - do: aBlock - self dictionary do: [:ea | ea do: aBlock]! Item was removed: - ----- Method: DSChangeCategorizer>>default:classify: (in category 'initialize-release') ----- - default: aDefaultBlock classify: aClassifyBlock - defaultBlock := aDefaultBlock. - classifyBlock := aClassifyBlock! Item was removed: - ----- Method: DSSystemEditorMarker>>classEditorForChange: (in category 'private') ----- - classEditorForChange: change - | classEditor | - classEditor := editor ensureClassNamed: change className. - ^ change isMeta - ifTrue: [classEditor class] - ifFalse: [classEditor].! Item was removed: - ----- Method: DSChangeCategorizer>>add: (in category 'accessing') ----- - add: aChange - self add: aChange classified: (classifyBlock value: aChange). - aChange isName ifTrue: [ - self dictionary at: aChange newName put: (self dictionary at: aChange oldName). - self dictionary removeKey: aChange oldName]. - ^ aChange - ! Item was removed: - ----- Method: DSMethodRecord>>isRevertable (in category 'testing') ----- - isRevertable - ^ false! Item was removed: - ----- Method: DSChangeCategorizer>>organization (in category 'accessing') ----- - organization - ^ categorizer ifNil: [categorizer := self buildCategorizer]! Item was removed: - ----- Method: DSChangeCategorizer class>>forClassesAndMethods (in category 'as yet unclassified') ----- - forClassesAndMethods - ^ self - default: [:aSymbol | DSGroupedClassChange new] - classify: [:aChange | aChange className]! Item was removed: - DSMethodChange subclass: #DSMethodRecord - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Deprecated'! - - !DSMethodRecord commentStamp: 'mtf 9/12/2007 18:16' prior: 0! - See the comment in DSClassRecord. My instances serve the same purpose, but for methods! Item was removed: - ----- Method: DSChangeCategorizer class>>forClasses (in category 'as yet unclassified') ----- - forClasses - ^ self - default: [:aSymbol | DSCompositeClassChange new] - classify: [:aChange | aChange className]! Item was removed: - DSMarker subclass: #DSSystemEditorMarker - instanceVariableNames: 'editor' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Deprecated'! - - !DSSystemEditorMarker commentStamp: '<historical>' prior: 0! - My instances add some flags to changes that pass through it, based on the system state maintained in the editor! Item was removed: - ----- Method: DSGroupedClassChange>>addChange: (in category 'accessing') ----- - addChange: aChange - aChange isMethodChange ifTrue: [^ self addMethodChange: aChange]. - ^ super addChange: aChange! Item was removed: - ----- Method: DSChangeCategorizer class>>default:classify: (in category 'as yet unclassified') ----- - default: aDefaultBlock classify: aClassifyBlock - ^ self new default: aDefaultBlock classify: aClassifyBlock! Item was removed: - DSCompositeChange subclass: #DSChangeCategorizer - instanceVariableNames: 'dict defaultBlock classifyBlock categorizer' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Deprecated'! - - !DSChangeCategorizer commentStamp: 'mtf 9/6/2007 23:57' prior: 0! - My instances automatically group the changes added to them. I implement the Categorizer protocol, so I can be used directly by Browser and friends.! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassCreated: (in category 'class changes') ----- - applyClassCreated: change - "Add a class." - - | classEditor superclassEditor | - self ensureSharedPools: change poolDictionaryNames. - superclassEditor := editor at: change superclassName ifAbsent: [editor at: #Object]. - classEditor := superclassEditor subclass: change className - instanceVariableNames: change instVarNames asSpaceString - classVariableNames: change classVarNames asSpaceString - poolDictionaries: change poolDictionaryNames asSpaceString - category: change category. - classEditor typeOfClass: change type! Item was removed: - ----- Method: DSSystemEditorMarker>>applySharedPoolVarsChanged: (in category 'class changes') ----- - applySharedPoolVarsChanged: change - "Changed shared pool vars. Currently we just raise error if missing!!" - - | classEditor | - self ensureSharedPools: change added. - classEditor := self classEditorForChange: change. - change added do: [:each | - classEditor addSharedPool: (classEditor system edResolve: each asSymbol ifAbsent:[ - self error: 'Pool variable ',each,' not found!!'])]. - change removed do: [:each | - classEditor removeSharedPool: (classEditor system edResolve: each asSymbol ifAbsent:[])]. - change moved notEmpty ifTrue: [ - classEditor rearrangeSharedPoolVarNames: change movedWithIndices]! Item was removed: - ----- Method: DSClassRecord>>applyUsing: (in category 'applying') ----- - applyUsing: anApplier - ^ anApplier applyClassSnapshot: self! Item was removed: - ----- Method: DSSystemEditorMarker>>applyClassCategoryChanged: (in category 'class changes') ----- - applyClassCategoryChanged: change - "Changed a class category." - - (self classEditorForChange: change) category: change newCategory! Item was removed: - ----- Method: DSMethodRecord>>applyUsing: (in category 'applying') ----- - applyUsing: anApplier - anApplier applyMethodSnapshot: self! Item was removed: - ----- Method: DSClassRecord>>commentChange (in category 'convenience') ----- - commentChange - ^ DSClassCommentChange className: className - from: '' - to: comment - oldStamp: '' - newStamp: stamp! Item was removed: - ----- Method: DSChangeCategorizer>>reverseDo: (in category 'enumerating') ----- - reverseDo: aBlock - self dictionary do: [:ea | ea reverseDo: aBlock]! Item was removed: - ----- Method: DSSystemEditorMarker>>applyInstVarsChanged: (in category 'class changes') ----- - applyInstVarsChanged: change - "Changed instvars." - - | classEditor | - classEditor := self classEditorForChange: change. - change added do: [:each | classEditor addInstVarName: each]. - change removed do: [:each | classEditor removeInstVarName: each]. - change moved notEmpty ifTrue: [ - classEditor rearrangeInstVarNames: change movedWithIndices]!
1
0
0
0
← Newer
1
2
3
4
Older →
Jump to page:
1
2
3
4
Results per page:
10
25
50
100
200