[ENH] Change List - Filter older versions

Gerardo Richarte core.lists.squeak at core-sdi.com
Thu Dec 28 18:30:01 UTC 2000


When maintaining a package across squeak updates you usually change
methods that then get changed on a new update. The task to keep your
changes up to date is hard... this may help a little: on a change list,
as opened from a file list/browse changes, you can remove all methods
with a timestamp newer than the current stamp for that same method. As a
result, you get a changelist with only those methods on the .cs file you
opened, that whould overwrite newer versions if filed in.

	Changed Bye!
	Richie++

Change Set:		filterOlderVersions
Date:			26 December 2000
Author:			MathMorphs

Added an option to change lists to filter all methods from a changeset that are older than the current (system) version.
Useful when you are maintaining a package across squeak updates
-------------- next part --------------
'From Squeak2.9alpha of 13 June 2000 [latest update: #3144] on 26 December 2000 at 10:58:53 pm'!
"Change Set:		filterOlderVersions
Date:			26 December 2000
Author:			MathMorphs

Added an option to change lists to filter all methods from a changeset that are older than the current (system) version.
Usefull when you are mantaining a package across squeak updates"!


!ChangeList methodsFor: 'menu actions' stamp: 'r++ 12/26/2000 22:20'!
changeListMenu: aMenu
	"Fill aMenu up so that it comprises the primary changelist-browser menu"

^ aMenu labels:
'fileIn selections
fileOut selections...
compare to current
toggle diffing
select conflicts with any changeset
select conflicts with current changeset
select conflicts with...
select unchanged methods
select methods for this class
select all
deselect all
browse current versions of selections
remove doIts
remove older versions
leave only older versions
remove selected items
remove unselected items'
	lines: #(2 4 6 9 11 12)
	selections: #(fileInSelections fileOutSelections
compareToCurrentVersion toggleDiffing selectAllConflicts  selectConflicts selectConflictsWith selectUnchangedMethods selectMethodsForThisClass  selectAll  deselectAll browseCurrentVersionsOfSelections
removeDoIts removeOlderMethodVersions leaveOlderThanSystem removeSelections removeNonSelections)

"select such that...   selectSuchThat"

! !

!ChangeList methodsFor: 'menu actions' stamp: 'r++ 12/26/2000 22:53'!
leaveOlderThanSystem
	"leave only those methods that are older than the current version"
	| class newChangeList newList sysStamp |
	newChangeList _ OrderedCollection new.
	newList _ OrderedCollection new.
	changeList with: list do: [:change :stamp |
		(class _ change methodClass) ifNotNil: [
			sysStamp _ Utilities timeStampForMethod:
				(class compiledMethodAt: change methodSelector ifAbsent: [CompiledMethod new]).
			sysStamp size > 0 ifTrue: [
				(Date fromMethodTimeStamp: (stamp copyAfter: $;)) <= (Date fromMethodTimeStamp: sysStamp)
					ifTrue: [
						newChangeList add: change.
						newList add: stamp]].
		]
	].
	newChangeList size < changeList size
		ifTrue:
			[changeList _ newChangeList.
			list _ newList.
			listIndex _ 0.
			listSelections _ Array new: list size withAll: false].

	self changed: #list! !


!Date class methodsFor: 'instance creation' stamp: 'r++ 12/26/2000 22:46'!
fromMethodTimeStamp: aString
	^ self readFrom: aString substrings second readStream
! !

ChangeList removeSelector: #leaveOnlyOlderThanSystem!


More information about the Squeak-dev mailing list