Issue 4603 in pharo: MC removal should happen after the definition of new entities

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

Issue 4603 in pharo: MC removal should happen after the definition of new entities

pharo
Status: Accepted
Owner: [hidden email]
Labels: Milestone-1.4

New issue 4603 by [hidden email]: MC removal should happen after the  
definition of new entities
http://code.google.com/p/pharo/issues/detail?id=4603

In Squeak trunk it would work because removals are performed AFTER
methodAdditions/Changes.
In Pharo, removals are performed BEFORE


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4603 in pharo: MC removal should happen after the definition of new entities

pharo
Updates:
        Cc: [hidden email]

Comment #1 on issue 4603 by [hidden email]: MC removal should happen  
after the definition of new entities
http://code.google.com/p/pharo/issues/detail?id=4603

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4603 in pharo: MC removal should happen after the definition of new entities

pharo

Comment #2 on issue 4603 by [hidden email]: MC removal should happen  
after the definition of new entities
http://code.google.com/p/pharo/issues/detail?id=4603

basicLoad
        "Load the contents of some package. This is the core loading method
        in Monticello. Be wary about modifying it unless you understand the details
        and dependencies of the various entities being modified."
        | pkgName |
        errorDefinitions := OrderedCollection new.
        "Obviously this isn't the package name but we don't have anything else
        to use here. ChangeSet current name will generally work since a CS is
        usually installed prior to installation."
        pkgName := ChangeSet current name.

        [["Pass 1: Load everything but the methods,  which are collected in  
methodAdditions."
        additions do: [:ea |
                ea isMethodDefinition
                        ifTrue:[methodAdditions add: ea asMethodAddition]
                        ifFalse:[[ea load]on: Error do: [errorDefinitions add: ea]].
        ] displayingProgress: 'Reshaping ', pkgName.

        "Try again any delayed definitions"
        self shouldWarnAboutErrors ifTrue: [self warnAboutErrors].
        errorDefinitions do: [:ea | ea load]
                displayingProgress: 'Reloading ', pkgName.

        "Pass 2: We compile new / changed methods"
        methodAdditions do:[:ea| ea createCompiledMethod]
                displayingProgress: 'Compiling ', pkgName.

        'Installing ', pkgName displayProgressAt: Sensor cursorPoint from: 0 to: 2  
during:[:bar|
                "There is no progress *during* installation since a progress bar update
                will redraw the world and potentially call methods that we're just trying  
to install."
                bar value: 1.

                "Pass 3: Install the new / changed methods
                (this is a separate pass to allow compiler changes to be loaded)"
                methodAdditions do:[:ea| ea installMethod].

                "Pass 4: Remove the obsolete methods"
                removals do:[:ea| ea unload].
        ].

        "Finally, notify observers for the method additions"
        methodAdditions do: [:each | each notifyObservers]
                "the message is fake but actually telling people how much time we spend
                in the notifications is embarrassing so lie instead"
                displayingProgress: 'Installing ', pkgName.

        additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]
                displayingProgress: 'Initializing ', pkgName.

        ] on: InMidstOfFileinNotification do: [:n | n resume: true]
        ] ensure: [self flushChangesFile]


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4603 in pharo: MC removal should happen after the definition of new entities

pharo

Comment #3 on issue 4603 by [hidden email]: MC removal should happen  
after the definition of new entities
http://code.google.com/p/pharo/issues/detail?id=4603

in pharo we have

basicLoad
        errorDefinitions := OrderedCollection new.
        [[
       
        "FIXME. Do a separate pass on loading class definitions as the very first  
thing.
        This is a workaround for a problem with the so-called 'atomic' loading  
(you wish!)
        which isn't atomic at all but mixes compilation of methods with reshapes  
of classes.

        Since the method is not installed until later, any class reshape in the  
middle *will*
        affect methods in subclasses that have been compiled before. There is  
probably
        a better way of dealing with this by ensuring that the sort order of the  
definition lists
        superclass definitions before methods for subclasses but I need this NOW,  
and adding
        an extra pass ensures that methods are compiled against their new class  
definitions."

        additions do: [:ea | self loadClassDefinition: ea]  
displayingProgress: 'Loading classes...'.
       
        additions do: [:ea | self tryToLoad: ea] displayingProgress: 'Compiling  
methods...'.
        removals do: [:ea | ea unload] displayingProgress: 'Cleaning up...'.
        self shouldWarnAboutErrors ifTrue: [self warnAboutErrors].
        errorDefinitions do: [:ea | ea addMethodAdditionTo: methodAdditions]  
displayingProgress: 'Reloading...'.
        methodAdditions do: [:each | each installMethod].
        methodAdditions do: [:each | each notifyObservers].
        additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]  
displayingProgress: 'Initializing...']
                on: InMidstOfFileinNotification
                do: [:n | n resume: true]]
                        ensure: [self flushChangesFile]


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4603 in pharo: MC removal should happen after the definition of new entities

pharo
Updates:
        Labels: Type-Bug

Comment #4 on issue 4603 by [hidden email]: MC removal should happen  
after the definition of new entities
http://code.google.com/p/pharo/issues/detail?id=4603

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4603 in pharo: MC removal should happen after the definition of new entities

pharo
Updates:
        Labels: -Milestone-1.4

Comment #5 on issue 4603 by [hidden email]: MC removal should happen  
after the definition of new entities
http://code.google.com/p/pharo/issues/detail?id=4603

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4603 in pharo: MC removal should happen after the definition of new entities

pharo
Updates:
        Labels: Milestone-3.0

Comment #6 on issue 4603 by [hidden email]: MC removal should happen  
after the definition of new entities
http://code.google.com/p/pharo/issues/detail?id=4603

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker