eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DataBaseSourceCodeManager':

Home

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

Class: DataBaseSourceCodeManager


Inheritance:

   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

Description:


A simple database sourceCodeManager, which saves versions in a relational db

unfinished

copyright

COPYRIGHT (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.

Class protocol:

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

o  knownModules
return the modules, we currently know

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

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

o  repositoryName
return the default repository

o  repositoryName: aDBSpec
set the default repository

o  utilities
Returns a 'utilities' object that can be used by tools.

private
o  closeAllCachedConnections

o  dbHandleForModule: aModuleName

o  openDB: aDBName

o  openODBC: dbSpec

o  openSQLite: dbSpec

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

o  insertChunk: chunkData key: key db: dbConnection
already there?

o  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

o  manifestOfStoredClassDefinitionOf: aClass db: dbConnection
save a class definition;
return a manifest line

o  manifestOfStoredMethod: aMethod selector: aSymbol meta: isMeta db: dbConnection
save a method;
return a manifest line

o  savePreferencesOn: aStream

queries
o  defaultRepositoryName
'<db-type>:[<user>[.<password>]@][<host>]<db-name>[:<table-name>]'

o  enabled
false.

o  getDBNameForModule: anString
for now, one repository for all modules

o  initialRevisionString

o  isContainerBased
true, if the SCM uses some kind of source container (,v files).
False, if it is like a database or filesystem.

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

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

o  nameOfVersionMethodForExtensions
(comment from inherited method)
that is the old name; now, we use extensionsVersion_<SCM>

o  nameOfVersionMethodInClasses
(comment from inherited method)
that is the old name; now, we use version_<SCM>

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

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

o  versionInfoClass

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

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

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

o  checkForExistingModule: moduleDir directory: packageDir
check for a package directory to be present; return true, if it does

o  checkinClass: aClass fileName: classFileName directory: packageDir module: moduleDir source: sourceFile logMessage: logMessage force: force
Return true if ok, false if not.

o  createModule: moduleDir
create a module directory

o  createModule: moduleDir directory: packageDir
create a package directory

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

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

o  revisionLogOf: clsOrNil fromRevision: rev1OrNil toRevision: rev2OrNil numberOfRevisions: limitOrNil fileName: classFileName directory: packageDir module: moduleDir
|info log targetDir count newestRevision|

o  streamForClass: aClass fileName: classFileName revision: revision directory: packageDir module: moduleDir cache: doCache
|targetDir oldFile|

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


Private classes:

    DBVersionInfo


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