eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'CVSSourceCodeManager':

Home

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

Class: CVSSourceCodeManager


Inheritance:

   Object
   |
   +--AbstractSourceCodeManager
      |
      +--CVSSourceCodeManager

Package:
stx:libbasic3
Category:
System-SourceCodeManagement
Version:
rev: 1.628 date: 2024/04/09 13:16:49
user: stefan
file: CVSSourceCodeManager.st directory: libbasic3
module: stx stc-classLibrary: libbasic3

Description:


SourceCodeManager which accesses the sourcecode through cvs.
It requires the shell environment variable CVSROOT to be set
to the top of the repository tree. (or alternatively, the CVSRoot
variable being set by a private.rc file).
Under that top, for each module (especially the stx module itself),
a subdirectory containing that modules directories must exist.

If not specified otherwise, the module defaults to 'stx'.
If a class has its home in another module, it has to be compiled
with a corresponding entry in the package string (see below).
Within a module, classes are organized in classlibraries, and the corresponding
source code is found in various subdirectories of CVSROOT. The directories
name can also be provided by the package string - if not, it defaults to the
libraries name.
The package string controls all this, and is REQUIRED in order for the sourceCodeManager
to be able to retrieve a classes source.
The package strings format is:
    '...any infotext....(sourceCodeInfo)'
the sourceCOdeInfo consists of multiple entries, separated by colons.
The following formats are allowed:
    (libraryName)                   - module defaults to 'stx'; directory to the name of the library
    (foo/bar/x)                     - module defaults to 'stx'; dir is 'foo/bar/x'; library name defaults to x
    (module:directory:libname)      - specifies all components
