[Pharo-dev] Merging refactoring changes

Peter Uhnák i.uhnak at gmail.com
Sat Apr 16 14:53:13 EDT 2016


Is it possible to merge changesets?

For example when I am creating a new class and adding a new instance
variable, I would like to see it as one change set, not two.

Similarly if I am overriding a method twice, it would be good to see only
what actually gets applied.

For example

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"
Sandbox removeFromSystem.
"
(model := RBNamespace new)
name: 'ChangeSet'.

r1 := RBAddClassRefactoring
model: model
addClass: #Sandbox superclass: Object subclasses: #() category: #Sandbox.
r1 primitiveExecute.

r2 := RBAddInstanceVariableRefactoring
model: model
variable: 'attr'
class: #Sandbox.
r2 primitiveExecute.

r3 := RBAddMethodRefactoring
model: model
addMethod: 'attr' toClass: #Sandbox inProtocols: 'accessing'.
r3 transform.

r4 := RBAddMethodRefactoring
model: model
addMethod: 'attr
^ attr' toClass: #Sandbox inProtocols: 'accessing'.
r4 transform.

(ChangesBrowser changes: model changes changes) open.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I will get four changes


​
But the second (top right) could be merged into the first one, and the
third one (bottom left) is superfluous.

So ideally I would like to have


​

Is it possible to merge it in such a way?

Thanks,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20160416/8081a224/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changes-1.png
Type: image/png
Size: 70495 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20160416/8081a224/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changes-2.png
Type: image/png
Size: 36178 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20160416/8081a224/attachment-0001.png>


More information about the Pharo-dev mailing list