[Cuis-dev] Rename class not logging to user changes
Hernan Wilkinson
hernan.wilkinson at 10pines.com
Wed Dec 4 06:32:08 PST 2019
Thank you Eric!
I integrated it but when testing it I found that browser were not
refreshing correctly when renaming a class, so I added a few changes :-)
(well not a few really...)
Juan, could you take a look at it? Attached is the changes file.
You should also integrate the test changes Eric sent to
BaseImageTests.pck.st.
Cheers!
Hernan.
On Mon, Dec 2, 2019 at 12:06 AM Eric Brandwein <brandweineric at gmail.com>
wrote:
> Hi all,
> After a long while without doing anything about this, here's a ChangeSet
> that fixes this bug by adding in the user changes file the line `Smalltalk
> renameClassNamed: #OldClassName as: #NewClassName!` when a class is
> renamed, like it's currently being done when fliing out a ChangeSet. Any
> comments, as always, are very welcome.
>
> Cheers,
> Eric
>
> El vie., 5 jul. 2019 a las 14:02, Juan Vuletich via Cuis-dev (<
> cuis-dev at lists.cuis.st>) escribió:
>
>> Ok for class rename.
>>
>> BTW, just checked and in the current change set it gets recorded like:
>> Smalltalk renameClassNamed: #EllipseMorph as: #TheEllipseMorph
>>
>> But, if I rename ivar pointBlock in HandleMorph, and then file out
>> changes, I do get the detailed sequence.
>>
>>
>> On 7/5/2019 12:35 PM, Hernan Wilkinson wrote:
>>
>> recording the whole sequence is going to be more difficult because that
>> it is not what really happens... so those events should be "artificially"
>> created, and I think that for an automatic recovery of the image that is
>> the most used case for this, it is better just to add the "rename" event.
>> When recovering it will just rename the class and then apply the method
>> changes...
>>
>> On Fri, Jul 5, 2019 at 12:20 PM Juan Vuletich <juan at jvuletich.org> wrote:
>>
>>> Maybe they should be recorded both ways: as ClassRename and as sequence
>>> {ClassCreation. NewMethods. UpdateClassReferences. OldClassRemoval}. There
>>> are some reasons for wanting the sequence. One is to be able to re-apply
>>> changes, or not require to be in exactly the same state as when the change
>>> was created.
>>>
>>> If both ways are included, then the user of the file can decide what
>>> s(he) prefers.
>>>
>>> On 7/5/2019 10:11 AM, Hernan Wilkinson via Cuis-dev wrote:
>>>
>>> Hi Eric,
>>> yeap, class rename is not being logged ... a new type of change should
>>> be created for that. If fact, it would be great to record all type of
>>> refactorings as refactorings instead of only the changes composed by the
>>> refactoring.
>>>
>>> Regarding the new change record, it should be a class rename type, not
>>> a deletion and creation of the new one because that does not happen when
>>> doing a class rename.
>>> There is an important question to answer: when loading the change
>>> record, should it rename the references too or should only do it for those
>>> that are recorded? ... if all the changes are loaded then the later should
>>> be applied but if not? I think the best option is to only rename the class
>>> and then let the other changes change the reference. (I hope this is
>>> understandable :-) )
>>>
>>> Hernan.
>>>
>>> On Fri, Jul 5, 2019 at 2:04 AM Eric Brandwein via Cuis-dev <
>>> cuis-dev at lists.cuis.st> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Today Cuis broke because I was messing with Morphs, and I had to close
>>>> the image. Unfortunately, I hadn't saved my changes, so to recover them I
>>>> had to rely on the .user.changes file. I opened up the image again, and it
>>>> asked me to recover changes. I selected to automatically recover them, and
>>>> a strange error occurred: it told me that UndefinedObject didn't understand
>>>> #removeSelector:. Digging through the ChangeList, I noticed something: the
>>>> class renames were nowhere to be seen. So, what was happening is that there
>>>> were some ChangeListElements that removed selectors from classes that
>>>> didn't exist because they had the old names from before I renamed them.
>>>>
>>>> All this story is to point out that bug: the class rename isn't logging
>>>> to the changes file. And I'm not really sure how to solve it quickly and
>>>> cleanly; there isn't a ClassRenameChangeRecord class like there's a
>>>> ClassDeletionChangeRecord, so either there should be a new kind of
>>>> ChangeList record to log class renames or we should log the deletion of the
>>>> class and the subsequent adding of all the methods that were previously in
>>>> that class to the class with the new name. What do you think?
>>>>
>>>> Cheers,
>>>> Eric
>>>> --
>>>> Cuis-dev mailing list
>>>> Cuis-dev at lists.cuis.st
>>>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>>>
>>>
>>>
>>> --
>>>
>>> *Hernán Wilkinson Agile Software Development, Teaching & Coaching*
>>> *Phone: +54-011*-4893-2057
>>> *Twitter: @HernanWilkinson*
>>> *site: http://www.10Pines.com <http://www.10pines.com/>*
>>> Address: Alem 896, Floor 6, Buenos Aires, Argentina
>>>
>>>
>>>
>>> --
>>> Juan Vuletichwww.cuis-smalltalk.orghttps://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Devhttps://github.com/jvuletichhttps://www.linkedin.com/in/juan-vuletich-75611b3
>>> @JuanVuletich
>>>
>>>
>>
>> --
>>
>> *Hernán Wilkinson Agile Software Development, Teaching & Coaching*
>> *Phone: +54-011*-4893-2057
>> *Twitter: @HernanWilkinson*
>> *site: http://www.10Pines.com <http://www.10pines.com/>*
>> Address: Alem 896, Floor 6, Buenos Aires, Argentina
>>
>>
>>
>> --
>> Juan Vuletichwww.cuis-smalltalk.orghttps://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Devhttps://github.com/jvuletichhttps://www.linkedin.com/in/juan-vuletich-75611b3
>> @JuanVuletich
>>
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
--
*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191204/d00ebd31/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3963-RenameClassLogAndRefreshFix-HernanWilkinson-2019Dec03-16h25m-HAW.1.cs.st
Type: application/octet-stream
Size: 24953 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191204/d00ebd31/attachment-0001.obj>
More information about the Cuis-dev
mailing list