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

Chris Muller asqueaker at gmail.com
Wed Mar 14 17:10:57 UTC 2012


Catching up on mailing list.

Nicolas, a couple of questions -- I believe the "diffsWithPrettyPrint"
takes care of this already doesn't it?

If not, why have variable names like "t1" as if it were decompiled
code rather than type-suggesting / intention-revealing names?

Thanks..

On Fri, Mar 9, 2012 at 4:17 PM,  <commits at source.squeak.org> wrote:
> A new version of Monticello was added to project The Inbox:
> http://source.squeak.org/inbox/Monticello-nice.498.mcz
>
> ==================== Summary ====================
>
> Name: Monticello-nice.498
> Author: nice
> Time: 9 March 2012, 11:17:06.384 pm
> UUID: 395becce-f60f-4242-a937-d1fc6ab4f462
> 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.
>
> Bis and don't forget hash this time...
>
> =============== 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 tokens'
> +       classVariableNames: 'IgnoreSourceCodeFormattingDifferences'
> -       instanceVariableNames: 'classIsMeta source category selector className timeStamp'
> -       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') -----
> + = t1
> +       self class ignoreSourceCodeFormattingDifferences
> +               ifTrue: [^ super = t1
> +                               and: [t1 tokens = self tokens]].
> +       ^ super = t1
> +               and: [t1 source = self source
> +                               and: [t1 category = self category
> +                                               and: [t1 timeStamp = self timeStamp]]]!
> - = aDefinition
> -       ^(super = aDefinition)
> -               and: [aDefinition source = self source
> -               and: [aDefinition category = self category
> -               and: [aDefinition timeStamp = self timeStamp]]]!
>
> Item was changed:
>  ----- Method: MCMethodDefinition>>hash (in category 'comparing') -----
>  hash
> +       | t1 |
> +       self class ignoreSourceCodeFormattingDifferences
> +               ifTrue: [t1 := classIsMeta asString hashWithInitialHash: self tokens hash.
> +                       t1 := className hashWithInitialHash: t1.
> +                       ^ t1].
> +       t1 := classIsMeta asString hashWithInitialHash: 0.
> +       t1 := source hashWithInitialHash: t1.
> +       t1 := category hashWithInitialHash: t1.
> +       t1 := className hashWithInitialHash: t1.
> +       ^ t1!
> -       | hash |
> -       hash := classIsMeta asString hashWithInitialHash: 0.
> -       hash := source hashWithInitialHash: hash.
> -       hash := category hashWithInitialHash: hash.
> -       hash := className hashWithInitialHash: hash.
> -       ^ hash!
>
> Item was changed:
>  ----- Method: MCMethodDefinition>>initializeWithClassName:classIsMeta:selector:category:timeStamp:source: (in category 'serializing') -----
>  initializeWithClassName: classString
>  classIsMeta: metaBoolean
>  selector: selectorString
>  category: catString
>  timeStamp: timeString
>  source: sourceString
>        className := classString asSymbol.
>        selector := selectorString asSymbol.
>        category := catString asSymbol.
>        timeStamp := timeString.
>        classIsMeta := metaBoolean.
>        source := sourceString withSqueakLineEndings.
> +       tokens := nil
>  !
>
> Item was added:
> + ----- Method: MCMethodDefinition>>tokens (in category 'accessing') -----
> + tokens
> +       ^tokens ifNil: [tokens := (Scanner new scanTokens: self source) replaceAll: #'_' with: #':=']!
>
>


More information about the Squeak-dev mailing list