MCStXSnapshotPreWriteTransformation.st
changeset 886 850e6b54a054
parent 877 493a70407896
child 898 728e7cbc9af0
--- a/MCStXSnapshotPreWriteTransformation.st	Tue Jun 11 03:58:56 2013 +0200
+++ b/MCStXSnapshotPreWriteTransformation.st	Wed Jun 12 10:24:37 2013 +0200
@@ -1,7 +1,7 @@
 "{ Package: 'stx:goodies/monticello' }"
 
 MCStXSnapshotTransformation subclass:#MCStXSnapshotPreWriteTransformation
-	instanceVariableNames:'extensionMethodCategoryMap'
+	instanceVariableNames:'extensionMethodCategoryMap projectDefinition'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SCM-Monticello-St/X Storing'
@@ -89,6 +89,12 @@
 
     "Created: / 30-05-2013 / 22:48:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 31-05-2013 / 01:16:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isSmalltalkXPackage
+    ^ projectDefinition notNil
+
+    "Created: / 12-06-2013 / 09:22:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MCStXSnapshotPreWriteTransformation methodsFor:'transforming'!
@@ -96,10 +102,15 @@
 transform: anMCSnapshot
     "Returns a transformed **copy** of the original snapshot"
 
-    | projectDefinition |
     extensionMethodCategoryMap := OrderedCollection new.
+    original := anMCSnapshot.    
+    projectDefinition := self projectDefinition.
+    projectDefinition isNil ifTrue:[
+        "/ Not a Smalltalk/X package - no transformation
+        transformed := original.
+        ^transformed 
+    ].
     super transform: anMCSnapshot.
-    projectDefinition := self projectDefinition.
     (projectDefinition notNil and:[extensionMethodCategoryMap notEmpty]) ifTrue:[
         | source |
 
@@ -123,6 +134,7 @@
     ^transformed.
 
     "Created: / 31-05-2013 / 00:05:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 12-06-2013 / 09:23:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MCStXSnapshotPreWriteTransformation methodsFor:'visiting'!
@@ -169,10 +181,10 @@
 !MCStXSnapshotPreWriteTransformation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.5 2013-05-31 10:39:30 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.6 2013-06-12 08:24:37 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.5 2013-05-31 10:39:30 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.6 2013-06-12 08:24:37 vrany Exp $'
 ! !