|
Class: DataBaseSourceCodeManager
Object
|
+--AbstractSourceCodeManager
|
+--DataBaseSourceCodeManager
- Package:
- stx:libbasic3
- Category:
- System-SourceCodeManagement
- Version:
- rev:
1.22
date: 2023/12/08 09:12:52
- user: cg
- file: DataBaseSourceCodeManager.st directory: libbasic3
- module: stx stc-classLibrary: libbasic3
A simple database sourceCodeManager, which saves versions in a relational db
unfinished
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
-
getRepositoryDBForModule: aModuleName
-
internal: used when accessing a source repository.
Return the db-name for a particular module.
If no specific db was defined for that module, return the value of
the global (fallBack) repositoryDB.
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.
-
repositoryName
-
return the default repository
-
repositoryName: aDBSpec
-
set the default repository
-
utilities
-
Returns a 'utilities' object that can be used by tools.
private
-
closeAllCachedConnections
-
-
dbHandleForModule: aModuleName
-
-
openDB: aDBName
-
-
openODBC: dbSpec
-
-
openSQLite: dbSpec
-
private-saving
-
checkInClassAndCollectManifestOf: aClass db: dbConnection
-
check in a class; write one record for the definition,
then one for each method.
Return a manifest, which lists each save chunk's key.
-
insertChunk: chunkData key: key db: dbConnection
-
already there?
-
keyForChunk: aString
-
chunks are keyed by their sha1 hash value.
This has the advantage, that:
- the key alone shows if anything has changed,
- no new record is required if a chunk is unchanged,
- going back to an old version automatically reuses/refers to the old chunk,
- two independently changed methods will generate the same key
-
manifestOfStoredClassDefinitionOf: aClass db: dbConnection
-
save a class definition;
return a manifest line
-
manifestOfStoredMethod: aMethod selector: aSymbol meta: isMeta db: dbConnection
-
save a method;
return a manifest line
-
savePreferencesOn: aStream
-
queries
-
defaultRepositoryName
-
'<db-type>:[<user>[.<password>]@][<host>]<db-name>[:<table-name>]'
-
enabled
-
false.
-
getDBNameForModule: anString
-
for now, one repository for all modules
-
initialRevisionString
-
-
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
-
versionInfoClass
-
source code administration
-
basicCheckinClass: aClass fileName: classFileName directory: packageDir module: moduleDir logMessage: logMessage force: force
-
low level checkin of a class into the source repository.
Does not deal with any version method updates.
Return true if ok, false if not.
-
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; return true, if it does
-
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
-
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 SymbolicVersion: foo'
|
-
revisionLogOf: clsOrNil fromRevision: rev1OrNil toRevision: rev2OrNil numberOfRevisions: limitOrNil fileName: classFileName directory: packageDir module: moduleDir
-
|info log targetDir count newestRevision|
-
streamForClass: aClass fileName: classFileName revision: revision directory: packageDir module: moduleDir cache: doCache
-
|targetDir oldFile|
-
updateVersionMethodOf: aClass for: newRevisionString
-
helper for the checkin procedure.
Update my #version_XXX method, to now return newRevisionString.
DBVersionInfo
|