--- a/ChangeSet.st Tue Jun 28 23:00:59 2011 +0200
+++ b/ChangeSet.st Tue Jun 28 23:04:01 2011 +0200
@@ -1,6 +1,6 @@
"
COPYRIGHT (c) 1993 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -12,54 +12,54 @@
"{ Package: 'stx:libbasic3' }"
OrderedCollection subclass:#ChangeSet
- instanceVariableNames:'changedClasses changeSelectors name'
- classVariableNames:''
- poolDictionaries:''
- category:'System-Changes'
+ instanceVariableNames:'changedClasses changeSelectors name'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'System-Changes'
!
Object subclass:#ChangeFileReader
- instanceVariableNames:'inputStream parseTree changeAction changeSet selector receiver
- arguments receiverSelector receiverReceiver lineNumber position
- className methodSelector'
- classVariableNames:''
- poolDictionaries:''
- privateIn:ChangeSet
+ instanceVariableNames:'inputStream parseTree changeAction changeSet selector receiver
+ arguments receiverSelector receiverReceiver lineNumber position
+ className methodSelector'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:ChangeSet
!
Error subclass:#ChangeProcessingError
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:ChangeSet
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:ChangeSet
!
Object subclass:#DiffSet
- instanceVariableNames:'changed onlyInReceiver onlyInArg'
- classVariableNames:''
- poolDictionaries:''
- privateIn:ChangeSet
+ instanceVariableNames:'changed onlyInReceiver onlyInArg'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:ChangeSet
!
ChangeSet::ChangeFileReader subclass:#DolphinPACFileReader
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:ChangeSet
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:ChangeSet
!
ChangeSet::ChangeProcessingError subclass:#InvalidChangeChunkError
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:ChangeSet
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:ChangeSet
!
ChangeSet::ChangeFileReader subclass:#SIFChangeFileReader
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:ChangeSet
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:ChangeSet
!
!ChangeSet class methodsFor:'documentation'!
@@ -67,7 +67,7 @@
copyright
"
COPYRIGHT (c) 1993 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -83,7 +83,7 @@
used in the changes management to keep track of changes
[author:]
- Claus Gittinger
+ Claus Gittinger
"
! !
@@ -447,6 +447,7 @@
"Created: / 27.10.1997 / 13:52:54 / cg"
! !
+
!ChangeSet class methodsFor:'Compatibility-VW'!
component: component definition: anObject change: changeSymbol
@@ -966,6 +967,26 @@
"Modified: / 14.11.2001 / 13:36:06 / cg"
! !
+
+!ChangeSet methodsFor:'fileOut'!
+
+fileOutAs: aStringOrFilename
+
+ | stream |
+ stream := aStringOrFilename asFilename writeStream.
+ [ self fileOutOn: stream ]
+ ensure: [stream close]
+
+ "Created: / 05-12-2009 / 12:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+fileOutOn: stream
+
+ self do:[:chg|chg fileOutOn: stream]
+
+ "Created: / 05-12-2009 / 12:32:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!ChangeSet methodsFor:'misc'!
addPatch:nameOfPatch
@@ -974,6 +995,7 @@
^ self
! !
+
!ChangeSet methodsFor:'private-accessing'!
addChange:aChange
@@ -1189,7 +1211,7 @@
"apply all changes in the receivers changeSet"
self do:[:aChange |
- aChange apply
+ aChange apply
]
!
@@ -1556,6 +1578,75 @@
"Modified: / 12-10-2006 / 22:22:39 / cg"
!
+flatten
+
+ | flatten |
+ flatten := self class new: self size.
+ self do:[:ea|ea do:[:ea2|flatten add: ea2]].
+ ^flatten
+
+ "Created: / 29-10-2010 / 14:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+groupBy: groupBlock labelAs: labelBlock
+
+ "
+ returns a new changeset consisting of CompositeChanges.
+ Changes are grouped together by value (tag) of groupBlock.
+ Each composite change is then labeled using label
+ returned by labelBlock (called with the tag returned
+ by groupBlock as arg)
+ "
+
+ | buckets newChangeset |
+ buckets := OrderedDictionary new.
+ self do:
+ [:change| | tag |
+ tag := groupBlock value: change.
+ (buckets at: tag ifAbsentPut: [ChangeSet new:4])
+ add: change].
+ newChangeset := ChangeSet new: buckets size.
+ buckets keysAndValuesDo:
+ [:tag :changes| | classDefs |
+ "Move class definition to the front"
+ classDefs := changes select:[:chg|chg isClassDefinitionChange].
+ changes removeAll: classDefs.
+ changes addAllFirst: classDefs.
+
+ tag ifNotNil:
+ [newChangeset add:
+ (CompositeChange
+ name: (labelBlock value: tag)
+ changes: changes)]].
+ (buckets includesKey: nil) ifTrue:
+ [newChangeset addAll: (buckets at: nil)].
+ ^newChangeset
+
+ "Created: / 24-07-2009 / 23:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
+ "Modified: / 25-07-2009 / 19:40:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
+ "Modified: / 29-10-2010 / 12:45:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+groupByClass
+
+ ^self
+ groupBy:
+ [:change|
+ change isClassChange
+ ifTrue:
+ [|nm|
+ nm := change className.
+ (nm endsWith:' class') ifTrue:[nm := nm copyTo: nm size - 6].
+ nm]
+ ifFalse:
+ [nil]]
+ labelAs:
+ [:className|className]
+
+ "Created: / 25-07-2009 / 19:43:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
+ "Modified: / 24-10-2009 / 18:49:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
saveSignedToFile:aFilename
"write the changeSet to a signed file in chunk format"
@@ -1652,24 +1743,6 @@
and:lineNumber
and:position.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
!
checkReceiverIsGlobalNamed:expectedName
@@ -1677,11 +1750,17 @@
!
classNameOf:aReceiver
- (aReceiver isUnaryMessage
- and:[aReceiver selector == #class]) ifTrue:[
- ^ (aReceiver receiver name) , ' class'.
- ].
- ^ aReceiver name
+
+ | nameSpace clsName |
+ nameSpace := Class nameSpaceQuerySignal query.
+
+ (aReceiver isUnaryMessage and:[aReceiver selector == #class])
+ ifTrue:[clsName := (aReceiver receiver name) , ' class']
+ ifFalse:[clsName := aReceiver name].
+
+ ^(nameSpace ~~ Smalltalk and:[(clsName startsWith: nameSpace name) not])
+ ifTrue:[nameSpace name , '::' , clsName]
+ ifFalse:[clsName].
!
receiversClassName
@@ -2652,9 +2731,11 @@
!ChangeSet class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.177 2011-02-08 10:48:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.178 2011-06-28 21:04:01 vrany Exp $'
+
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.177 2011-02-08 10:48:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.178 2011-06-28 21:04:01 vrany Exp $'
+
! !