changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
authorClaus Gittinger <cg@exept.de>
Thu, 07 Jul 2011 14:45:01 +0200
changeset 2426 d698fb5ebbd7
parent 2425 b0011db09dfe
child 2427 8a55734614cb
changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation: 2nd chance if an error occurs in checkout-newest while generating the current source.
SourceCodeManagerUtilities.st
--- a/SourceCodeManagerUtilities.st	Thu Jul 07 14:40:50 2011 +0200
+++ b/SourceCodeManagerUtilities.st	Thu Jul 07 14:45:01 2011 +0200
@@ -1003,58 +1003,56 @@
 
     inChangeSet := aClass hasUnsavedChanges.
 
-    self activityNotification:'generating current source...'.
-
-    currentSource := self sourceCodeOfClass:currentClass.
-
-    self activityNotification:'comparing...'.
-
-    sourceToLoad = currentSource ifTrue:[
-        "/ make all methods belong to the classes project
-        self setPackageOfAllMethodsIn:aClass to:aClass package.
-        inChangeSet ifTrue:[
-            rev = newestRev ifTrue:[
-                (askForConfirmation not
-                or:[ wasInChangeSetBefore not
-                or:[ self confirm:(resources 
-                                stringWithCRs:'%1 is up-to-date.\\Remove entries for %1 from changeSet ?'
-                                with:aClass name)]]) 
-                ifTrue:[
-                    ChangeSet current condenseChangesForClass:aClass.
-                ].
-            ].
-        ].
-        self activityNotification:'... nothing changed in repository'.
-        ^ self.
-    ].
-
-    self activityNotification:'generating diffSet...'.
     Error handle:[:ex |
         (Dialog 
             confirm:(resources 
-                        stringWithCRs:'An error was encountered while generating the current source of the class %1.\This might be due to some missing or corrupted source file.\You may proceed, but no information about the differences between your current version and the repositories version can be shown.\\Continue ?'
+                        stringWithCRs:'An error:\    %1\was encountered while generating the current source of the class %2.\This might be due to some missing or corrupted source file.\You may proceed, but no information about the differences between your current version and the repositories version can be shown.\\Continue ?'
+                        with:ex description 
                         with:currentClass name allBold) 
             noLabel:'Cancel') 
         ifFalse:[
             AbortOperationRequest raise
         ].
-        listHere := ChangeSet new
+        sourceToLoad readStream fileIn.
+        ^ self.
     ] do:[
+        self activityNotification:'generating current source...'.
+
+        currentSource := self sourceCodeOfClass:currentClass.
+
+        self activityNotification:'comparing...'.
+
+        sourceToLoad = currentSource ifTrue:[
+            "/ make all methods belong to the classes project
+            self setPackageOfAllMethodsIn:aClass to:aClass package.
+            inChangeSet ifTrue:[
+                rev = newestRev ifTrue:[
+                    (askForConfirmation not
+                    or:[ wasInChangeSetBefore not
+                    or:[ self confirm:(resources 
+                                    stringWithCRs:'%1 is up-to-date.\\Remove entries for %1 from changeSet ?'
+                                    with:aClass name)]]) 
+                    ifTrue:[
+                        ChangeSet current condenseChangesForClass:aClass.
+                    ].
+                ].
+            ].
+            self activityNotification:'... nothing changed in repository'.
+            ^ self.
+        ].
+
+        self activityNotification:'generating diffSet...'.
         listHere := ChangeSet fromStream:(currentSource readStream).
     ].
+
     listRep := ChangeSet fromStream:(sourceToLoad readStream).
 
     Error handle:[:ex |
         (Dialog 
             confirm:(resources 
-                        stringWithCRs:'An error:
-    ',ex description,'
-was encountered while trying to figure out what has changed.
-This might be due to some missing or corrupted source file.
-IF you proceed, the old code will be loaded over the existing code without further checks (fileIn).
-
-Continue ?'
-                        ) 
+                        stringWithCRs:'An error:\    %1\was encountered while trying to figure out what has changed.\This might be due to some missing or corrupted source file.\If you proceed, the old code will be loaded over the existing code without further checks (fileIn).\\Continue ?'
+                        with:ex description
+                    ) 
             noLabel:'Cancel') 
         ifFalse:[
             ^ self
@@ -1314,7 +1312,7 @@
     ].
 
     "Modified: / 07-02-2001 / 18:18:32 / ps"
-    "Modified: / 15-10-2007 / 14:11:51 / cg"
+    "Modified: / 07-07-2011 / 14:43:59 / cg"
 !
 
 checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge using:aSourceCodeManager
@@ -3347,5 +3345,5 @@
 !SourceCodeManagerUtilities class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.217 2011-07-01 11:42:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.218 2011-07-07 12:45:01 cg Exp $'
 ! !