ChangseSet::DiffSet now remembers the changes same in both... jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 20 Mar 2012 12:34:31 +0000
branchjv
changeset 3032 f8b04203694b
parent 3031 66f3216e3ea5
child 3033 8964521a2c1b
ChangseSet::DiffSet now remembers the changes same in both...
ChangeSet.st
ChangeSetDiff.st
--- a/ChangeSet.st	Mon Mar 19 20:13:30 2012 +0000
+++ b/ChangeSet.st	Tue Mar 20 12:34:31 2012 +0000
@@ -49,7 +49,7 @@
 !
 
 Object subclass:#DiffSet
-	instanceVariableNames:'changed onlyInReceiver onlyInArg'
+	instanceVariableNames:'changed onlyInReceiver onlyInArg same'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:ChangeSet
@@ -1613,13 +1613,14 @@
         changing methodChanges into categoryChanges"
 
     |otherChangeIndicesBySelector otherNonMethodChangeIndices changeIndicesBySelector nonMethodChangeIndices
-     onlyInReceiver onlyInArg changedMethods
+     onlyInReceiver onlyInArg changedMethods same
      indexFromChangedMethodsToA indexFromChangedMethodsToB
      "info" ret|
 
     onlyInReceiver := ChangeSet new.
     onlyInArg      := ChangeSet new.
     changedMethods := ChangeSet new.
+    same           := ChangeSet new.
 
     indexFromChangedMethodsToA := OrderedCollection new.
     indexFromChangedMethodsToB := OrderedCollection new.
@@ -1697,6 +1698,8 @@
 
         anyFound ifFalse:[
             onlyInReceiver add:aChangeInA.
+        ] ifTrue:[
+            same add: aChangeInA.
         ]
     ].
 
@@ -1775,12 +1778,14 @@
     ret := DiffSet new
                 changed:changedMethods
                 onlyInReceiver:onlyInReceiver
-                onlyInArg:onlyInArg.
+                onlyInArg:onlyInArg
+                same: same.
 "/    ret info:info.
     ^ret
 
     "Modified: / 12-10-2006 / 22:22:39 / cg"
     "Modified (comment): / 01-12-2011 / 19:12:55 / cg"
+    "Modified: / 19-03-2012 / 21:36:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 diffSetsAgainstImage
@@ -3297,6 +3302,24 @@
     onlyInArg isNil ifTrue:[onlyInArg := ChangeSet new].
 !
 
+changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg same: sameArg
+    "set instance variables (automatically generated)"
+
+    changed := changedArg.
+    changed isNil ifTrue:[changed := OrderedCollection new].
+
+    onlyInReceiver := onlyInReceiverArg.
+    onlyInReceiver isNil ifTrue:[onlyInReceiver := ChangeSet new].
+
+    onlyInArg := onlyInArgArg.
+    onlyInArg isNil ifTrue:[onlyInArg := ChangeSet new].
+
+    same := sameArg.
+    same isNil ifTrue:[same := ChangeSet new].
+
+    "Created: / 19-03-2012 / 21:35:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 onlyInArg
     "return the set of methods which were only present in the argument of the diffset"
 
@@ -3319,6 +3342,14 @@
 
 onlyInReceiver:something
     onlyInReceiver := something.
+!
+
+same
+    ^ same
+!
+
+same:something
+    same := something.
 ! !
 
 !ChangeSet::DiffSet methodsFor:'merging'!
@@ -3327,8 +3358,10 @@
     changed addAll:(anotherDiffset changed).
     onlyInReceiver addAll:(anotherDiffset onlyInReceiver).
     onlyInArg addAll:(anotherDiffset onlyInArg).
+    same addAll: (anotherDiffset same).
 
     "Created: / 12-10-2006 / 22:49:30 / cg"
+    "Modified: / 19-03-2012 / 21:36:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 copy
@@ -3336,8 +3369,10 @@
         changed:changed copy
         onlyInReceiver:onlyInReceiver copy
         onlyInArg:onlyInArg copy
+        same:same copy
 
     "Created: / 12-10-2006 / 22:50:56 / cg"
+    "Modified: / 19-03-2012 / 21:36:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSet::DiffSet methodsFor:'misc'!
@@ -3632,5 +3667,5 @@
 !
 
 version_SVN
-    ^ '$Id: ChangeSet.st 1897 2012-03-19 20:13:30Z vranyj1 $'
+    ^ '$Id: ChangeSet.st 1898 2012-03-20 12:34:31Z vranyj1 $'
 ! !
--- a/ChangeSetDiff.st	Mon Mar 19 20:13:30 2012 +0000
+++ b/ChangeSetDiff.st	Tue Mar 20 12:34:31 2012 +0000
@@ -27,7 +27,7 @@
 "{ Package: 'stx:libbasic3' }"
 
 Object subclass:#ChangeSetDiff
-	instanceVariableNames:'diffset'
+	instanceVariableNames:'diffset same'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'System-Changes-Diff'
@@ -93,6 +93,10 @@
 
 diffset
     ^ diffset
+!
+
+same
+    ^ same
 ! !
 
 !ChangeSetDiff methodsFor:'diffing'!
@@ -110,9 +114,11 @@
 
     diffsByClass := Dictionary new.
     ds := a diffSetsAgainst:b.
+    same := ds same.
+
     include := [:chg | 
-            (AbstractSourceCodeManager isVersionMethodSelector:chg selector) not
-        ].
+            true"(AbstractSourceCodeManager isVersionMethodSelector:chg selector) not"
+    ].
     ds onlyInReceiver do:[:chg | 
         (include value:chg) ifTrue:[
             (diffsByClass at:(chg nonMetaClassName isNil ifTrue:[
@@ -171,7 +177,7 @@
 
     "Created: / 02-11-2009 / 16:17:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 29-06-2011 / 08:22:49 / Jan Vrany <enter your email here>"
-    "Modified (format): / 29-11-2011 / 14:11:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-03-2012 / 11:50:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetDiff methodsFor:'initialization'!
@@ -181,10 +187,11 @@
 
     "/ please change as required (and remove this comment)
     diffset := ChangeSetDiffSet new.
+    same := ChangeSet new.
 
     "/ super initialize.   -- commented since inherited method does nothing
 
-    "Modified: / 06-07-2011 / 13:00:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-03-2012 / 21:51:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetDiff class methodsFor:'documentation'!
@@ -194,5 +201,5 @@
 !
 
 version_SVN
-    ^ '$Id: ChangeSetDiff.st 1872 2012-01-30 17:19:14Z vranyj1 $'
+    ^ '$Id: ChangeSetDiff.st 1898 2012-03-20 12:34:31Z vranyj1 $'
 ! !