eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ChangeSet':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: ChangeSet


Inheritance:

   Object
   |
   +--Collection
      |
      +--SequenceableCollection
         |
         +--OrderedCollection
            |
            +--ChangeSet

Package:
stx:libbasic3
Category:
System-Changes
Version:
rev: 1.352 date: 2024/03/09 08:02:47
user: cg
file: ChangeSet.st directory: libbasic3
module: stx stc-classLibrary: libbasic3

Description:


used in the changes management to keep track of changes

copyright

COPYRIGHT (c) 1993 by Claus Gittinger 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 inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

Compatibility-Squeak
o  uniqueNameLike: baseName
( an extension from the stx:libcompat package )

Compatibility-VW
o  component: component definition: anObject change: changeSymbol
Include indication that a class/namespace was added or removed
from a CodeComponent.

o  patches

instance creation
o  forExistingClass: aClass
build a changeSet for some given class, all of its private classes
and all extensions if any.
I.e. a changeSet which represents the existing class in the image.
That does of course not give deltas, but instead reflects the current
state of the given class.
It is useful in conjunction with the other utility methods,
for example, when building patchLists, diffSets, comparing etc.

Usage example(s):

     ChangeSet forExistingClass:ChangeSet
     ChangeSet forExistingClass:A

     Rectangle hasExtensions
     ChangeSet forExistingClass:Rectangle

o  forExistingClass: aClass withExtensions: withExtensions
build a changeSet for some given full class with or without extensions.
That does of course not give deltas, but instead reflects the current
state of the given class.
It is useful in conjunction with the other utility methods,
for example, when building patchLists, diffSets etc.

Usage example(s):

     Object hasExtensions
     Object extensions size

     (ChangeSet forExistingClass:Object) size
     (ChangeSet forExistingClass:Object withExtensions:false) size

     (ChangeSet forExistingClass:stx_libbasic3 withExtensions:false)

o  forExistingClass: aClass withExtensions: withExtensions extensionsOnly: extensionsOnly
build a changeSet for some given full class, the base-class or the extensions only,
as specified by the with-arguments.
That does of course not give deltas, but instead reflects the current
state of the given class.
It is useful in conjunction with the other utility methods,
for example, when building patchLists, diffSets etc.

Usage example(s):

     ChangeSet forExistingClass:ChangeSet

     Rectangle hasExtensions
     Rectangle extensions

     ChangeSet forExistingClass:Rectangle withExtensions:true extensionsOnly:false
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:false
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:true

o  forExistingClass: aClass withExtensions: withExtensions withLooseMethods: withLooseMethods
build a changeSet for some given full class with or without extensions.
That does of course not give deltas, but instead reflects the current
state of the given class.
It is useful in conjunction with the other utility methods,
for example, when building patchLists, diffSets etc.

Usage example(s):

     Object hasExtensions
     Object extensions size

     (ChangeSet forExistingClass:Object) size
     (ChangeSet forExistingClass:Object withExtensions:false) size

     (ChangeSet forExistingClass:stx_libbasic3 withExtensions:false)

o  forExistingClass: aClass withExtensions: withExtensions withLooseMethods: withLooseMethods extensionsOnly: extensionsOnly
build a changeSet for some given full class, the base-class or the extensions only,
as specified by the with-arguments.
That does of course not give deltas, but instead reflects the current
state of the given class.
It is useful in conjunction with the other utility methods,
for example, when building patchLists, diffSets etc.

Usage example(s):

     ChangeSet forExistingClass:ChangeSet

     Rectangle hasExtensions
     Rectangle extensions

     ChangeSet forExistingClass:Rectangle withExtensions:true extensionsOnly:false
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:false
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:true

o  forExistingMethods: aCollectionOfMethods
build a changeSet for a collection of methods in the image.
That does of course not give deltas, but instead reflects the current
state of the given set of methods.
It is useful in conjunction with the other utility methods,
for example, when building patchLists, diffSets etc.

