|
|
Class: AbstractSourceCodeManager
Object
|
+--AbstractSourceCodeManager
|
+--CVSSourceCodeManager
|
+--StoreSourceCodeManager
- Package:
- stx:libbasic3
- Category:
- System-SourceCodeManagement
- Version:
- rev:
1.235
date: 2010/04/12 14:54:36
- user: cg
- file: AbstractSourceCodeManager.st directory: libbasic3
- module: stx stc-classLibrary: libbasic3
- Author:
- Claus Gittinger
Abstract superclass for sourceCodeManagers.
Concrete subclasses provide access to a source repository.
All protocol here traps into subclassResponsbility errors.
Please read more documentation in concrete subclasses
(especially: CVSSourceCodeManager) for how to use this manager.
accessing
-
availableManagers
-
-
cacheDirectoryName
-
return the name of the cache directory, where checked out class
sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
This cache is shared among all ST/X users on a system.
-
cacheDirectoryName: aStringOrFilename
-
set the name of the cache directory, where checked out class
sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
This cache is shared among all ST/X users on a system.
The directory is typically set via the launchers setting menu, or
from a startup rc-file.
-
cachingSources
-
return true, if source caching is enabled.
(see cacheDirectoryName for what that means)
-
cachingSources: aBoolean
-
enable/disable the caching of source files.
(see cacheDirectoryName for what that means)
-
defaultManager
-
return the default sourceCodeManager class
-
repositoryInfoPerModule
-
return the dictionary, which associates CVSRoots to module names.
If no entry is contained in this dictionary for some module,
the default cvsRoot (CVSRoot) will be used.
-
repositoryInfoPerModule: info
-
ignore here
-
repositoryName
-
return the name of the repository.
Since this is an abstract class, return nil (i.e. none)
-
useWorkTree
-
return the setting of useWorkTree, which (eventually)
controls if an up-to-date view of a CVS working tree should be
kept in sync. This is not yet implemented.
-
useWorkTree: aBoolean
-
enable/disable the useWorkTree feature, which (eventually)
controls if an up-to-date view of a CVS working tree should be
kept in sync. This is not yet implemented.
-
workTreeDirectoryName
-
return the name of the workTree, which is kept in sync
with the current class versions. This is not yet implemented
-
workTreeDirectoryName: aStringOrFilename
-
set the name of the workTree, which is kept in sync
with the current class versions. This is not yet implemented
basic access
-
checkinClass: aClass fileName: classFileName directory: packageDir module: moduleDir source: sourceFile logMessage: logMessage force: force
-
checkin of a class into the source repository.
Return true if ok, false if not.
** This method raises an error - it must be redefined in concrete classes **
-
checkoutModule: aModule directory: aPackage andDo: aBlock
-
check out everything from a package into a temporary directory.
Then evaluate aBlock, passing the name of that temp-directory.
Afterwards, the tempDir is removed.
Return true, if OK, false if any error occurred.
** This method raises an error - it must be redefined in concrete classes **
-
streamForClass: aClass fileName: classFileName revision: revision directory: packageDir module: moduleDir cache: doCache
-
extract a classes source code and return an open readStream on it.
A revision of nil selects the current (in image) revision.
The classes source code is extracted using the revision and the sourceCodeInfo,
which itself is extracted from the classes packageString.
** This method raises an error - it must be redefined in concrete classes **
-
streamForExtensionFile: fileName package: package directory: dir module: mod cache: doCache
-
basic administration
-
checkForExistingContainer: fileName inModule: moduleName directory: dirName
-
check for a container to be present
** This method raises an error - it must be redefined in concrete classes **
-
checkForExistingContainer: fileName inPackage: aPackage
-
check if a source-code container is present in a packages directory.
-
checkForExistingContainerForClass: aClass
-
check if a source-code container for a given class is present in the repository.
-
checkForExistingModule: moduleName
-
check for a module directory to be present
** This method raises an error - it must be redefined in concrete classes **
-
checkForExistingModule: moduleDir directory: packageDir
-
check for a package directory to be present
** This method raises an error - it must be redefined in concrete classes **
-
createContainerFor: aClass inModule: moduleName directory: dirName container: fileName
-
create a new container & check into it an initial version of aClass
** This method raises an error - it must be redefined in concrete classes **
-
createModule: moduleName
-
create a new module directory
** This method raises an error - it must be redefined in concrete classes **
-
createModule: module directory: directory
-
create a new package directory
** This method raises an error - it must be redefined in concrete classes **
-
initialRevisionStringFor: aClass inModule: moduleDir directory: packageDir container: fileName
-
return a string usable as initial revision string
** This method raises an error - it must be redefined in concrete classes **
-
revisionLogOf: clsOrNil fromRevision: firstRev toRevision: lastRef fileName: classFileName directory: packageDir module: moduleDir
-
-
revisionLogOf: clsOrNil fromRevision: rev1OrNil toRevision: rev2OrNil numberOfRevisions: limitOrNil fileName: classFileName directory: packageDir module: moduleDir
-
actually do return a revisionLog. The main worker method.
This must be implemented by a concrete source-code manager
** This method raises an error - it must be redefined in concrete classes **
cache administration
-
condenseSourceCache
-
remove all cached old versions (i.e. leave the newest only)
-
flushSourceCache
-
remove all cached versions
initialization
-
initCacheDirPath
-
initialize the name of the cacheDirectory.
This is:
<tempDir>/stx_sourceCache.
-
initialize
-
setup for no caching and no workTree
obsolete backward compatibility
-
checkForExistingContainerInModule: moduleDir directory: packageDir container: fileName
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
checkForExistingContainerInModule: moduleName package: dirName container: fileName
-
check for a container to be present
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
checkForExistingModule: moduleDir package: packageDir
-
check for a package directory to be present
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
checkoutModule: aModule package: aPackage andDo: aBlock
-
check out everything from a package into a temporary directory.
Then evaluate aBlock, passing the name of that temp-directory.
Afterwards, the tempDir is removed.
Return true, if OK, false if any error occurred.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
createModule: module package: package
-
create a new package directory
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
getExistingContainersInModule: aModule package: aPackage
-
return a collection containing the names of existing containers
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
getExistingPackagesInModule: aModule
-
return a collection containing the names of existing packages
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
initialRevisionStringFor: aClass inModule: moduleDir package: packageDir container: fileName
-
return a string usable as initial revision string
** This is an obsolete interface - do not use it (it may vanish in future versions) **
private
-
checkMethodPackagesOf: aClass
-
check if aClass contains methods from another package;
ask if these should be checked in with the class.
Raises abortSignal if checkIn is to be suppressed.
returns:
#base - only check in methods from the classes package
#all - check in all
the old code looked for all extensions, and allowed them to be moved to the base-package.
This was dangerous, as if one presses yes too quickly, extensions move to the base too easy.
The new code only allows for extensions from the __NOPROJECT__ package to be moved.
Extensions always remain extensions, and must be moved by an explicit method-menu action.
-
compileVersionMethod: methodName of: aClass for: newRevisionString
-
-
containerFromSourceInfo: info
-
given a sourceInfo, return the classes container
-
directoryFromContainerPath: containerPath forClass: aClass
-
given a full path as in an RCS header,
extract the directory (i.e. package).
-
directoryFromContainerPath: containerPath forPackage: packageID
-
given a full path as in an RCS header,
extract the directory (i.e. package).
-
directoryFromSourceInfo: info
-
given a sourceInfo, return the classes package directory
-
moduleFromContainerPath: containerPath forClass: aClass
-
given a full path as in an RCS header, extract the module.
-
moduleFromContainerPath: containerPath forPackage: packageID
-
given a full path as in an RCS header, extract the module.
-
moduleFromSourceInfo: info
-
given a sourceInfo, return the classes module directory
-
packageFromSourceInfo: info
-
given a sourceInfo, return the classes package directory
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
pathInRepositoryFrom: containerPath forPackage: packageID
-
this tries to extract the path within a repository, given some path
as present in an RCS Header string.
Typically, this ought to be that string directly;
however, if the repository directory is accessed via a symbolic link during
ci/co, some systems extract different strings with co.
One such system here had a symbolic link from /phys/ibm/CVS... to /file/CVS,
and extracted sources had /phys/ibm/CVS in their header.
Do not depend on the code below to work correctly all the time.
-
postCheckInClass: aClass
-
invoked after a checkIn
-
postCheckInExtensionsForPackage: aPackageId
-
invoked after a checkIn
-
reportError: msg
-
-
repositoryTopDirectory
-
return the name of the repository
-
revisionAfter: aRevisionString
-
generate the next revision number after the given number
-
sourceCacheDirectory
-
return the sourceCache directories name
-
sourceInfoOfClass: aClass
-
helper: return a classes sourceCodeInfo by extracting its
versionString components.
-
updateVersionMethodOf: aClass for: newRevisionString
-
helper for the checkin procedure.
Update my #version_XXX method, to now return newRevisionString.
queries
-
isExperimental
-
-
isResponsibleForModule: module
-
-
isResponsibleForPackage: apackage
-
-
isVersionMethodSelector: selector
-
-
nameOfVersionMethodForExtensions
-
-
nameOfVersionMethodInClasses
-
-
sourceCodeManagerForPackage: packageId
-
-
versionMethodTemplateForRuby
-
-
versionMethodTemplateForRubyFor: aSelector
-
-
versionMethodTemplateForSmalltalk
-
-
versionMethodTemplateForSmalltalkFor: aSelector
-
source code access
-
checkinClass: aClass fileName: classFileName directory: packageDir module: moduleDir logMessage: logMessage
-
checkin of a class into the source repository.
Return true if ok, false if not.
-
checkinClass: aClass fileName: classFileName directory: packageDir module: moduleDir logMessage: logMessage force: force
-
checkin of a class into the source repository.
Return true if ok, false if not.
-
checkinClass: aClass logMessage: logMessage
-
checkin of a class into the source repository.
Return true if ok, false if not.
-
getFile: fileName revision: revision directory: packageDir module: moduleDir
-
-
getMostRecentSourceStreamForClassNamed: aClassName
-
given a class, return an open stream to its most recent source
(not knowing anything about its version).
Used when autoloading classes.
-
getMostRecentSourceStreamForClassNamed: aClassName inPackage: forcedPackage
-
given a class, return an open stream to its most recent source
(not knowing anything about its version).
Used when autoloading classes or to compare a classes source with the most
recent found in the repostitory.
The forcePackage argument passes the classes package information
and is only required when autoloading or when the class is not already
present (i.e. there is no way to extract the package info).
If nil, the package is extracted from the class - which must exist.
-
getMostRecentSourceStreamForFile: aFileName inPackage: aPackage
-
given a filename, return an open stream to its most recent contents
(not knowing anything about its version).
Used when autoloading extensions or to compare a classes source with the most
recent found in the repostitory.
-
getSourceStreamFor: aClass
-
extract a classes source code and return an open readStream on it.
The classes source code is extracted using the revision and the sourceCodeInfo,
which itself is extracted from the classes packageString.
-
getSourceStreamFor: aClass revision: aRevisionStringOrNil
-
extract a classes source code and return an open readStream on it.
A revision of nil selects the current (in image) revision.
The classes source code is extracted using the revision and the sourceCodeInfo,
which itself is extracted from the classes packageString.
-
loadPackageWithId: aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded
-
Should be redefined by sub classes.
Return true if loaded, false otherwise.
-
streamForFile: fileName revision: revision directory: packageDir module: moduleDir
-
source code administration
-
ensureDollarsInVersionMethod: aString
-
given the source code of my version method, ensure that it contains dollars for
proper keyword expansion
-
ensureKeywordExpansionWith: aCharacter inVersionMethod: aString
-
given the source code of my version method, ensure that it contains aCharacter for
proper keyword expansion
-
ensureNoDollarsInVersionMethod: aString
-
given the source code of another manager's version method, ensure that it does NOT
contain dollars and add $§ instead, to avoid that CVS expands keywords in it
-
fileOutSourceCodeOf: aClass on: aStream
-
-
fileOutSourceCodeOf: aClass on: aStream withTimeStamp: withTimeStamp withInitialize: withInitialize withDefinition: withDefinition methodFilter: methodFilter
-
-
getExistingContainersInModule: aModule directory: aPackage
-
return a collection containing the names of existing containers
** This method raises an error - it must be redefined in concrete classes **
-
getExistingDirectoriesInModule: aModule
-
return a collection containing the names of existing packages
** This method raises an error - it must be redefined in concrete classes **
-
getExistingModules
-
return a collection containing the names of existing modules
** This method raises an error - it must be redefined in concrete classes **
-
initialRCSRevisionStringFor: aClass in: dir container: fileName
-
return a string usable as initial revision string
-
newestRevisionInFile: classFileName directory: packageDir module: moduleDir
-
return the newest revision found in a container.
Return nil on failure.
-
newestRevisionLogEntryOf: aClass
-
return the newest revisions log found in the repository.
Return nil on failure.
-
newestRevisionOf: aClass
-
return the newest revision (as string) found in the repository.
Return nil on failure.
-
revisionInfoFromRCSString: aString
-
return a dictionary filled with revision info.
This extracts the relevant info from aString.
-
revisionInfoFromString: aString
-
return a dictionary filled with revision info.
This extracts the relevant info from aString.
** This method raises an error - it must be redefined in concrete classes **
-
revisionLogOf: aClass
-
return info about the repository container and
the revisionlog as a collection of revision entries.
Return nil on failure.
The returned information is a structure (IdentityDictionary)
filled with:
#container -> the RCS container file name
#filename -> the actual source file name
#newestRevision -> the revisionString of the newest revision
#numberOfRevisions -> the number of revisions in the container
#revisions -> collection of per-revision info
per revision info consists of one record per revision:
#revision -> the revision string
#author -> who checked that revision into the repository
#date -> when was it checked in
#state -> the RCS state
#numberOfChangedLines -> the number of changed line w.r.t the previous
revisions are ordered newest first
(i.e. the last entry is for the initial revision; the first for the most recent one)
-
revisionLogOf: aClass fromRevision: rev1
-
return info about the repository container and
(part of) the revisionlog as a collection of revision entries.
Return nil on failure.
The returned information is a structure (IdentityDictionary)
filled with:
#container -> the RCS container file name
#filename -> the actual source file name
#newestRevision -> the revisionString of the newest revision
#numberOfRevisions -> the number of revisions in the container
#revisions -> collection of per-revision info (see below)
for some classes, additional info is returned:
#renamed -> true if the class has been renamed or copied
and the sourceInfo is from the previous one
#expectedFileName -> the filename we would expect (i.e. for the new class)
rev1 specifies from which revisions a logEntry is wanted:
If rev1 is nil, the first revision is the initial revision
otherwise, the log starts with that revision.
per revision info consists of one record per revision:
#revision -> the revision string
#author -> who checked that revision into the repository
#date -> when was it checked in
#state -> the RCS state
#numberOfChangedLines -> the number of changed line w.r.t the previous
revisions are ordered newest first
(i.e. the last entry is for the initial revision;
the first for the most recent one)
-
revisionLogOf: aClass fromRevision: rev1 toRevision: rev2
-
return info about the repository container and
(part of) the revisionlog as a collection of revision entries.
Return nil on failure.
The returned information is a structure (IdentityDictionary)
filled with:
#container -> the RCS container file name
#filename -> the actual source file name
#newestRevision -> the revisionString of the newest revision
#numberOfRevisions -> the number of revisions in the container
#revisions -> collection of per-revision info (see below)
for some classes, additional info is returned:
#renamed -> true if the class has been renamed or copied
and the sourceInfo is from the previous one
#expectedFileName -> the filename we would expect (i.e. for the new class)
rev1 / rev2 specify from which revisions a logEntry is wanted:
If rev1 is nil, the first revision is the initial revision
otherwise, the log starts with that revision.
If rev2 is nil, the last revision is the newest revision
otherwise, the log ends with that revision.
If both are nil, no logEntries are extracted (i.e. only the header).
per revision info consists of one record per revision:
#revision -> the revision string
#author -> who checked that revision into the repository
#date -> when was it checked in
#state -> the RCS state
#numberOfChangedLines -> the number of changed line w.r.t the previous
revisions are ordered newest first
(i.e. the last entry is for the initial revision;
the first for the most recent one)
-
revisionLogOf: aClass fromRevision: rev1 toRevision: rev2 finishAfter: maxCountOrNil
-
return info about the repository container and
(part of) the revisionlog as a collection of revision entries.
Return nil on failure.
The returned information is a structure (IdentityDictionary)
filled with:
#container -> the RCS container file name
#filename -> the actual source file name
#newestRevision -> the revisionString of the newest revision
#numberOfRevisions -> the number of revisions in the container
#revisions -> collection of per-revision info (see below)
for some classes, additional info is returned:
#renamed -> true if the class has been renamed or copied
and the sourceInfo is from the previous one
#expectedFileName -> the filename we would expect (i.e. for the new class)
rev1 / rev2 specify from which revisions a logEntry is wanted:
If rev1 is nil, the first revision is the initial revision
otherwise, the log starts with that revision.
If rev2 is nil, the last revision is the newest revision
otherwise, the log ends with that revision.
If both are nil, no logEntries are extracted (i.e. only the header).
per revision info consists of one record per revision:
#revision -> the revision string
#author -> who checked that revision into the repository
#date -> when was it checked in
#state -> the RCS state
#numberOfChangedLines -> the number of changed line w.r.t the previous
revisions are ordered newest first
(i.e. the last entry is for the initial revision;
the first for the most recent one)
-
revisionLogOf: aClass numberOfRevisions: numRevisions
-
return info about the repository container and
(part of) the revisionlog (numRevisions newest revisions)
as a collection of revision entries.
Return nil on failure.
The returned information is a structure (IdentityDictionary)
filled with:
#container -> the RCS container file name
#filename -> the actual source file name
#newestRevision -> the revisionString of the newest revision
#numberOfRevisions -> the number of revisions in the container (nil for all)
#revisions -> collection of per-revision info (see below)
for some classes, additional info is returned:
#renamed -> true if the class has been renamed or copied
and the sourceInfo is from the previous one
#expectedFileName -> the filename we would expect (i.e. for the new class)
rev1 / rev2 specify from which revisions a logEntry is wanted:
If rev1 is nil, the first revision is the initial revision
otherwise, the log starts with that revision.
If rev2 is nil, the last revision is the newest revision
otherwise, the log ends with that revision.
If both are nil, no logEntries are extracted (i.e. only the header).
per revision info consists of one record per revision:
#revision -> the revision string
#author -> who checked that revision into the repository
#date -> when was it checked in
#state -> the RCS state
#numberOfChangedLines -> the number of changed line w.r.t the previous
#logMessage -> the checkIn log message
revisions are ordered newest first
(i.e. the last entry is for the initial revision;
the first for the most recent one)
-
revisionLogOfContainer: classFileName directory: packageDir module: moduleDir
-
return info about the repository container and
(part of) the revisionlog as a collection of revision entries.
Return nil on failure.
The returned information is a structure (IdentityDictionary)
filled with:
#container -> the RCS container file name
#filename -> the actual source file name
#newestRevision -> the revisionString of the newest revision
#numberOfRevisions -> the number of revisions in the container
#revisions -> collection of per-revision info (see below)
per revision info consists of one record per revision:
#revision -> the revision string
#author -> who checked that revision into the repository
#date -> when was it checked in
#state -> the RCS state
#numberOfChangedLines -> the number of changed line w.r.t the previous
revisions are ordered newest first
(i.e. the last entry is for the initial revision;
the first for the most recent one)
-
revisionLogOfContainer: fileName module: moduleDir directory: packageDir fromRevision: rev1 toRevision: rev2
-
return info about the repository container and
(part of) the revisionlog as a collection of revision entries.
Return nil on failure.
The returned information is a structure (IdentityDictionary)
filled with:
#container -> the RCS container file name
#filename -> the actual source file name
#newestRevision -> the revisionString of the newest revision
#numberOfRevisions -> the number of revisions in the container
#revisions -> collection of per-revision info (see below)
for some classes, additional info is returned:
#renamed -> true if the class has been renamed or copied
and the sourceInfo is from the previous one
#expectedFileName -> the filename we would expect (i.e. for the new class)
rev1 / rev2 specify from which revisions a logEntry is wanted:
If rev1 is nil, the first revision is the initial revision
otherwise, the log starts with that revision.
If rev2 is nil, the last revision is the newest revision
otherwise, the log ends with that revision.
If both are nil, no logEntries are extracted (i.e. only the header).
per revision info consists of one record per revision:
#revision -> the revision string
#author -> who checked that revision into the repository
#date -> when was it checked in
#state -> the RCS state
#numberOfChangedLines -> the number of changed line w.r.t the previous
revisions are ordered newest first
(i.e. the last entry is for the initial revision;
the first for the most recent one)
-
revisionsOf: aClass
-
return a collection of revisions (as strings) found in the repository.
The most recent (newest) revision will be the first in the list.
Return nil on failure.
-
withSourceRewriteHandlerDo: aBlock
-
-
writeHistoryLogSince: timeGoal filterSTSources: filterSTSourcesBoolean filterUser: userFilter filterRepository: repositoryFilter filterModules: moduleFilter filterProjects: projectFilterArg to: aStream
-
send a full historyLog to some stream.
This walks over all possible repository roots.
-
writeHistoryLogSince: timeGoal filterSTSources: filter filterUser: userFilter filterRepository: repositoryFilter filterModules: moduleFilter to: aStream
-
send a full historyLog to some stream.
This walks over all possible repository roots.
-
writeHistoryLogSince: timeGoal filterSTSources: filter filterUser: userFilter filterRepository: repositoryFilter to: aStream
-
send a full historyLog to some stream.
This walks over all possible repository roots.
-
writeHistoryLogSince: timeGoal filterSTSources: filter filterUser: userFilter to: aStream
-
send a full historyLog to some stream.
This walks over all possible repository roots.
-
writeHistoryLogSince: timeGoal filterSTSources: filter to: aStream
-
send a repositories historyLog to some stream
-
writeHistoryLogSince: timeGoal to: aStream
-
send a repositories historyLog to some stream
-
writeRevisionLogMessagesFrom: log to: aStream
-
helper; send the revisionlog to aStream
-
writeRevisionLogMessagesFrom: log withHeader: header to: aStream
-
helper; send the revisionlog to aStream
-
writeRevisionLogOf: aClass fromRevision: rev1 toRevision: rev2 finishAfter: maxCount to: aStream
-
extract a classes log and append it to aStream.
-
writeRevisionLogOf: aClass fromRevision: rev1 toRevision: rev2 to: aStream
-
extract a classes log and append it to aStream.
-
writeRevisionLogOf: aClass short: shortOrNot to: aStream
-
extract a classes log and append it to aStream.
-
writeRevisionLogOf: aClass to: aStream
-
extract a classes log and append it to aStream.
subclass responsibility
-
reportHistoryLogSince: timeGoal filterSTSources: filter filterUser: userFilter filterRepository: repositoryFilter filterModules: moduleFilter inTo: aBlock
-
** This method raises an error - it must be redefined in concrete classes **
testing
-
isCVS
-
-
isSVN
-
-
isSmallTeam
-
-
isStore
-
|