ChangeSet.st
changeset 4527 8192557abebb
parent 4522 37e5eff0f375
child 4531 6261c07996fb
equal deleted inserted replaced
4526:f87aa4714f76 4527:8192557abebb
  1928      (i.e. leave changes for other classes)."
  1928      (i.e. leave changes for other classes)."
  1929 
  1929 
  1930     self condenseChangesForClass:aClass package:nil
  1930     self condenseChangesForClass:aClass package:nil
  1931 !
  1931 !
  1932 
  1932 
  1933 condenseChangesForClass:aClass package:aPackageSymbol
  1933 condenseChangesForClass:aClass package:aPackageSymbolOrNil
  1934     "remove all changes for aClass (and its metaclass) and aPackageSymbol
  1934     "remove all changes for aClass (and its metaclass) and aPackageSymbol
  1935      (i.e. leave methodChanges for other packages).
  1935      (i.e. leave methodChanges for other packages).
  1936      This is invoked when a class is checked into the repository."
  1936      This is invoked when a class is checked into the repository."
  1937 
  1937 
  1938     self condenseChangesForClass:aClass selector:nil package:aPackageSymbol
  1938     self condenseChangesForClass:aClass selector:nil package:aPackageSymbolOrNil
  1939 
  1939 
  1940     "Modified: / 5.11.2001 / 14:29:22 / cg"
  1940     "Modified: / 5.11.2001 / 14:29:22 / cg"
  1941 !
  1941 !
  1942 
  1942 
  1943 condenseChangesForClass:aClass selector:aSelector
  1943 condenseChangesForClass:aClass selector:aSelector
  1946     self condenseChangesForClass:aClass selector:aSelector package:nil
  1946     self condenseChangesForClass:aClass selector:aSelector package:nil
  1947 
  1947 
  1948     "Created: / 26-09-2006 / 17:22:59 / cg"
  1948     "Created: / 26-09-2006 / 17:22:59 / cg"
  1949 !
  1949 !
  1950 
  1950 
  1951 condenseChangesForClass:aClass selector:selectorOrNil package:aPackageSymbol
  1951 condenseChangesForClass:aClass selector:selectorOrNil package:aPackageSymbolOrNil
  1952     "remove all changes for aClass/selector and aPackageSymbol
  1952     "remove all changes for aClass/selector and aPackageSymbol
  1953      (i.e. leave methodChanges for other packages).
  1953      (i.e. leave methodChanges for other packages).
  1954      If selectorOrNil is nil, all changes for that class (or metaclass) are removed;
  1954      If selectorOrNil is nil, all changes for that class (or metaclass) are removed;
  1955      otherwise, only changes for the given selector.
  1955      otherwise, only changes for the given selector.
  1956      This is invoked when a class is checked into the repository."
  1956      This is invoked when a class is checked into the repository."
  1959 
  1959 
  1960     className := aClass theNonMetaclass name.
  1960     className := aClass theNonMetaclass name.
  1961     metaClassName := aClass theMetaclass name.
  1961     metaClassName := aClass theMetaclass name.
  1962 
  1962 
  1963     changesToRemove :=
  1963     changesToRemove :=
  1964 	self select:[:aChange |
  1964         self select:[:aChange |
  1965 	    |chgClassName chgClass removeThis mClass mthd|
  1965             |chgClassName chgClass removeThis mClass mthd|
  1966 
  1966 
  1967 	    removeThis := false.
  1967             removeThis := false.
  1968 	    chgClassName := aChange className.
  1968             chgClassName := aChange fullClassName "className".
  1969 	    (chgClassName = className or:[chgClassName = metaClassName]) ifTrue:[
  1969 
  1970 		removeThis := true
  1970             (chgClassName = className or:[chgClassName = metaClassName]) ifTrue:[
  1971 	    ] ifFalse:[
  1971                 removeThis := true
  1972 		chgCls := aChange changeClass.
  1972             ] ifFalse:[
  1973 		chgCls isNil ifTrue:[
  1973                 chgCls := aChange changeClass.
  1974 		    (chgClassName startsWith:(aClass name,':')) ifTrue:[
  1974                 chgCls isNil ifTrue:[
  1975 			"a change for a private class of a no-longer present one..."
  1975                     (chgClassName startsWith:(aClass name,':')) ifTrue:[
  1976 			    removeThis := true
  1976                         "a change for a private class of a no-longer present one..."
  1977 		    ].
  1977                             removeThis := true
  1978 		].
  1978                     ].
  1979 
  1979                 ].
  1980 		(chgCls notNil
  1980 
  1981 		and:[chgCls isPrivate
  1981                 (chgCls notNil
  1982 		and:[chgCls topOwningClass == aClass]]) ifTrue:[
  1982                 and:[chgCls isPrivate
  1983 		    removeThis := true
  1983                 and:[chgCls topOwningClass == aClass]]) ifTrue:[
  1984 		]
  1984                     removeThis := true
  1985 	    ].
  1985                 ]
  1986 	    selectorOrNil notNil ifTrue:[
  1986             ].
  1987 		(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifFalse:[
  1987             selectorOrNil notNil ifTrue:[
  1988 		    removeThis := false.
  1988                 (aChange isMethodChange or:[aChange isMethodRemoveChange]) ifFalse:[
  1989 		] ifTrue:[
  1989                     removeThis := false.
  1990 		    aChange selector = selectorOrNil ifFalse:[
  1990                 ] ifTrue:[
  1991 			removeThis := false.
  1991                     aChange selector = selectorOrNil ifFalse:[
  1992 		    ].
  1992                         removeThis := false.
  1993 		]
  1993                     ].
  1994 	    ].
  1994                 ]
  1995 
  1995             ].
  1996 	    removeThis ifTrue:[
  1996 
  1997 		aChange isMethodChange ifTrue:[
  1997             removeThis ifTrue:[
  1998 		    mClass := aChange changeClass.
  1998                 aChange isMethodChange ifTrue:[
  1999 		    mClass notNil ifTrue:[
  1999                     mClass := aChange changeClass.
  2000 			mthd := mClass compiledMethodAt:(aChange selector).
  2000                     mClass notNil ifTrue:[
  2001 			mthd isNil ifTrue:[
  2001                         mthd := mClass compiledMethodAt:(aChange selector).
  2002 			    "/ mthd does no longer exist
  2002                         mthd isNil ifTrue:[
  2003 			    "/ I no longer understand what this was meant for .. (sigh)
  2003                             "/ mthd does no longer exist
  2004 			    "/                        aPackageSymbol notNil ifTrue:[
  2004                             "/ I no longer understand what this was meant for .. (sigh)
  2005 			    "/                            removeThis := false
  2005                             "/                        aPackageSymbol notNil ifTrue:[
  2006 			    "/                        ]
  2006                             "/                            removeThis := false
  2007 			] ifFalse:[
  2007                             "/                        ]
  2008 			    (aPackageSymbol notNil and:[mthd package ~= aPackageSymbol]) ifTrue:[
  2008                         ] ifFalse:[
  2009 				removeThis := false
  2009                             (aPackageSymbolOrNil notNil and:[mthd package ~= aPackageSymbolOrNil]) ifTrue:[
  2010 			    ]
  2010                                 removeThis := false
  2011 			]
  2011                             ]
  2012 		    ]
  2012                         ]
  2013 		].
  2013                     ]
  2014 	    ].
  2014                 ].
  2015 	    removeThis
  2015             ].
  2016 	].
  2016             removeThis
       
  2017         ].
  2017 
  2018 
  2018     self condenseChanges:changesToRemove
  2019     self condenseChanges:changesToRemove
  2019 
  2020 
  2020     "Modified: / 12-10-2006 / 16:51:38 / cg"
  2021     "Modified: / 12-10-2006 / 16:51:38 / cg"
  2021 !
  2022 !