|
Class: FileBasedSourceCodeManager
Object
|
+--AbstractSourceCodeManager
|
+--FileBasedSourceCodeManager
- Package:
- stx:libbasic3
- Category:
- System-SourceCodeManagement
- Version:
- rev:
1.18
date: 2021/01/20 13:13:12
- user: cg
- file: FileBasedSourceCodeManager.st directory: libbasic3
- module: stx stc-classLibrary: libbasic3
A simple file based sourceCodeManager, which saves versions in a local directory.
Versions will be stored as filename.st.vNr (i.e. Foo.st.1, Foo.st.2, etc.)
This is more an example of the protocol which needs to be implemented,
than a real manager (although it may be useful for tiny private projects or classroom examples)
copyrightCOPYRIGHT (c) 2011 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.
accessing
-
getRepositoryPathForModule: aModuleName
-
internal: used when accessing a source repository.
Return the path to the top directory for a particular module.
If no specific path was defined for that module, return the value of
the global (fallBack) repositoryPath.
Nil is returned if no repository is available.
-
knownModules
-
return the modules, we currently know
-
repositoryInfoPerModule
-
return the dictionary, which associates repository paths to module names.
If no entry is contained in this dictionary for some module,
the default path will be used.
-
repositoryInfoPerModule: aDictionary
-
set the dictionary, which associates repository paths to module names.
If no entry is contained in this dictionary for some module,
the default path will be used.
-
repositoryPath
-
return the path of the default repository
-
repositoryPath: aPath
-
set the path of the default repository
queries
-
defaultRepositoryPath
-
-
enabled
-
false.
-
isContainerBased
-
true, if the SCM uses some kind of source container (,v files).
False, if it is like a database or filesystem.
-
isResponsibleForPackage: aString
-
(comment from inherited method)
Returns true if the manager can handle source code for given package.
Answering true does not imply that receiver is configured default
manager for that package, it only means that it has a repository
configured for given package.
-
managerTypeName
-
(comment from inherited method)
Answers version manager name suitable for UI,
i,e., CVS, SubVersion, Perforce
-
nameOfVersionMethodForExtensions
-
(comment from inherited method)
that is the old name; now, we use extensionsVersion_<SCM>
-
nameOfVersionMethodInClasses
-
(comment from inherited method)
that is the old name; now, we use version_<SCM>
-
repositoryNameForPackage: packageId
-
superclass AbstractSourceCodeManager class says that I am responsible to implement this method
-
settingsApplicationClass
-
link to my settings application (needed for the settings dialog
-
supportsCheckinLogMessages
-
no, log-messages are not supported (I am too stupid)
saving
-
savePreferencesOn: aStream
-
source code administration
-
checkForExistingContainer: fileName inModule: moduleName directory: packageDirName
-
check for a container to exist. Return a boolean result.
-
checkForExistingModule: moduleDir
-
check for a package directory to be present
-
checkForExistingModule: moduleDir directory: packageDir
-
check for a package directory to be present
-
checkinClass: aClass fileName: classFileName directory: packageDir module: moduleDir source: sourceFile logMessage: logMessage force: force
-
Return true if ok, false if not.
-
createModule: moduleDir
-
create a module directory
-
createModule: moduleDir directory: packageDir
-
create a package directory
-
initialRevisionStringFor: aClass inModule: moduleDir directory: packageDir container: fileName
-
return a string usable as initial revision string
-
moduleDirectoryFor: moduleDir
-
a modules directory as filename
-
packageDirectoryForModule: moduleDir package: package
-
a packages directory as filename
-
revisionInfoFromString: aString
-
return a VersionInfo object filled with revision info.
This extracts the relevant info from aString.
Usage example(s):
self revisionInfoFromString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826'
|
-
revisionLogOf: clsOrNil fromRevision: rev1OrNil toRevision: rev2OrNil numberOfRevisions: limitOrNil fileName: classFileName directory: packageDir module: moduleDir
-
(comment from inherited method)
Return info about the repository container and (part of) the revisionlog as a collection
of revision entries. Return nil on failure.
This must be implemented by a concrete source-code manager
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 container file name (for container-based SCMs)
#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 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)
Attention: if state = 'dead' that revision is no longer valid.
-
streamForClass: aClass fileName: classFileName revision: revision directory: packageDir module: moduleDir cache: doCache
-
(comment from inherited method)
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.
|