[squeak-dev] The Inbox: Monticello-nice.497.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 9 21:42:40 UTC 2012


A new version of Monticello was added to project The Inbox:
http://source.squeak.org/inbox/Monticello-nice.497.mcz

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

Name: Monticello-nice.497
Author: nice
Time: 9 March 2012, 10:42:27.071 pm
UUID: 8537ad03-c3e3-4bf6-b318-896c3efee5f7
Ancestors: Monticello-bf.496

Add a Monticello preference in order to #ignoreSourceCodeFormattingDifferences in method definitions.
This will affect the diff/merge behavior of Monticello.
When ignoring the differences, the diff is performed on the scanned tokens and _ := also compare equal.
It's generally a bad idea to ignore those diffs, but does really help when browsing diffs with distant cousins like Etoys or Pharo.

This preference must be considered as a quick hack.
A better idea would be to implement such filter in the Monticello UI, but this ain't gonna be as easy.

=============== Diff against Monticello-bf.496 ===============

Item was removed:
- SystemOrganization addCategory: #Monticello!
- SystemOrganization addCategory: #'Monticello-Base'!
- SystemOrganization addCategory: #'Monticello-Chunk Format'!
- SystemOrganization addCategory: #'Monticello-Loading'!
- SystemOrganization addCategory: #'Monticello-Merging'!
- SystemOrganization addCategory: #'Monticello-Modeling'!
- SystemOrganization addCategory: #'Monticello-Patching'!
- SystemOrganization addCategory: #'Monticello-Repositories'!
- SystemOrganization addCategory: #'Monticello-Storing'!
- SystemOrganization addCategory: #'Monticello-UI'!
- SystemOrganization addCategory: #'Monticello-Versioning'!
- SystemOrganization addCategory: #'Monticello-Mocks'!
- SystemOrganization addCategory: #'Monticello-Utilities'!

Item was added:
+ SystemOrganization addCategory: #'Monticello-Base'!
+ SystemOrganization addCategory: #'Monticello-Chunk Format'!
+ SystemOrganization addCategory: #'Monticello-Loading'!
+ SystemOrganization addCategory: #'Monticello-Merging'!
+ SystemOrganization addCategory: #'Monticello-Modeling'!
+ SystemOrganization addCategory: #'Monticello-Patching'!
+ SystemOrganization addCategory: #'Monticello-Repositories'!
+ SystemOrganization addCategory: #'Monticello-Storing'!
+ SystemOrganization addCategory: #'Monticello-UI'!
+ SystemOrganization addCategory: #'Monticello-Versioning'!

Item was changed:
  MCDefinition subclass: #MCMethodDefinition
  	instanceVariableNames: 'classIsMeta source category selector className timeStamp'
+ 	classVariableNames: 'IgnoreSourceCodeFormattingDifferences'
- 	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Monticello-Modeling'!
  MCMethodDefinition class
  	instanceVariableNames: 'definitions'!
  MCMethodDefinition class
  	instanceVariableNames: 'definitions'!

Item was added:
+ ----- Method: MCMethodDefinition class>>ignoreSourceCodeFormattingDifferences (in category 'preferences') -----
+ ignoreSourceCodeFormattingDifferences
+ 	"Accessor for the system-wide preference"
+ 	
+ 	<preference: 'Ignore source code formatting differences'
+ 		category: 'Monticello'
+ 		description: 'If enabled, the diff and merge tools will ignore formatting differences.'
+ 		type: #Boolean>
+ 	^IgnoreSourceCodeFormattingDifferences ifNil: [ false ]!

Item was added:
+ ----- Method: MCMethodDefinition class>>ignoreSourceCodeFormattingDifferences: (in category 'preferences') -----
+ ignoreSourceCodeFormattingDifferences: aBoolean
+ 	"Accessor for the system-wide preference"
+ 	
+ 	IgnoreSourceCodeFormattingDifferences := aBoolean!

Item was changed:
  ----- Method: MCMethodDefinition>>= (in category 'comparing') -----
  = aDefinition
+ 	IgnoreSourceCodeFormattingDifferences ifTrue: [
+ 		^(super = aDefinition)
+ 			and: [| t1 t2 |
+ 				t1 := Scanner new scanTokens: aDefinition source.
+ 				t2 := Scanner new scanTokens: self source.
+ 				t1 size = t2 size and: [(1 to: t1 size) allSatisfy: [:i |
+ 							(t1 at: i) = (t2 at: i)
+ 								or: [#( #( #'_' #':=') #( #':=' #'_')) includes: {t1 at: i. t2 at: i} ]]]]].
  	^(super = aDefinition)
  		and: [aDefinition source = self source
  		and: [aDefinition category = self category
  		and: [aDefinition timeStamp = self timeStamp]]]!



More information about the Squeak-dev mailing list