class: MCStXSnapshotPreWriteTransformation
authorClaus Gittinger <cg@exept.de>
Mon, 30 Mar 2015 21:54:21 +0200
changeset 977 f95b01954348
parent 976 eba7baca1ed0
child 980 a3d99b77b7f8
class: MCStXSnapshotPreWriteTransformation comment/format in: #visitClassDefinition: changed: #visitMethodDefinition: try to save as single byte string (if possible).
MCStXSnapshotPreWriteTransformation.st
--- a/MCStXSnapshotPreWriteTransformation.st	Sun Mar 01 02:06:15 2015 +0100
+++ b/MCStXSnapshotPreWriteTransformation.st	Mon Mar 30 21:54:21 2015 +0200
@@ -1,5 +1,9 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:goodies/monticello' }"
 
+"{ NameSpace: Smalltalk }"
+
 MCStXSnapshotTransformation subclass:#MCStXSnapshotPreWriteTransformation
 	instanceVariableNames:'extensionMethodCategoryMap projectDefinition'
 	classVariableNames:''
@@ -140,6 +144,11 @@
 !MCStXSnapshotPreWriteTransformation methodsFor:'visiting'!
 
 visitClassDefinition: definition
+    "
+     save ProjectDefinition classes with Object as superclass   
+     (because ProjectDefinition is not present in Pharo/Squeak).
+     When reading back into ST/X, the PostReadTransformation undoes this
+    "
     | class |
 
     class := definition actualClass.
@@ -165,9 +174,10 @@
 !
 
 visitMethodDefinition: definition
-    | source |
+    | source|
 
     source := definition source asStringWithNativeLineEndings asStringCollection withTabs asStringWithSqueakLineEndings.
+    source := source asSingleByteStringIfPossible.
     definition source: source.
 
     (self isExtensionMethodDefinition: definition) ifTrue:[
@@ -205,10 +215,10 @@
 !MCStXSnapshotPreWriteTransformation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.10 2014-11-06 09:08:04 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.11 2015-03-30 19:54:21 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.10 2014-11-06 09:08:04 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.11 2015-03-30 19:54:21 cg Exp $'
 ! !