#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Mon, 17 Dec 2018 13:15:35 +0100
changeset 4388 6068318753ee
parent 4387 e1c327625e8e
child 4389 20e08f31f335
#FEATURE by cg class: CVSSourceCodeManager class changed: #checkinClass:fileName:directory:module:source:logMessage:force:asBranch: verify that the editoed conflict source is ok (parses as changeset)
CVSSourceCodeManager.st
--- a/CVSSourceCodeManager.st	Fri Dec 07 04:34:45 2018 +0000
+++ b/CVSSourceCodeManager.st	Mon Dec 17 13:15:35 2018 +0100
@@ -2629,7 +2629,15 @@
                             (repairedText contains:[:line | line notEmptyOrNil and:[(line emphasisAt:1) = emSep]]) ifTrue:[
                                 self warn:'You have to look at ALL conflicts, and remove ALL green lines as a confirmation !!'.
                                 didAccept := false.
-                            ]
+                            ] ifFalse:[
+                                "/ verify that the edit yields a correct (loadable) source
+                                Error handle:[:ex |
+                                    self warn:(self classResources stringWithCRs:'The edited source code seems to be incorrect\(probably missing exclamation marks or missing quotes)\\I will not check this in, because it will fail to compile/load later.').
+                                    didAccept := false.
+                                ] do:[
+                                    (ChangeSet fromString:repairedText asString string)
+                                ].
+                            ].
                         ].
 
                     ].
@@ -2884,6 +2892,7 @@
     "Modified: / 31-03-2017 / 15:42:32 / stefan"
     "Modified: / 18-05-2018 / 12:53:43 / Stefan Vogel"
     "Modified: / 09-11-2018 / 18:09:37 / Maren"
+    "Modified: / 17-12-2018 / 13:15:21 / Claus Gittinger"
 !
 
 checkoutModule:aModule directory:aPackage andDo:aBlock