eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'AbstractSourceCodeManager':

Home

everywhere
www.exept.de
for:
[back]

Class: AbstractSourceCodeManager


Inheritance:

   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

Description:


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.


Class protocol:

accessing
o  availableManagers

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

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

o  cachingSources
return true, if source caching is enabled.
(see cacheDirectoryName for what that means)

o  cachingSources: aBoolean
enable/disable the caching of source files.
(see cacheDirectoryName for what that means)

o  defaultManager
return the default sourceCodeManager class

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

o  repositoryInfoPerModule: info
ignore here

o  repositoryName
return the name of the repository.
Since this is an abstract class, return nil (i.e. none)

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

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

o  workTreeDirectoryName
return the name of the workTree, which is kept in sync
with the current class versions. This is not yet implemented

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

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

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

o  streamForExtensionFile: fileName package: package directory: dir module: mod cache: doCache

basic administration
o  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 **

o  checkForExistingContainer: fileName inPackage: aPackage
check if a source-code container is present in a packages directory.

o  checkForExistingContainerForClass: aClass
check if a source-code container for a given class is present in the repository.

o  checkForExistingModule: moduleName
check for a module directory to be present

** This method raises an error - it must be redefined in concrete classes **

o  checkForExistingModule: moduleDir directory: packageDir
check for a package directory to be present

** This method raises an error - it must be redefined in concrete classes **

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

o  createModule: moduleName
create a new module directory

** This method raises an error - it must be redefined in concrete classes **

o  createModule: module directory: directory
create a new package directory

** This method raises an error - it must be redefined in concrete classes **

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

o  revisionLogOf: clsOrNil fromRevision: firstRev toRevision: lastRef fileName: classFileName directory: packageDir module: moduleDir

o  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
o  condenseSourceCache
remove all cached old versions (i.e. leave the newest only)

o  flushSourceCache
remove all cached versions

initialization
o  initCacheDirPath
initialize the name of the cacheDirectory.
This is:
<tempDir>/stx_sourceCache.

o  initialize
setup for no caching and no workTree

obsolete backward compatibility
o  checkForExistingContainerInModule: moduleDir directory: packageDir container: fileName

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

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

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

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

o  createModule: module package: package
create a new package directory

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

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

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

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

o  compileVersionMethod: methodName of: aClass for: newRevisionString

o  containerFromSourceInfo: info
given a sourceInfo, return the classes container

o  directoryFromContainerPath: containerPath forClass: aClass
given a full path as in an RCS header,
extract the directory (i.e. package).

o  directoryFromContainerPath: containerPath forPackage: packageID
given a full path as in an RCS header,
extract the directory (i.e. package).

o  directoryFromSourceInfo: info
given a sourceInfo, return the classes package directory

o  moduleFromContainerPath: containerPath forClass: aClass
given a full path as in an RCS header, extract the module.

o  moduleFromContainerPath: containerPath forPackage: packageID
given a full path as in an RCS header, extract the module.

o  moduleFromSourceInfo: info
given a sourceInfo, return the classes module directory

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

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

o  postCheckInClass: aClass
invoked after a checkIn

o  postCheckInExtensionsForPackage: aPackageId
invoked after a checkIn

o  reportError: msg

o  repositoryTopDirectory
return the name of the repository

o  revisionAfter: aRevisionString
generate the next revision number after the given number

o  sourceCacheDirectory
return the sourceCache directories name

o  sourceInfoOfClass: aClass
helper: return a classes sourceCodeInfo by extracting its
versionString components.

o  updateVersionMethodOf: aClass for: newRevisionString
helper for the checkin procedure.
Update my #version_XXX method, to now return newRevisionString.

queries
o  isExperimental

o  isResponsibleForModule: module

o  isResponsibleForPackage: apackage

o  isVersionMethodSelector: selector

o  nameOfVersionMethodForExtensions

o  nameOfVersionMethodInClasses

