Re: The Trunk: System-eem.345.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-eem.345.mcz

Nicolas Cellier
Great!
How did people ever worked with change lists without this ?
There might be interesting related features to pick in Cuis too.

Nicolas

2010/6/30  <[hidden email]>:

> Eliot Miranda uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-eem.345.mcz
>
> ==================== Summary ====================
>
> Name: System-eem.345
> Author: eem
> Time: 29 June 2010, 5:48:20.596 pm
> UUID: 1ba583d2-9788-4bfd-b1d5-9b88c7769cd2
> Ancestors: System-tbn.344
>
> Changes to ChangeRecord to support remove unchanged
> definitions and file-in reorganizations in the ChangeList.
>
> =============== Diff against System-tbn.344 ===============
>
> Item was added:
> + ----- Method: ChangeRecord>>commentClass (in category 'access') -----
> + commentClass
> +       | commentClass |
> +       type == #classComment ifFalse: [^ nil].
> +       (Smalltalk includesKey: class asSymbol) ifFalse: [^ nil].
> +       commentClass := Smalltalk at: class asSymbol.
> +       ^meta ifTrue: [commentClass class]
> +               ifFalse: [commentClass]!
>
> Item was changed:
>  ----- Method: ChangeRecord>>methodClassName (in category 'access') -----
>  methodClassName
> +       | text tokens |
> +       (class isNil
> +       and: [type = #doIt
> +       and: [((text := self text) includes: $.) not "exclude multi-statement doits"
> +       and: [(tokens := Scanner new scanTokens: text) size >= 4
> +       and: [tokens first isSymbol
> +       and: [tokens first isKeyword not
> +       and: [tokens first first canBeGlobalVarInitial
> +       and: [tokens includes: #instanceVariableNames:]]]]]]]) 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:
> +                 and: [tokens last isString]]]) ifTrue:
> +                       [^tokens first]].
>        ^class!
>
> Item was changed:
>  ----- Method: ChangeRecord>>fileIn (in category 'initialization') -----
>  fileIn
> +       "File the receiver in.  If I represent a method or a class-comment, file the method in and make a note of it in the recent-submissions list; if I represent a do-it, then, well, do it; if I represent a reorganization then get organized!!"
> -       "File the receiver in.  If I represent a method or a class-comment, file the method in and make a note of it in the recent-submissions list; if I represent a do-it, then, well, do it."
>
>        Cursor read showWhile:
> +               [| s cls aSelector |
> +               type == #doIt
> +                       ifTrue:
> +                               [((s := self string) beginsWith: '----') ifFalse: [Compiler evaluate: s]]
> +                       ifFalse:
> +                               [cls := Smalltalk at: class asSymbol.
> +                                cls := meta ifTrue: [cls class] ifFalse: [cls].
> +                                type == #method ifTrue:
> +                                       [cls compile: self text classified: category withStamp: stamp notifying: nil.
> +                                       (aSelector := self methodSelector) ifNotNil:
> +                                               [Utilities noteMethodSubmission: aSelector forClass: cls]].
> +                                type == #classComment ifTrue:
> +                                       [cls comment: self text stamp: stamp.
> +                                       Utilities noteMethodSubmission: #Comment forClass: cls ].
> +                                type == #reorganize ifTrue:
> +                                       [cls organization changeFromString: self text]]]!
> -               [| methodClass s aSelector |
> -               (methodClass := self methodClass) notNil ifTrue:
> -                       [methodClass compile: self text classified: category withStamp: stamp notifying: nil.
> -                       (aSelector := self methodSelector) ifNotNil:
> -                               [Utilities noteMethodSubmission: aSelector forClass: methodClass]].
> -               (type == #doIt) ifTrue:
> -                       [((s := self string) beginsWith: '----') ifFalse: [Compiler evaluate: s]].
> -               (type == #classComment) ifTrue:
> -                       [ | cls | (cls := Smalltalk at: class asSymbol) comment: self text stamp: stamp.
> -                       Utilities noteMethodSubmission: #Comment forClass: cls ]]!
>
> Item was changed:
>  ----- Method: ChangeRecord>>fileIndex (in category 'access') -----
>  fileIndex
> +       SourceFiles withIndexDo: [:sf :i| sf name = file name ifTrue: [^i]].
> +       ^nil!
> -       ^ (SourceFiles collect: [ :sf | sf name])
> -               indexOf: file name ifAbsent: [^ nil].
> - !
>
>
>