[Pkg] The Trunk: System-eem.787.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 20 21:47:51 UTC 2016

Eliot Miranda uploaded a new version of System to project The Trunk:

==================== Summary ====================

Name: System-eem.787
Author: eem
Time: 20 January 2016, 1:47:21.381067 pm
UUID: 14aec38e-df6c-4751-9bb8-fa68dffb16e5
Ancestors: System-tpr.786

When triming change set history, nuke changes for methods that can't be found as well as those that have been added then removed.

Add some robustness to parsing class names in class definitions in ChangeRecord.

=============== Diff against System-tpr.786 ===============

Item was changed:
  ----- Method: ChangeRecord>>methodClassName (in category 'access') -----
  	| tokens |
  	(class isNil
  	and: [type = #doIt
+ 	and: [([(tokens := Scanner new scanTokens: self text) size >= 3]
+ 			on: Error do: [:ex| false])
- 	and: [(tokens := Scanner new scanTokens: self text) size >= 3
  	and: [(tokens includes: #'.') not "exclude multi-statement doits"
  	and: [tokens first isSymbol
  	and: [tokens first isKeyword not
  	and: [tokens first first canBeGlobalVarInitial
  	and: [(tokens includes: #instanceVariableNames:)
  		or: [tokens second == #comment:
  		or: [tokens third == #comment:]]]]]]]]]) ifTrue:
  		["Could be a class definition.
  			Class definitions start with Superclass blahSubclass: #ClassName
  			Metaclass definitions start with ClassName class instanceVariableNames:"
  		 (tokens second isSymbol
  		  and: [tokens second isKeyword
  		  and: [tokens third isSymbol
  		  and: [tokens third isKeyword not
  		  and: [(2 to: tokens size by: 2) allSatisfy: [:i| (tokens at: i) isKeyword]]]]]) ifTrue:
  			[^tokens third].
  		 (tokens size = 4
  		  and: [tokens second = #class
  		  and: [(tokens third = #instanceVariableNames: or: [tokens third = #comment:])
  		  and: [tokens last isString]]]) ifTrue:
  			[^tokens first].
  		 (tokens size = 3
  		  and: [tokens second = #comment:
  		  and: [tokens last isString]]) ifTrue:
  			[^tokens first]].

Item was changed:
  ----- Method: ClassChangeRecord>>trimHistory (in category 'all changes') -----
  	"Drop non-essential history."
+ 	| realClass |
+ 	realClass := self realClass.
  	"Forget methods added and later removed"
  	methodChanges keysAndValuesRemove:
+ 		[:sel :chgRecord |
+ 		chgRecord changeType == #addedThenRemoved
+ 		"this removes methods that have been lost, e.g. by being deleted in a different change set, etc"
+ 		or: [(chgRecord changeType == #add or: [chgRecord changeType == #change])
+ 			and: [realClass isNil or: [(realClass includesSelector: sel) not]]]].
- 		[:sel :chgRecord | chgRecord changeType == #addedThenRemoved].
  	"Forget renaming and reorganization of newly-added classes."
  	(changeTypes includes: #add) ifTrue:
+ 		[changeTypes removeAllFoundIn: #(rename reorganize)]!
- 		[changeTypes removeAllFoundIn: #(rename reorganize)].
- !

More information about the Packages mailing list