o  sourceCodeManagerForPackage: packageId

o  versionMethodTemplateForRuby

o  versionMethodTemplateForRubyFor: aSelector

o  versionMethodTemplateForSmalltalk

o  versionMethodTemplateForSmalltalkFor: aSelector

source code access
o  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.

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

o  checkinClass: aClass logMessage: logMessage
checkin of a class into the source repository.
Return true if ok, false if not.

o  getFile: fileName revision: revision directory: packageDir module: moduleDir

o  getMostRecentSourceStreamForClassNamed: aClassName
given a class, return an open stream to its most recent source
(not knowing anything about its version).
Used when autoloading classes.

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

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

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

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

o  loadPackageWithId: aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded
Should be redefined by sub classes.
Return true if loaded, false otherwise.

o  streamForFile: fileName revision: revision directory: packageDir module: moduleDir

source code administration
o  ensureDollarsInVersionMethod: aString
given the source code of my version method, ensure that it contains dollars for
proper keyword expansion

o  ensureKeywordExpansionWith: aCharacter inVersionMethod: aString
given the source code of my version method, ensure that it contains aCharacter for
proper keyword expansion

o  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

o  fileOutSourceCodeOf: aClass on: aStream

o  fileOutSourceCodeOf: aClass on: aStream withTimeStamp: withTimeStamp withInitialize: withInitialize withDefinition: withDefinition methodFilter: methodFilter

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

o  getExistingDirectoriesInModule: aModule
return a collection containing the names of existing packages

** This method raises an error - it must be redefined in concrete classes **

o  getExistingModules
return a collection containing the names of existing modules

** This method raises an error - it must be redefined in concrete classes **

o  initialRCSRevisionStringFor: aClass in: dir container: fileName
return a string usable as initial revision string

o  newestRevisionInFile: classFileName directory: packageDir module: moduleDir
return the newest revision found in a container.
Return nil on failure.

o  newestRevisionLogEntryOf: aClass
return the newest revisions log found in the repository.
Return nil on failure.

o  newestRevisionOf: aClass
return the newest revision (as string) found in the repository.
Return nil on failure.

o  revisionInfoFromRCSString: aString
return a dictionary filled with revision info.
This extracts the relevant info from aString.

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

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

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

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

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

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

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

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

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

o  withSourceRewriteHandlerDo: aBlock

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

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

o  writeHistoryLogSince: timeGoal filterSTSources: filter filterUser: userFilter filterRepository: repositoryFilter to: aStream
send a full historyLog to some stream.
This walks over all possible repository roots.

o  writeHistoryLogSince: timeGoal filterSTSources: filter filterUser: userFilter to: aStream
send a full historyLog to some stream.
This walks over all possible repository roots.

o  writeHistoryLogSince: timeGoal filterSTSources: filter to: aStream
send a repositories historyLog to some stream

o  writeHistoryLogSince: timeGoal to: aStream
send a repositories historyLog to some stream

o  writeRevisionLogMessagesFrom: log to: aStream
helper; send the revisionlog to aStream

o  writeRevisionLogMessagesFrom: log withHeader: header to: aStream
helper; send the revisionlog to aStream

o  writeRevisionLogOf: aClass fromRevision: rev1 toRevision: rev2 finishAfter: maxCount to: aStream
extract a classes log and append it to aStream.

o  writeRevisionLogOf: aClass fromRevision: rev1 toRevision: rev2 to: aStream
extract a classes log and append it to aStream.

o  writeRevisionLogOf: aClass short: shortOrNot to: aStream
extract a classes log and append it to aStream.

o  writeRevisionLogOf: aClass to: aStream
extract a classes log and append it to aStream.

subclass responsibility
o  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
o  isCVS

o  isSVN

o  isSmallTeam

o  isStore



ST/X 6.1.1; WebServer 1.620 at exept:8081; Thu, 17 May 2012 15:46:36 GMT