Usage example(s):

     ChangeSet forExistingMethods:(Array with:(Array compiledMethodAt:#at:)
                                         with:(Object compiledMethodAt:#at:)
                                         with:(Behavior compiledMethodAt:#compiledMethodAt:) )

o  forPackage: pkg
build a changeSet for a given package in the image

o  forPackage: pkg ignoreAutoloaded: ignoreAutoloaded
build a changeSet for a given package in the image

o  fromBeeStream: aStream
build a changeSet from a Bee Smalltalk .bsc format stream, containing chunks.
Return the changeSet.

o  fromBeeStream: aStream while: aConditionBlock
build a changeSet from a Bee Smalltalk .bsc stream, containing chunks
Pass each change to the conditionBlock and stop whenever that
returns false. This allows skipping reamaining chunks, and speeding up
reading, if only parts need to be extracted
(for example: only documentation methods).
Return the changeSet.

o  fromCUISStream: aStream
build a changeSet from a CUIS Smalltalk format stream, containing chunks.
Return the changeSet.

Usage example(s):

     self fromCUISStream:('C:\Users\cg\work_mingw\stx\goodies\sound\siren9\original\Siren9C-main\Siren9C_Sources_Cuis\Music-Events.st'
                            asFilename readStream).

o  fromCUISStream: aStream while: aConditionBlock
build a changeSet from a CUIS Smalltalk stream, containing chunks
Pass each change to the conditionBlock and stop whenever that
returns false. This allows skipping reamaining chunks, and speeding up
reading, if only parts need to be extracted
(for example: only documentation methods).
Return the changeSet.

Usage example(s):

     self fromCUISStream:('C:\Users\cg\work_mingw\stx\goodies\sound\siren9\original\Siren9C-main\Siren9C_Sources_Cuis\Music-Events.st'
                            asFilename readStream).

o  fromDiffSet: aDiffSet
build a changeSet from a given diffSet. This can be used as a patchSet,
to update the first-version in the diffSet to the second-version

o  fromDirectory: aStringOfFilename
Read all .st files (non-recursively) from `aStringOrFilename`.
Return the resuling ChangeSet

o  fromDirectory: aStringOfFilename asSmalltalkXPackage: isSmalltalkXPackage
Read all .st files (non-recursively) from `aStringOrFilename`
Return the resuling ChangeSet.

If `isSmalltalkXPacklage` is true, then treat directory as Smalltalk/X
package directory as checked out from a VCS. Read only those files
present in abbrev.stc (if present).

o  fromDirectory: aStringOrFilename filter: filter
Read all files (non-recursively) from `aStringOrFilename` for which the
filter return true. Return the resuling ChangeSet

Usage example(s):

        ChangeSet fromDirectory: (Smalltalk getPackageDirectoryForPackage:'stx:libbasic')

o  fromDolphinPACStream: aStream
build a changeSet from a stream, containing dolphin pac file chunks.

o  fromDolphinPACStream: aStream while: aConditionBlock
build a changeSet from a stream, containing dolphin pac file chunks.
Pass each change to the conditionBlock and stop whenever that
returns false. This allows skipping reamaining chunks, and speeding up
reading, if only parts need to be extracted
(for example: only documentation methods).

o  fromFile: filenameOrString
build a changeSet from a file, which contains chunks.
(i.e. either a classes sourceFile or a change-file).
Return the changeSet.

Usage example(s):

     ChangeSet fromFile: 'st.chg'
     ChangeSet fromFile: 'patches'

o  fromFileOrDirectory: fileOrDirectory
Read either a single .st-file, or all .st files (non-recursively) in a directory.
Return the resuling ChangeSet

Usage example(s):

     ChangeSet fromFileOrDirectory: (Smalltalk getPackageDirectoryForPackage:'stx:libbasic')

o  fromGNUSmalltalkStream: aStream
build a changeSet from a GNU Smalltalk .gst format stream, containing a class definition.
Return the changeSet.

o  fromGithubFolder: aDirectoryName
build a changeSet from a GitHub format directory,
containing a class or extension definitions.
See eg. https://github.com/CampSmalltalk/Cypress
as an example.
Return the changeSet.

Usage example(s):

     self fromGithubFolder:
         'C:\Users\cg\Downloads\cypress\Cypress-master\implementations\smalltalkx\packages\stx_goodies_cypress.package\Array.extension\instance'

o  fromGithubPharoSmalltalkStream: aStream
build a changeSet from a Pharo GitHub format stream,
containing a class or extension definition.
See https://github.com/bouraqadi/PharoJS/Pharo
as an example.
Return the changeSet.

Usage example(s):

     self fromGithubPharoSmalltalkStream:
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsBridgeTest/PjBasicTest.class.st'
             asFilename readStream

     self fromGithubPharoSmalltalkStream:
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st'
             asFilename readStream

o  fromSIFStream: aStream
build a changeSet from a SIF stream, containing chunks
in smalltalk interchange format.
Return the changeSet.

o  fromSIFStream: aStream while: aConditionBlock
build a changeSet from a SIF stream, containing chunks
in smalltalk interchange format.
Pass each change to the conditionBlock and stop whenever that
returns false. This allows skipping reamaining chunks, and speeding up
reading, if only parts need to be extracted
(for example: only documentation methods).
Return the changeSet.

o  fromStream: aStream
build a changeSet from a stream, containing chunks.
(i.e. either a classes sourceFile or a change-file).
Return the changeSet.

Usage example(s):

     ChangeSet fromStream:('changes' asFilename readStream)
     ChangeSet fromStream:('patches' asFilename readStream)
     ChangeSet fromStream:(Object source asString readStream)

o  fromStream: aStream while: aConditionBlock
build a changeSet from a stream, containing chunks.
(i.e. either a classes sourceFile or a change-file).
Pass each change to the conditionBlock and stop whenever that returns false.
This allows skipping remaining chunks,
and thus speeding up reading, if only parts need to be extracted
(for example: only documentation methods,
or espcially if only class definition changes up to the first method change are required).
Returns the changeSet.

Usage example(s):

     ChangeSet fromStream:('changes' asFilename readStream)
     ChangeSet fromStream:('patches' asFilename readStream)
     ChangeSet fromStream:(Object source asString readStream)
     ChangeSet fromStream:(XWorkstation source asString readStream)

o  fromXMLStream: aStream
build a changeSet from an XML stream, containing XML change definitions in VisualWorks XML change file format.
Return the changeSet.

Usage example(s):

     ChangeSet fromXMLStream:('../../goodies/xml/vw/xmlFileInTests/XMLParser.xml' asFilename readStream)
     ChangeSetBrowser
        openOn:(ChangeSet fromXMLStream:('../../goodies/xml/vw/xmlFileInTests/XMLParser.xml' asFilename readStream))

instance creation-private
o  changesFromStream: aStream do: aBlock
enumerate changes from a stream and invoke aBlock on each.
The block is invoked with the change, a lineNumberOrNil and streamPosition arguments.
The lineNumber is only valid, if the underlying stream
provides line-numbers; otherwise, nil is passed.

Usage example(s):

     ChangeSet
	changesFromStream:('changes' asFilename readStream)
	do:[:chg | Transcript showCR:chg]

o  changesFromStream: aStream for: aChangeSet reader: aReader do: aBlock
enumerate changes from a stream and invoke aBlock on each.
The block is invoked with the change, a lineNumberOrNil and streamPosition arguments.
The lineNumber is only valid, if the underlying stream
provides line-numbers; otherwise, nil is passed.

queries
o  current
ST-80 compatibility: return the current changeSet

Usage example(s):

     ChangeSet current

o  current: aChangeSet
ST-80 compatibility: set the current changeSet

signal access
o  invalidChangeChunkError

utilities
o  decodedStreamFor: aStream

** This is an obsolete interface - do not use it (it may vanish in future versions) **


Instance protocol:

Compatibility-ST80
o  changeClass: aClass
dummy here

o  changeSelectors
return a collection (a set) of all selectors for which changes are in this changeSet

Usage example(s):

     ChangeSet current changeSelectors

o  changedClassNames
return a collection of all classNames for which changes are in this changeSet;
for metaclasses, there will be entries named 'XXX class' as strings in the returned collection

Usage example(s):

     ChangeSet current changedClassNames

o  changedClasses
return a collection of all classes for which changes are in this changeSet

Usage example(s):

     ChangeSet current changedClasses
     ChangeSet current flushChangedClassesCache

o  component: component definition: anObject change: changeSymbol
Include indication that a class/namespace was added or removed
from a CodeComponent.

o  reorganizeSystem
dummy here

accessing
o  name

o  name: aString
Modified (format): / 28-07-2012 / 09:34:52 / cg

change & update
o  changed: anAspectSymbol with: aParameter
Allow objects to depend on the ChangeSet class instead of a particular instance
of ChangeSet (which may be switched using projects).

changes management
o  addClassCommentChangeFor: aClass
add a classComment change to the receiver

o  addClassDefinitionChangeFor: aClass
add a classDefinition change to the receiver

Usage example(s):

     (ChangeSet new addClassDefinitionChangeFor:ChangeSet) inspect

o  addClassRemoveChange: oldClass
add a classRemove change to the receiver

o  addClassRenameChangeFrom: oldName to: newName
add a classRename change to the receiver

o  addDoIt: aString
add a doIt to the receiver

o  addInstVarDefinitionChangeFor: aClass
add an instVarDefinition change to the receiver

o  addMethodCategoryChange: aMethod category: newCategory in: aClass
add a methodCategory change to the receiver

o  addMethodChange: aMethod fromOld: oldMethod in: aClass
add a method change to the receiver

o  addMethodChange: aMethod in: aClass
add a method change to the receiver

o  addMethodPackageChange: aMethod package: newPackage in: aClass
add a methodPackage change to the receiver

o  addMethodPrivacyChange: aMethod in: aClass
add a methodPrivacy change to the receiver

o  addPrimitiveDefinitionsChangeFor: aClass
add a primitiveDefinitions change to the receiver

o  addPrimitiveFunctionsChangeFor: aClass
add a primitiveFunctions change to the receiver

o  addPrimitiveVariablesChangeFor: aClass
add a primitiveVariables change to the receiver

o  addRemoveSelectorChange: aSelector fromOld: oldMethod in: aClass
add a method-remove change to the receiver

o  addRenameCategoryChangeIn: aClass from: oldCategory to: newCategory
add a category rename change to the receiver

enumerating
o  rejectAllVersionMethodChanges
Return a new ChangeSet without version_XXX methods

fileIn / fileOut
o  fileInFrom: aStream

o  fileInFrom: aStream while: aConditionBlock

o  fileOutAs: aStringOrFilename

o  fileOutOn: stream

inspecting
o  inspector2TabBrowser
( an extension from the stx:libtool package )
another tab browsing the changeset

misc
o  addPatch: nameOfPatch
ignored for now - allows fileIn of ST-80 patch stuff ..

private
o  flattenOnto: aCollection
( an extension from the stx:libtool package )

o  flattenedChanges
( an extension from the stx:libtool package )

private-accessing
o  addChange: aChange
aChange sendChangeNotificationThroughSmalltalk.

o  flushChangedClassesCache
ChangeSet current flushChangedClassesCache

o  rememberChangedClass: aClass

o  removeAll: aCollection
(comment from inherited method)
remove all elements from the receiver which are equal to any in aCollection.
Return the argument, aCollection.
Raises an error, if some element-to-remove is not in the receiver.
(see also: #removeAllFoundIn:, which does not raise an error).

Notice: for some collections (those not tuned for
resizing themself) this may be very slow.
If the number of removed elements is big compared to
the receiver's size, it may be better to copy the
ones which are not to be removed into a new collection.

o  unrememberChangedClasses

queries
o  changedPackages
return a collection of all packages for which changes are in this changeSet

Usage example(s):

changedPackages add:p.

Usage example(s):

     ChangeSet current changedPackages

o  changesForClass: aClass selector: selector
return a collection of all changes for a particular method

Usage example(s):

     ChangeSet current changesForClass:ChangeSet selector:#includesChangeForClass:
     ChangeSet current changesForClass:ImageEditor class selector:#maskSpec

o  changesForPackage: aPackageSymbol
return a collection of all changes for a particular package

Usage example(s):

     ChangeSet current changesForPackage:#'stx:goodies/libsvn'

o  classDefinitionChanges
return a collection of all class definition changes

o  includesChangeForClass: aClass
ChangeSet current includesChangeForClass:ChangeSet
ChangeSet current includesChangeForClass:ChangeSet class
ChangeSet current includesChangeForClass:SourceCodeManagerUtilities
ChangeSet current includesChangeForClass:(Expecco::ExpeccoXMLDecoder::ObjectCreator)

o  includesChangeForClass: aClass selector: selector
ChangeSet current includesChangeForClass:ChangeSet selector:#includesChangeForClass:
ChangeSet current includesChangeForClass:ImageEditor class selector:#maskSpec

o  includesChangeForClassNamed: aClassName
ChangeSet current includesChangeForClassNamed:'ChangeSet'

o  includesChangeForClassOrMetaclass: aClass

o  includesChangeForClassOrMetaclassOrPrivateClassOf: aClass
Modified (format): / 25-07-2012 / 16:50:26 / cg

o  includesChangeForClassOrMetaclassOrPrivateClassOfAny: aCollectionOfClasses

o  includesChangeForPackage: aPackageID
^ self anySatisfy:[:aChange | aChange package = aPackageID]

Usage example(s):

     ChangeSet current includesChangeForPackage:'stx:libbasic'

o  includesChangeForSelector: selector

o  includesChangeForSelectorMatching: aGLOBPattern

o  methodDefinitionChangesForClassNamed: aClassName

o  selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom: aCollectionOfClasses
return the set of classes from a given collection, for which I have changes.

o  selectForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom: aCollectionOfClasses
select changes for one of a given class.
Returns a collection of changes

utilities
o  apply
apply all changes in the receiver's changeSet

o  applyWithInfoOn: aStream
apply all changes in the receiver's changeSet

o  condenseChanges
remove previous (older) changes which got obsoleted by newer ones;
that is: a method change, if there are more changes later for the same method,
or class definition changes, if the class has more definition changes later,
etc.

o  condenseChanges: changesToRemove
remove the given changes - a helper for the rest of the condense protocol

o  condenseChangesForClass: aClass
remove all changes for aClass (and its metaclass)
(i.e. leave changes for other classes).

o  condenseChangesForClass: aClass package: aPackageSymbolOrNil
remove all changes for aClass (and its metaclass) and aPackageSymbol
(i.e. leave methodChanges for other packages).
This is invoked when a class is checked into the repository.

o  condenseChangesForClass: aClass selector: aSelector
remove all changes for aClass >> selector.

o  condenseChangesForClass: aClass selector: selectorOrNil package: aPackageSymbolOrNil
remove all changes for aClass/selector and aPackageSymbol
(i.e. leave methodChanges for other packages).
If selectorOrNil is nil, all changes for that class (or metaclass) are removed;
otherwise, only changes for the given selector.
This is invoked when a class is checked into the repository.

o  condenseChangesForExtensionsInPackage: aPackageSymbol
remove all changes for aClass and aPackageSymbol
(i.e. leave methodChanges for other packages).
This is invoked when a class is checked into the repository.

o  condenseChangesForPackage: aPackageSymbol
remove all changes for aPackageSymbol
This is invoked when a project is checked into the repository.

o  condenseChangesForRemoved
( an extension from the stx:libtool package )
remove all changes which have been removed
(marked for removal by aChange removed: true)

o  diffSetsAgainst: anotherChangeSet
walk over the receiver and anotherChangeSet,
add all changes to one of the tree lists:
onlyInReceiver, onlyInArg or changed,
each being a changeSet containing corresponding changes.
WARNING:
destructive; could modify both the receiver and the argument by possibly
changing methodChanges into categoryChanges

o  diffSetsAgainst: anotherChangeSet comparingDifferentClasses: comparingDifferentClasses
walk over the receiver and anotherChangeSet,
add all changes to one of the tree lists:
onlyInReceiver, onlyInArg or changed,
each being a changeSet containing corresponding changes.
If comparingDifferentClasses is false, changes to different classes will
generate onlyInA/onlyInB changes; eg. changes for the same selector will be
listed on either side.
If it is true, we are comparing two different classes, and selectors present in
both will be listed as different (or even as the same).

WARNING:
destructive; could modify both the receiver and the argument by possibly
changing methodChanges into categoryChanges.

o  diffSetsAgainstImage

o  flatten
return a flat changeset from a changeset which may contain compositeChanges

o  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)

o  groupBy: groupBlock labelAs: labelBlock sort: doSort
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)

o  groupByClass

o  saveSignedToFile: aFilename
write the changeSet to a signed file in chunk format

o  saveSignedToFile: aFilename format: formatSymbolOrNil
write the changeSet to a signed file in some format.
Sign with the exept key (which you do not have outside of exept!).

formatSymbolOrNil is passed to saveToStream:s format:formatSymbolOrNil,
and specifies which fileOut format to use.
Nil means: chunk format (currently, the only supported)

o  saveToFile: aFilename
write the changeSet to a regular file in chunk format

o  saveToFile: aFilename format: formatSymbolOrNil
Writes the changeSet to a regular file in some format.
Supported formats are:
nil ............ chunk changeset file
#classSource ... class fileout format, assumes that
the receiver is a changeset containing
single class (possibly with its private
classes)

o  saveToStream: aStream format: formatSymbolOrNil
Writes the changeSet to a stream in some format.
Supported formats are:
nil ............ chunk changeset file format
#classSource ... class fileout format, assumes that
the receiver is a changeset containing
single class (possibly with its private
classes)

o  sortedByClassName
returns a new changeset containing the changes sorted by class names


Private classes:

    BeeChangeFileReader
    CUISChangeFileReader
    ChangeFileReader
    ChangeFileWriter
    ChangePair
    ChangeProcessingError
    ClassSourceWriter
    DiffSet
    DolphinPACFileReader
    GNUSmalltalkFileReader
    GithubFolderFileReader
    GithubPharoSmalltalkFileReader
    InvalidChangeChunkError
    SIFChangeFileReader


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Thu, 26 Dec 2024 11:25:43 GMT