The first formats are intermediate, for backward compatibility. We urge everyone
to use the last format (by changing the Make.proto files and add a -P flag to
the stc compiler flags (see libbasic/Make.proto as an example).

Notice, that the sourceCodeManager is (currently) only consulted, if no
source subdirectory exists, or no source file is found there. If it does exist,
that one is supposed to contain an up-to-date version of the classes source
(this is temporary - in the future the probe order will be reversed, trying
 the source repository first).
The source directory is required for systems which do NO source code control.

Setup:
    - make certain, that the commands 'cvs' and 'co' are available on your system.
    - add setup for the CVSROOT environment variable to your .bashrc / .login / .profile
    - Make certain that either no local source directory exists, or it is empty or it contains
      only source code for files NOT found in the repository (this will not be required in future versions).

Caveat:
    currently, the rcs container is accessed directly, since cvs mangles the file's ident-string and
    thus does not correctly recreate the original file (all source is offset by some characters w.r.t. the
    compiled file).
    Therefore, server-mode CVS is not supported.

Comment:
    The code here is a copy-paste mess; it definitely needs some cleanup...

[class variables:]
    CVSTempDir      <String | nil>  where a directory tree is
                                    generated temporarily for checkin/checkout
                                    (default is nil -> systems tmp-dir)

    CVSRoot         <String>        the CVS root. Imported from the
                                    CVSROOT shell variable.

    RemoteCVS       <Boolean>       if true, remote CVS access is used
                                    (i.e. via a socket to a CVS server).
                                    if false, disk access is used;
                                    files in CVSRoot must be accessible.

    CVSWorkDirectory                not yet supported/implemented.
                                    PLANNED: name of a directory hierarchy,
                                    which is kept in sync with the current
                                    version.

    CVSBinDir                       where the CVS commands are found

    CVSModuleRoots  <Directory>     per-module roots.
                                    If empty, or no entry is found for a
                                    module is found, CVSRoot is used.
                                    Otherwise, specifies a per-module CVSRoot.
                                    (allows multiple CVS hierarchies)

copyright

COPYRIGHT (c) 1995 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:

accessing
o  CVSBranchPerPackage

o  CVSCommitOptions

o  CVSCommitOptions: aString

o  CVSUpdateOptions

o  CVSUpdateOptions: aString

o  cvsAdditionalArguments
return the name of the cvs executable.

o  cvsAdditionalArguments: aString
option to set additional arguments (eg. '--timeout 100', which some cvs version support)

o  cvsBinDirectory: ignoredString
ignored - for backward compatibility (to read old settings files)

o  cvsCommandTimeout
360

o  cvsCommandTimeout: aTimeDuration

o  cvsExecutable
return the name of the cvs executable.

o  cvsExecutable: aString
set the name of the cvs executable.

o  cvsTmpDirectory
return the name of the tmp repository.
That's the directory, where temporary files are created for checkin/checkout.
If nil, a directory under the system's default tempDirectory is used.

o  cvsTmpDirectory: aPathNameString
set the name of the tmp repository.
That's the directory, where temporary files are created for checkin/checkout.
If nil, the system's default tempDirectory is used.

o  knownModules
return the modules, we currently know

o  knownRepositories
return the modules, we currently know

o  recentTag
a place to remember recently set tags (to share between File and SystemBrowser)

Usage example(s):

     self recentTag

o  recentTag: aString
a place to remember recently set tags (to share between File and SystemBrowser)

o  recentTags
a place to remember recently set tags (to share between File and SystemBrowser)

o  repositoryForPackage: packageId
superclass AbstractSourceCodeManager class says that I am responsible to implement this method

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: aDictionary
set 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  repositoryName
return the name of the global repository.
This is used, if no per-module repository is defined.

o  repositoryName: aDirectoryName
set the name of the repository;
that's the name of the global CVSROOT directory, which is used
if no specific repository was defined for a module.
Can be used from an rc-script, to override the CVSROOT shell
variable setting.

o  repositoryName: aRepositoryName forModule: aModuleName
set the CVSROOT directory which provides the sources for all
classes in a particular module.
This can be used from an rc-script, to specify a repository
for a particular module.
If left unspecified, the global (i.e. fallBack) repository is used.

o  repositoryNameForModule: aModuleName
return the CVSROOT directory which provides the sources for all
classes in a particular module.
Nil is returned for unspecified moduleRoots; in this case,
the global (i.e. fallBack) repository will be used for source access.

o  repositoryNameForPackage: packageId
superclass AbstractSourceCodeManager class says that I am responsible to implement this method

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

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

o  repositoryNamesPerModule: aDictionary
set 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.

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

basic administration
o  createContainerFor: aClass inModule: moduleName directory: dirName container: fileName
create a new container & check into it an initial version of aClass

initialization
o  addExeptsPrivateRepositoryToModuleRoots

o  addExeptsPublicRepositoryToModuleRoots

o  disabledModules: aCollectionOfModuleNames
self disabledModules:#('stx' 'exept')
CVSSourceCodeManager classVarAt:#DisabledModules put:#('stx' 'exept')
CVSSourceCodeManager classVarAt:#DisabledModules put:nil

o  exeptsPrivateSTXRepositoryModuleRoot
the actual stx repository as used within exept.
Only valid within exept

o  exeptsPublicSTXRepositoryModuleRoot
the public repository, which is a read-only copy of the exept-internal repository.
Updated every night.

o  forgetDisabledModules

o  initCommands

o  initialize
check if $CVSROOT (the shell variable) or CVSRoot (the smalltalk global)
is set, check if cvs commands can be executed and install myself as the
SourceCodeManager if this works out ok

Usage example(s):

     AbstractSourceCodeManager initialize
     CVSSourceCodeManager initialize

Usage example(s):

     CVSRoot := '/files/CVS'.
     AbstractSourceCodeManager initialize.
     CVSSourceCodeManager initialize.

Usage example(s):

     CVSRoot := ':pserver:cg@cvs.bh.exept.de:/cvs/stx'.
     AbstractSourceCodeManager initialize.
     CVSSourceCodeManager initialize.
     SourceCodeManager := CVSSourceCodeManager.

o  initializeForRepository: aDirectoryName
set the global CVSROOT directory (i.e. the repositories name).
And reinitialize.
Can be used from the launcher to change/configure the repository.

Usage example(s):

     CVSSourceCodeManager initializeForRepository:'/files/CVS'
     CVSSourceCodeManager initializeForRepository:'ibm:/files/CVS'

o  possiblyAddExeptsPrivateRepositoryToModuleRoots
for exept's convenience: if this is a host in our domain,

misc operations
o  authorMappingFor: authorName
allows for author names to be mapped on the fly
when retrieving a revisionLog or other statistics.
Useful when a login name is changed, and you still want to
create reasonable logs

o  changeCVSRoot: newRootString inDirectoryTree: aDirectoryFilename
WARNING: read and understand before executing !
Change the CVS root to newRootString (something like:':pserver:user@cvs.bh.exept.de:/cvs/stx').
This is done by rewriting all files named CVS/Root below the given path.
aDirectoryFilename is recursively descended

Usage example(s):

OperatingSystem getLoginName
     self 
        changeCVSRoot:':pserver:',OperatingSystem getLoginName,'@cvs.bh.exept.de:/cvs/stx' 
        inDirectoryTree:'../../../stx'

     self 
        changeCVSRoot:':pserver:',OperatingSystem getLoginName,'@cvs.bh.exept.de:/cvs/stx' 
        inDirectoryTree:'..\..\..\exept'

     self 
        changeCVSRoot:':pserver:',OperatingSystem getLoginName,'@cvs.bh.exept.de:/cvs/stx' 
        inDirectoryTree:'..\..\..\cg'

private
o  checkOut: relativeFilename module: moduleDir in: tempdir
checkout realtiveFilename in tempdir

Usage example(s):

      self checkOut:'libbasic/Integer.st' module:'stx' in:'/tmp' asFilename

o  checkinTroubleDialog: title message: message log: log abortable: abortable option: optionTitle
trouble checking in - open a dialog

o  checkinTroubleDialog: title message: message log: log abortable: abortable option: optionTitle option2: optionTitle2

o  checkinTroubleDialog: title message: message log: log abortable: abortable option: optionTitle option2: optionTitle2 option3: optionTitle3
trouble checking in - open a dialog

o  createEntryFor: pathInRepository module: aModule in: aDirectory revision: rev date: date special: special overwrite: overwrite
create an CVS/Repository and CVS/Entries entry for filename.
If the path does not exist, it will be created
If overwrite is true, an existing entry will be overwritten.

Usage example(s):

        self createEntryFor:'foo/xxx/yyy' in:'foo/xxx' revision:'1.22' date:'dummy' special:''
        self createEntryFor:'foo/xxx/yyy' in:'foo/xxx' revision:'3.44' date:'new dummy' special:'special'

o  createLocalDirectory: packageDir inModule: moduleDir
create a local working directory for module/package.
To speed up things, we checkout the file '.cvsignore', to create
the whole tree. If the file is not present, we will create it as empty file.
Return the name of a temporary directory containing the package

Usage example(s):

     self createLocalDirectory:'libbasic' inModule:'stx'

o  createLocalDirectory: packageDir inModule: moduleDir with: fileToCheckout
create a local working directory for module/package, and checkout the
given file there.
Return the name of a temporary directory containing the package, or nil

Usage example(s):

     self createLocalDirectory:'libbasic' inModule:'stx'

o  createLocalDirectory: packageDir inModule: moduleDir with: fileToCheckout andDefaultContents: defaultContents
create a local working directory for module/package, and checkout the
given file there.
Return the name of a temporary directory containing the package, or nil

Usage example(s):

     self createLocalDirectory:'libbasic' inModule:'stx'

o  createTempDirectory: packageDir forModule: moduleDir
create a temp directory for checking out

o  cvsTimeString: timestamp
convert a Timestamp to a string suitable for the CVS/Entries file:

123456789012345678901234
Tue Dec 19 20:56:26 1995

Usage example(s):

     CVSSourceCodeManager cvsTimeString:(UtcTimestamp now)

o  executeCVSCommand: cvsCommand module: moduleName inDirectory: dir
execute command and prepend cvs command name and global options.
if dir ~= nil, execute command in that directory.
This also leads to a log-entry to be added to cvs's logfile.

o  executeCVSCommand: cvsCommand module: moduleName inDirectory: dir log: doLog
execute command and prepend cvs command name and global options.
if dir ~= nil, execute command in that directory.
The doLog argument, if false suppresses a logEntry to be added
in the cvs log file (used when reading / extracting history)

o  executeCVSCommand: cvsCommand module: moduleName inDirectory: dirArg log: doLog errorTo: errorStream
Modified (format): / 01-03-2021 / 19:44:03 / cg

o  executeCVSCommand: cvsCommand module: moduleName inDirectory: dirArg log: doLog outputTo: outStream errorTo: errorStream
execute command and prepend cvs command name and global options.
execute command in the dirArg directory.
The doLog argument, if false suppresses a logEntry to be added
in the cvs log file (used when reading / extracting history)

o  executeCVSCommand: cvsCommand module: moduleName inDirectory: dirArg log: doLog pipe: doPipe
execute command and prepend cvs command name and global options.
execute command in the dirArg directory.
The doLog argument, if false suppresses a logEntry to be added
in the cvs log file (used when reading / extracting history).
sigh: returns either a stream (if doPipe == true) or a boolean otherwise.

o  executeCVSCommand: cvsCommand module: moduleName inDirectory: dirArg log: doLog pipe: doPipe orElseOutputTo: outStreamOrNil errorTo: errorStreamOrNil
execute command and prepend cvs command name and global options.
execute command in the dirArg directory (or the current directory if dirArg is nil).
The doLog argument, if false suppresses a logEntry to be added
in the cvs log file (used when reading / extracting history).
sigh: returns either a stream (if doPipe == true) or a boolean otherwise.

o  executeCVSCommand: cvsCommand module: moduleNameOrNil inDirectory: dirArgOrNil timeout: timeoutOrNil log: doLog pipe: doPipe orElseOutputTo: outStreamOrNil errorTo: errorStreamOrNil
execute command and prepend cvs command name and global options.
execute command in the dirArg directory (or the current directory if dirArg is nil).
The doLog argument, if false suppresses a logEntry to be added
in the cvs log file (used when reading / extracting history).
sigh: returns either a stream (if doPipe == true) or a boolean otherwise.

o  fetchRevisionsFromRLogStream: inStream searchForKeyword: searchFor
helper for revisionsInModule*

o  fetchRevisionsFromRLogStream: inStream searchForKeyword: searchFor ignoreDeleted: ignoreDeleted
helper for revisionsInModule*

o  getCVSROOTForModule: aModuleName
internal: used when accessing a source repository.
Return the CVSROOT which provides the sources for a particular module.
If no specific root was defined for that module, return the value of
the global (fallBack) CVSRoot.
Nil is returned if no repository is available.

o  getCVSROOTsPerModule
return a dictionary, which associates CVSRoots to modules

o  import: moduleDir in: tempdir
import the existing tree in tempdir as repository

Usage example(s):

      |f d|
      f := 'stefan/dummy/fasel'.
      d := '/tmp/tt' asFilename construct:f.
      d directory recursiveMakeDirectory.
      d writeStream close.
      self import:'stefan' in:'/tmp/tt/stefan' asFilename

o  readRevisionLogEntryFromStream: inStream
read and parse a single revision info-entry from the cvs log output.
Return nil on end.

The returned information is a CVSVersionInfo object (used to be an IdentityDictionary)
filled with:
#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

o  releaseAndRemove: tempdir module: moduleDir outputTo: outputFilename
cleanup; release tree towards cvs and remove the temporary tree

o  repositoryTopDirectoryFromCVSRoot: aString
return the top of the repository (without remote prefix)

Usage example(s):

     CVSSourceCodeManager repositoryTopDirectoryFromCVSRoot:':pserver:stefan@ibm.exept.de:/archiv/cvs'
     CVSSourceCodeManager repositoryTopDirectoryFromCVSRoot:'exept:/files/CVS'
     CVSSourceCodeManager repositoryTopDirectoryFromCVSRoot:'/archiv/cvs'

o  repositoryTopDirectoryFromSCMRoot
return the top of the repository. This handles remote CVS connections
as well

o  revisionStringFromLog: log entry: entry forClass: aClass
given a log entry, extract a revision string

o  updatedRevisionStringOf: aClass forRevision: newRevision andUser: userName with: originalVersionString
update a revision string: take the original versionString,
and return a new version string with changed revisionNr, dateAndTime and author.
Used to synthetically generate a new version method without a need to consult the
cvs for an revision string after an update (which is slow, when done remote)

o  updatedRevisionStringOf: aClass forRevision: newRevision with: originalVersionString
update a revision string: take the original versionString,
and return a new version string with changed revisionNr.

o  use_rlog
OperatingSystem isMSWINDOWSlike not

queries
o  isResponsibleForPackage: aString
JV@2011-07-09: The real check is too slow. Cache needed here

o  managerTypeName
(comment from inherited method)
Answers version manager name suitable for UI,
i,e., CVS, SubVersion, Perforce

o  nameOfVersionMethodForExtensions

o  nameOfVersionMethodInClasses

o  settingsApplicationClass
link to my settings application (needed for the settings dialog

o  versionInfoClass

saving
o  savePreferencesOn: aStream

source code access
o  checkin: containerFilename text: someText directory: packageDir module: moduleDir logMessage: logMessage force: force onBranch: branchNameOrNil
enter some (source) code (which is someText)
into the source repository. If the force argument is true, no merge is done;
instead, the code is checked in as given (Dangerous).
Return true if ok, false if not.

o  checkinClass: cls fileName: classFileName directory: packageDir module: moduleDir source: sourceFileName logMessage: logMessage force: forceArg
(comment from inherited method)
checkin of a class into the source repository.
Return true if ok, false if not.

o  checkinClass: cls fileName: classFileName directory: packageDir module: moduleDir source: sourceFileName logMessage: logMessage force: forceArg asBranch: branchTag
enter a classes source code (which has been already filed out into sourceFileName)
into the source repository. If the force argument is true, no merge is done;
instead, the code is checked in as given (Dangerous).
Return true if ok, false if not.

If branchTag is notNil, the class is checked in on the branch if it already exists, or a branch for this tag is created.
(branch support does not work yet!)

Usage example(s):

^ self checkinClass:cls fileName:classFileName directory:packageDir module:moduleDir source:sourceFileName logMessage:logMsg force:force.

Usage example(s):

     SourceCodeManager checkinClass:Array logMessage:'testing only'

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.

o  checkoutModule: aModule directory: aPackage withTag: tagOrNil orTimestamp: timestampOrNil andDo: aBlock
check out everything from a package into a temporary directory.
If tagOrNil isNonNil, get the versions with that tag;
if timestampOrNil isNOnNil, get the version at that date;
otherwise, checkout the head.
Then evaluate aBlock, passing the name of that temp-directory.
Afterwards, the tempDir is removed.
Return true, if OK, false if any error occurred.

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  streamForClass: cls fileName: fileName revision: revision directory: packageDir module: moduleDir cache: cacheItArg
extract a source file and return an open readStream on it,
or nil if the extract failed. If revision is nil or (#newest), take
the latest; otherwise, a specific revisions source is extracted.
The cls argument is currently ignored, but may be used in future versions,
to validate the correct container against the class.
To check out a file (i.e. not a classes file), leave cls as nil and provide only a fileName.

source code administration
o  checkForExistingContainer: fileName inModule: moduleName directory: packageDirName
check for a container to exist. Return a boolean result.

Usage example(s):

     CVSSourceCodeManager 
        checkForExistingContainer:'Integer.st'
        inModule:'stx' 
        directory:'libbasic' 

     CVSSourceCodeManager 
        checkForExistingContainer:'AboutBox.st'
        inModule:'stx' 
        directory:'libtool' 

o  checkForExistingModule: moduleDir
check for a module to exist

Usage example(s):

     CVSSourceCodeManager checkForExistingModule:'stx'
     CVSSourceCodeManager checkForExistingModule:'DPU'
     CVSSourceCodeManager checkForExistingModule:'cg'  
     CVSSourceCodeManager checkForExistingModule:'aeg' 
     CVSSourceCodeManager checkForExistingModule:'foo'   

o  checkForExistingModule: moduleDir directory: directory
check for a package to exist

Usage example(s):

     CVSSourceCodeManager checkForExistingModule:'stx' package:'libbasic' 
     CVSSourceCodeManager checkForExistingModule:'aeg' package:'libProgram'  
     CVSSourceCodeManager checkForExistingModule:'foo' package:'libbasic' 
     CVSSourceCodeManager checkForExistingModule:'foo' package:'bar'   
     CVSSourceCodeManager checkForExistingModule:'cg' package:'private'   

o  createBranch: branchName forClasses: aCollectionOfClasses
create a branch

o  createBranch: branchName pathes: aCollectionOfPathNames
create a branch

o  createContainerFor: aClass inModule: moduleDir package: packageDir container: fileName
create a container - this does an initial checkin
(i.e. cvs add & cvs commit)

o  createContainerForText: someText inModule: moduleDir package: packageDir container: fileName
create a container - this does an initial checkin
(i.e. cvs add & cvs commit)

o  createModule: moduleName
create a module directory

o  createModule: moduleDirName directory: packageDirName
create a package directory

Usage example(s):

      self createModule:'stefan' package:'dummy1'

o  deleteSymbolicName: symbolicName path: pathInRepository
remove symbolicName from classFileName

Usage example(s):

        self deleteSymbolicName:'stable' path:'stx/libbasic/Array.st'
        self deleteSymbolicName:'testBLAbla' path:'stx/libbasic/Array.st'

o  filesWhereHeadIsNotTaggedAs: symbolicTag inModule: module
return lists of files which
do NOT have this tag on their head revision,
are not tagged at all with this tag
are not readable (?)
Module is one of stx, exept, etc. (i.e. a topLevel module)

o  getExistingContainersInModule: aModule directory: aPackage
return a list of existing containers.

Usage example(s):

     CVSSourceCodeManager getExistingContainersInModule:'stx' package:'libhtml'
     CVSSourceCodeManager getExistingContainersInModule:'cg'  package:'java'
     CVSSourceCodeManager getExistingContainersInModule:'exept' package:'osi'

o  getExistingDirectoriesInModule: aModule
return a list of existing directories.

Usage example(s):

     CVSSourceCodeManager getExistingDirectoriesInModule:'stx'
     CVSSourceCodeManager getExistingDirectoriesInModule:'cg'
     CVSSourceCodeManager getExistingDirectoriesInModule:'exept'

o  getExistingModules
return a list of existing modules

Usage example(s):

     CVSSourceCodeManager getExistingModules

o  listDirectories: cvsPath
return a list of all directories in cvsPath.
cvsPath is the path relative to the cvs root

Usage example(s):

     CVSSourceCodeManager listDirectories:nil
     CVSSourceCodeManager listDirectories:'stx'
     CVSSourceCodeManager listDirectories:'stx/libbasic'

o  listDirectoriesIn: cvsPath into: dirBlock nonDirectoriesInto: nonDirBlock
enumerate all directories and non-directories in cvsPath.
cvsPath is the path relative to the cvs root

o  listNonDirectories: cvsPath
return a list of all containers in cvsPath.
cvsPath is the path relative to the cvs root

Usage example(s):

     CVSSourceCodeManager listNonDirectories:nil
     CVSSourceCodeManager listNonDirectories:'stx'
     CVSSourceCodeManager listNonDirectories:'stx/libbasic'

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

Usage example(s):

     SourceCodeManager newestRevisionInFile:'Array.st' directory:'libbasic' module:'stx'       

o  newestRevisionsInModule: module directory: packageDir
return a list of filename-module associations for the containers in
a package directory.
Return nil on failure.

Usage example(s):

     SourceCodeManager 
        newestRevisionsInModule:'bosch' directory:'dapasx'   
     SourceCodeManager 
        newestRevisionsInModule:'stx' directory:'goodies/net/ssl'   
     SourceCodeManager 
        newestRevisionsInModule:'stx' directory:'goodies/net'   

o  pathesForClasses: aCollectionOfClasses
helper - collect the pathnames for a collection of classes

o  readRevisionLogFromStream: aCVSLogPipeStream headerOnly: headerOnly numRevisions: numRevisionsOrNil

o  removeContainer: fileName inModule: moduleDir directory: packageDir
remove a container

Usage example(s):

     SourceCodeManager checkForExistingContainer:'foo.st' inModule:'stx' directory:'private'. 

     SourceCodeManager removeContainer:'foo.st' inModule:'stx' directory:'private'

o  removeContainer: fileName inModule: moduleDir package: packageDir
remove a container

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

o  removeContainerInModule: moduleDir package: packageDir container: fileName
remove a container

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

o  reportHistoryLogSince: timeGoal filterSTSources: filterSTSourcesBool filterUser: userFilter filterRepository: filterRep filterModules: filterModules inTo: aBlock
process a full historyLog, evaluate aBlock for each entry, passing
each logs' info in a dictionary.
This walks over all possible repositories.
filterRep may be a collection of repository names (eg. 'stx', 'exept', 'phx' etc.) to only report changes made to one
of those repositories.
userFilter, if a non-nil string or stringCollection,
will filter only changes made by that user(s) (eg. 'sv' or #('sv' 'cg')).
filterModules, if non-empty, will only present changes in that module (eg. 'stx:libbasic')

o  reportHistoryLogSince: timeGoal filterSTSources: filter filterUser: userFilter filterRepository: filterRep inTo: aBlock
process a full historyLog, evaluate aBlock for each entry, passing
the logs info in a dictionary.
This walks over all possible repositories.
filterRep may be a collection of repository names
(i.e. 'stc', 'exept', 'phx' etc.) to only report changes made to one
of those repositories.
filterUser, if non-nil, will filter only changes made by that user.

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

Usage example(s):

     self revisionInfoFromString:(Array version_CVS)   
     self revisionInfoFromString:(stx_libbasic2 extensionsVersion_CVS)   

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

Usage example(s):

     self revisionInfoFromString:(Array version_CVS)   
     self revisionInfoFromString:(stx_libbasic2 extensionsVersion_CVS)   

o  revisionLogOf: clsOrNil fromRevision: firstRevOrNil toRevision: lastRevOrNil numberOfRevisions: numRevisionsOrNil fileName: classFileName directory: packageDirOrNil module: moduleDirOrNil
return info about the repository container and
(part of) the revisionlog as a collection of revision entries.
Return nil on failure.

If numRevisionsOrNil is notNil, it limits the number of revision records returned -
only numRevions of the newest revision infos will be collected.

The returned information is a structure (IdentityDictionary)
filled with:
#container -> the CVS container file name
#cvsRoot -> the CVS root (repository)
#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)

firstRevOrNil / lastRevOrNil specify from which revisions a logEntry is wanted:
-If firstRevOrNil is nil, the first revision is the initial revision
otherwise, the log starts with that revision.
-If lastRevOrNil is nil, the last revision is the newest revision
otherwise, the log ends with that revision.

-If both are nil, all logEntries are extracted.
-If both are 0 (not 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 lines w.r.t the previous (as string with +n -n)
#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)
Attention: if state = 'dead' that revision is no longer valid.

Usage example(s):

     SourceCodeManager revisionLogOf:Array
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:'1.43'
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:nil
     SourceCodeManager revisionLogOf:Array fromRevision:nil toRevision:'1.3'
     SourceCodeManager revisionLogOf:Array fromRevision:nil toRevision:nil
     SourceCodeManager revisionLogOf:Array fromRevision:0 toRevision:0
     SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' fromRevision:0 toRevision:0

o  revisionLogOfPackageInDirectory: packageDir module: moduleDir
The returned information is a list of structures (IdentityDictionary)
each filled with:
#container -> the CVS container file name
#cvsRoot -> the CVS root (repository)
#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)

firstRev / lastRef specify from which revisions a logEntry is wanted:
-If firstRev is nil, the first revision is the initial revision
otherwise, the log starts with that revision.
-If lastRef is nil, the last revision is the newest revision
otherwise, the log ends with that revision.

-If both are nil, all logEntries are extracted.
-If both are 0 (not 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 lines w.r.t the previous (as string with +n -n)
#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)
Attention: if state = 'dead' that revision is no longer valid.

Usage example(s):

     CVSSourceCodeManager revisionLogOfPackageInDirectory:'libbasic3' module:'stx'  

o  revisionsInModule: module directory: packageDir fromDate: aDateOrNilForNewest
return a list of filename-module associations for the containers in
a package directory. Return nil on failure.

Usage example(s):

     SourceCodeManager 
        revisionsInModule:'exept' directory:'osi/asn1' fromDate:(Date today subtractDays:7)
     SourceCodeManager 
        revisionsInModule:'exept' directory:'osi/asn1' fromDate:nil

o  revisionsInModule: module directory: packageDir taggedAs: symbolicName
return a list of filename-module associations for the containers in
a package directory. Return nil on failure.

Usage example(s):

     SourceCodeManager 
        revisionsInModule:'stx' directory:'libbasic2' taggedAs:'stable'

o  setSymbolicName: symbolicName asBranch: asBranch revision: rev overWrite: overWriteBool classes: aCollectionOfClasses
set a symbolicName for revision rev.
If rev is nil, set it for the head (most recent) revision.
If rev is 0, delete the symbolic name.
If overWriteBool is true, the symbolicName will be changed, even if it has already been set.
If overWriteBool is false, an error will be raised if symbolicName has already been set.

If filename is nil, the symbolicName for a whole package is set

Usage example(s):

     self setSymbolicName:'foo' revision:nil overWrite:false classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:nil overWrite:true classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:nil overWrite:true classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:'1.1' overWrite:true classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:0 overWrite:true classes:(Array with:True with:False)

o  setSymbolicName: symbolicNameArg asBranch: asBranch revision: rev overWrite: overWriteBool pathes: pathsInRepository
set a symbolicName for revision rev.
If rev is nil, set it for the head (most recent) revision.
If rev is 0, delete the symbolic name.
If overWriteBool is true, the symbolicName will be changed, even if it has already been set.
If overWriteBool is false, an error will be raised if symbolicName has already been set.
If multiple paths are given, the revision MUST be nil.

Usage example(s):

     self setSymbolicName:'stable' revision:nil overWrite:false path:'stx/libbasic/Array.st'
     self setSymbolicName:'stable' revision:nil overWrite:true path:'stx/libbasic/Array.st'

     self
        setSymbolicName:'test1'
        revision:nil
        overWrite:true
        path:'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st'

     self
        setSymbolicName:'test2'
        revision:nil
        overWrite:true
        pathes:#( 'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st'
                  'bosch/dapasx/datenbasis/DAPASX__ProjectSearch.st' )

     self
        setSymbolicName:'test2'
        revision:0
        overWrite:true
        pathes:#( 'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st'
                  'bosch/dapasx/datenbasis/DAPASX__ProjectSearch.st' )

o  setSymbolicName: symbolicName revision: rev overWrite: overWriteBool class: aClass
set a symbolicName for revision rev.
If rev is nil, set it for the head (most recent) revision.
If rev is 0, delete the symbolic name.
If overWriteBool is true, the symbolicName will be changed, even if it has already been set.
If overWriteBool is false, an error will be raised if symbolicName has already been set.

If filename is nil, the symbolicName for a whole package is set

Usage example(s):

     self setSymbolicName:'foo' revision:nil overWrite:false class:Array
     self setSymbolicName:'foo' revision:nil overWrite:true class:Array
     self setSymbolicName:'foo' revision:nil overWrite:true class:Array
     self setSymbolicName:'foo' revision:'1.1' overWrite:true class:Array
     self setSymbolicName:'foo' revision:0 overWrite:true class:Array

o  setSymbolicName: symbolicName revision: rev overWrite: overWriteBool classes: aCollectionOfClasses
set a symbolicName for revision rev.
If rev is nil, set it for the head (most recent) revision.
If rev is 0, delete the symbolic name.
If overWriteBool is true, the symbolicName will be changed, even if it has already been set.
If overWriteBool is false, an error will be raised if symbolicName has already been set.

If filename is nil, the symbolicName for a whole package is set

Usage example(s):

     self setSymbolicName:'foo' revision:nil overWrite:false classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:nil overWrite:true classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:nil overWrite:true classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:'1.1' overWrite:true classes:(Array with:True with:False)
     self setSymbolicName:'foo' revision:0 overWrite:true classes:(Array with:True with:False)

o  setSymbolicName: symbolicName revision: rev overWrite: overWriteBool path: pathInRepository
set a symbolicName for revision rev.
If rev is nil, set it for the head (most recent) revision.
If rev is 0, delete the symbolic name.
If overWriteBool is true, the symbolicName will be changed, even if it has already been set.
If overWriteBool is false, an error will be raised if symbolicName has already been set.

If filename is nil, the symbolicName for a whole package is set

Usage example(s):

     self setSymbolicName:'stable' revision:nil overWrite:false path:'stx/libbasic/Array.st'
     self setSymbolicName:'stable' revision:nil overWrite:true path:'stx/libbasic/Array.st'
     self setSymbolicName:'stable' revision:nil overWrite:true path:'stx/libbasic/Array.st'
     self setSymbolicName:'stable' revision:'1.1' overWrite:true path:'stx/libbasic/Array.st'

o  setSymbolicName: symbolicNameArg revision: rev overWrite: overWriteBool pathes: pathsInRepository
set a symbolicName for revision rev.
If rev is nil, set it for the head (most recent) revision.
If rev is 0, delete the symbolic name.
If overWriteBool is true, the symbolicName will be changed, even if it has already been set.
If overWriteBool is false, an error will be raised if symbolicName has already been set.

If filename is nil, the symbolicName for a whole package is set.
If multiple paths are given, the revision MUST be nil.

Usage example(s):

     self setSymbolicName:'stable' revision:nil overWrite:false path:'stx/libbasic/Array.st'
     self setSymbolicName:'stable' revision:nil overWrite:true path:'stx/libbasic/Array.st'

     self
        setSymbolicName:'test1'
        revision:nil
        overWrite:true
        path:'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st'

     self
        setSymbolicName:'test2'
        revision:nil
        overWrite:true
        pathes:#( 'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st'
                  'bosch/dapasx/datenbasis/DAPASX__ProjectSearch.st' )

     self
        setSymbolicName:'test2'
        revision:0
        overWrite:true
        pathes:#( 'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st'
                  'bosch/dapasx/datenbasis/DAPASX__ProjectSearch.st' )

o  standardRevisionStringFor: aClass inModule: moduleDir directory: packageDir container: fileName revision: revisionString
utility function: return a string usable as initial revision string

o  statusOf: clsOrNil fileName: classFileName directory: packageDirOrNil module: moduleDir
return info about the status of a repository container.
Return nil on failure.

The returned information is a structure (IdentityDictionary)
filled with:
#newestRevision -> the revisionString of the newest revision

This is much faster than revisionLog info (especially, if there are many revisions),
and all we need is a class's newest version number.

Usage example(s):

     SourceCodeManager statusOf:Array fileName:'Array.st' directory:'libbasic' module:'stx'  
     SourceCodeManager statusOf:Filename fileName:'Filename.st' directory:'libbasic' module:'stx'  
     SourceCodeManager statusOf:Tools::NewSystemBrowser fileName:'Tools__NewSystemBrowser.st' directory:'libtool' module:'stx'  

source code utilities
o  annotationsFor: clsOrNil fileName: classFileName directory: packageDir module: moduleDir
return info about who changed what and when.
Return nil on failure.

The returned information is a structure entry for each line
#revision -> version of last change
#author -> author
#date -> change date

Usage example(s):

     SourceCodeManager 
        annotationsFor:Array 
        fileName:'Array.st' directory:'libbasic' module:'stx'

Usage example(s):

     SourceCodeManager 
        annotationsFor:MenuPanel 
        fileName:'MenuPanel.st' directory:'libwidg2' module:'stx'

o  diffListFor: clsOrNil fileName: classFileNameArg directory: packageDir module: moduleDir revision1: rev1 revision2: rev2 cache: cacheIt
return diff info. This is supposed to return a standard diff-like
list of lines, representing the diffs between two revisions.
experimental (for ownershipGraph).
Here we ask cvs to give us the diff list

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

o  initialRevisionStringFor: aClass inModule: moduleDir directory: packageDir container: fileName
return a string usable as initial revision string

testing
o  isCVS


Private classes:

    CVSVersionInfo

Examples:


Default setup:
    This setup accesses all sources from a single repository: /files/CVS.
    Actually, this is the setup as used within eXept for development.

        CVSSourceCodeManager initializeForRepository:'/files/CVS'.


Dual repository setup:
    This accesses all ST/X standard classes' source from the /files/CVS
    repository, while your private classes are created in and accessed from
    '/files/myCVS'.
    This setup is useful, if you need revision management on the
    ST/X standard classes as well as for your own classes.
    In order to do this, you should (manually) check in all ST/X classes
    into a private repository WHILE preserving the original revision numbers.
    A shell-procedure similar to:

        for i in lib*/*.st
        do
            id=`ident $i`
            set $id
            rev=$3
            ci -r$rev <CVSDIR>/$i $i
        done

    should accomplish this.
    Now, that you have all ST/X files in your own repository (and with the
    original revision numbers), access is possible by defining CVSROOT
    as above. However, in order to have your own files being stored in
    another repository, you have to give a per-module repository.

    This defines the default repository (for your containers):

        CVSSourceCodeManager initializeForRepository:'/files/myCVS'.

    and this specifies a repository for all standard ST/X classes (in the stx module):

        CVSSourceCodeManager repositoryName:'/files/CVS' forModule:'stx'

Dual repository setup for eXept customers with a full licence
(these can access our in-house master repository, for convenient software update
 and uploading):
    All class sourcees under the 'stx' module (i.e. packageID is 'stx:*') can be accessed
    from the eXept cvs server (i.e. CVSROOT for them is :pserver:userName@exept.de:/files/CVS/stc).
    All local classes should be maintained in and accessed from a local cvs repository
    such as '/files/myCVS'.

    Then, tell the CVSSourceCodeManager about this;
    first the default repository:

        CVSSourceCodeManager initializeForRepository:'/files/myCVS'.

    and the repository for all standard ST/X classes (in the stx module):

        CVSSourceCodeManager repositoryName:':pserver:userName@exept.de:/files/CVS' forModule:'stx'


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:37:43 GMT