MCModification.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 01 Nov 2014 01:21:08 +0100
changeset 936 c4564a0396b9
parent 657 0416ea023c43
child 1095 87f223484bc3
permissions -rw-r--r--
Fix in MCStXSnapshotPreWriteTransformation: do not fix extension cstegory if the prefix in OK. ...otherwise package category is lost when exporting previously imported .mcz. Thanks JK for spotting this.

"{ Package: 'stx:goodies/monticello' }"

MCPatchOperation subclass:#MCModification
	instanceVariableNames:'obsoletion modification'
	classVariableNames:''
	poolDictionaries:''
	category:'SCM-Monticello-Patching'
!


!MCModification class methodsFor:'as yet unclassified'!

of: base to: target
	^ self new initializeWithBase: base target: target
! !

!MCModification methodsFor:'accessing'!

applyTo: anObject
	anObject modifyDefinition: obsoletion to: modification
!

baseDefinition
	^ obsoletion
!

definition
	^ modification
!

fromSource
	^ obsoletion source
!

modification
	^ modification
!

obsoletion
	^ obsoletion
!

summarySuffix
	^self fromSource = self toSource
		ifTrue: [ ' (source same but rev changed)' ]
		ifFalse: [ ' (changed)' ]
!

targetClass
	^ obsoletion actualClass
!

targetDefinition
	^ modification
!

toSource
	^ modification source
! !

!MCModification methodsFor:'as yet unclassified'!

inverse
	^ MCModification of: modification to: obsoletion
!

isClassPatch
	^obsoletion isClassDefinition
!

printAnnotations: request on: aStream
	aStream nextPutAll: 'old: '.
	obsoletion printAnnotations: request on: aStream.
	aStream cr.
	aStream nextPutAll: 'new: '.
	modification printAnnotations: request on: aStream.
! !

!MCModification methodsFor:'initializing'!

initializeWithBase: base target: target
	obsoletion := base.
	modification := target.
! !

!MCModification methodsFor:'testing'!

isModification
	^ true
! !

!MCModification class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCModification.st,v 1.4 2012-09-11 21:24:34 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCModification.st,v 1.4 2012-09-11 21:24:34 cg Exp $'
!

version_SVN
    ^ '§Id: MCModification.st 5 2010-08-29 07:30:29Z vranyj1 §'
! !