SourceCodeManagerUtilities.st
changeset 987 fa4fc87b8540
parent 986 78d2a098bc81
child 989 bb70a0f30e98
--- a/SourceCodeManagerUtilities.st	Tue Nov 14 16:42:53 2000 +0100
+++ b/SourceCodeManagerUtilities.st	Tue Nov 14 17:14:30 2000 +0100
@@ -695,86 +695,91 @@
 
         sourceToLoad = currentSource ifTrue:[
             self information:'Versions are identical.'.
-        ] ifFalse:[
-            self activityNotification:'generating diffSet  ...'.
-            listHere := ChangeSet fromStream:(currentSource readStream).
-            listRep := ChangeSet fromStream:(sourceToLoad readStream).
-            diffSet := listHere diffSetsAgainst:listRep.
-            changed := diffSet at:#changed.
-            onlyHere := diffSet at:#onlyInReceiver.
-            onlyInRep := diffSet at:#onlyInArg.
-            msg := 'Load repository version, or merge it into your current version ?'.
-            labels := #('cancel' 'merge' 'load'). 
-            values := #(nil #merge #load). 
+            ^ self.
+        ].
 
-            onlyHere isEmpty ifTrue:[
-                onlyInRep isEmpty ifTrue:[
+        self activityNotification:'generating diffSet...'.
+        listHere := ChangeSet fromStream:(currentSource readStream).
+        listRep := ChangeSet fromStream:(sourceToLoad readStream).
+        diffSet := listHere diffSetsAgainst:listRep.
+        changed := diffSet at:#changed.
+        onlyHere := diffSet at:#onlyInReceiver.
+        onlyInRep := diffSet at:#onlyInArg.
+        msg := 'Load repository version, or merge it into your current version ?'.
+        labels := #('cancel' 'merge' 'load'). 
+        values := #(nil #merge #load). 
+
+        onlyHere isEmpty ifTrue:[
+            onlyInRep isEmpty ifTrue:[
+                changed isEmpty ifTrue:[
+                    self information:'Versions are identical.'.
+                    ^ self
+                ].
+                msg := 'Load repository version ?'.
+                msg := msg , '\\This will undo all your changes made to the class.'.
+                labels := #('cancel' 'load'). 
+                values := #(nil #load). 
+            ] ifFalse:[
+                changed isEmpty ifTrue:[
                     msg := 'Load repository version ?'.
-                    msg := msg , '\\This will undo all your changes made to the class.'.
-                    labels := #('cancel' 'load'). 
-                    values := #(nil #load). 
-                ] ifFalse:[
-                    changed isEmpty ifTrue:[
-                        msg := 'Load repository version ?'.
-                        msg := msg , '\\This will load methods which are not present in the class.'.
-                        labels := #('cancel' 'load'). 
-                        values := #(nil #load). 
-                    ] ifFalse:[
-                        msg := 'Load repository version, or merge it into your current version ?'.
-                        msg := msg , '\\Load will undo all your changes made to the class;'.
-                        msg := msg , '\Merge will only load methods which are not present in the class.'.
-                    ].
-                ]
-            ] ifFalse:[
-                onlyInRep isEmpty ifTrue:[
-                    msg := 'Load repository version ?'.
-                    msg := msg , '\\This will undo all your changes made to the class,'.
-                    msg := msg , '\and remove methods which are not present in the repository version.'.
+                    msg := msg , '\\This will load methods which are not present in the class.'.
                     labels := #('cancel' 'load'). 
                     values := #(nil #load). 
                 ] ifFalse:[
                     msg := 'Load repository version, or merge it into your current version ?'.
                     msg := msg , '\\Load will undo all your changes made to the class;'.
                     msg := msg , '\Merge will only load methods which are not present in the class.'.
-                ]
-            ].
-            answer := (Dialog confirmWithCancel:msg withCRs
-                   labels:(resources array:labels)
-                   values:values 
-                   default:2).
-            answer isNil ifTrue:[^ self].
+                ].
+            ]
+        ] ifFalse:[
+            onlyInRep isEmpty ifTrue:[
+                msg := 'Load repository version ?'.
+                msg := msg , '\\This will undo all your changes made to the class,'.
+                msg := msg , '\and remove methods which are not present in the repository version.'.
+                labels := #('cancel' 'load'). 
+                values := #(nil #load). 
+            ] ifFalse:[
+                msg := 'Load repository version, or merge it into your current version ?'.
+                msg := msg , '\\Load will undo all your changes made to the class;'.
+                msg := msg , '\Merge will only load methods which are not present in the class.'.
+            ]
+        ].
+        answer := (Dialog confirmWithCancel:msg withCRs
+               labels:(resources array:labels)
+               values:values 
+               default:2).
+        answer isNil ifTrue:[^ self].
 
-            self activityNotification:'updating...'.
-            answer == #load ifTrue:[
-                onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
-                                             eachChange apply.
-                                             eachChange isMethodChange ifTrue:[
-                                                 eachChange changeMethod package:(eachChange changeClass package)
-                                             ]
-                             ].
-                onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
-                                             |cClass cSel|
-                                             cClass := eachChange changeClass.
-                                             cSel := eachChange selector.
-                                             cClass removeSelector:cSel.
-                            ].
-                changed do:[:eachChangeArr | "apply this change (go to rep-version)"
-                                             |cHere cRep| 
-                                             cHere := eachChangeArr at:1.
-                                             cRep := eachChangeArr at:2.
-                                             cRep apply.
-                                             cRep isMethodChange ifTrue:[
-                                                 cRep changeMethod package:(cRep changeClass package)
-                                             ]
-                           ].
-            ] ifFalse:[
-                onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
-                                             eachChange apply.
-                                             eachChange isMethodChange ifTrue:[
-                                                 eachChange changeMethod package:(eachChange changeClass package)
-                                             ]
-                             ].
-            ].
+        self activityNotification:'updating...'.
+        answer == #load ifTrue:[
+            onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
+                                         eachChange apply.
+                                         eachChange isMethodChange ifTrue:[
+                                             eachChange changeMethod package:(eachChange changeClass package)
+                                         ]
+                         ].
+            onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
+                                         |cClass cSel|
+                                         cClass := eachChange changeClass.
+                                         cSel := eachChange selector.
+                                         cClass removeSelector:cSel.
+                        ].
+            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
+                                         |cHere cRep| 
+                                         cHere := eachChangeArr at:1.
+                                         cRep := eachChangeArr at:2.
+                                         cRep apply.
+                                         cRep isMethodChange ifTrue:[
+                                             cRep changeMethod package:(cRep changeClass package)
+                                         ]
+                       ].
+        ] ifFalse:[
+            onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
+                                         eachChange apply.
+                                         eachChange isMethodChange ifTrue:[
+                                             eachChange changeMethod package:(eachChange changeClass package)
+                                         ]
+                         ].
         ].
     ].
 !
@@ -1445,5 +1450,5 @@
 !SourceCodeManagerUtilities class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.28 2000-11-14 15:42:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.29 2000-11-14 16:14:30 cg Exp $'
 ! !