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.295 date: 2019/07/22 15:39:24
user: cg
file: ChangeSet.st directory: libbasic3
module: stx stc-classLibrary: libbasic3
Author:
Claus Gittinger

Description:


used in the changes management to keep track of changes


Class protocol:

Compatibility-ST80
o  patches

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.

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  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  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 reamaining 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


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

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  changesForPackage: aPackageSymbol
ChangeSet current changesForPackage:#'stx:goodies/libsvn'

o  classDefinitionChanges

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:

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 contains:[:aChange | aChange package = aPackageID]

usage example(s):

     ChangeSet current includesChangeForPackage:'stx:libbasic'

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  condenseChanges

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: aPackageSymbol
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: aPackageSymbol
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
    ChangeFileReader
    ChangeFileWriter
    ChangeProcessingError
    ClassSourceWriter
    DiffSet
    DolphinPACFileReader
    GNUSmalltalkFileReader
    GithubPharoSmalltalkFileReader
    InvalidChangeChunkError
    SIFChangeFileReader


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 17:40:03 GMT