--- a/CVSSourceCodeManager.st Wed Jun 12 11:54:30 2013 +0100
+++ b/CVSSourceCodeManager.st Mon Jul 01 22:14:32 2013 +0100
@@ -16,7 +16,7 @@
classVariableNames:'CVSRoot RemoteCVS CVSModuleRoots CMD_checkout CVSTempDir
DisabledModules CVSCommandSemaphore CVSExecutable
CVSCommitOptions CVSUpdateOptions CVSCommandTimeout
- RecentlyCheckedModulesAndPackages RecentTag'
+ RecentlyCheckedModulesAndPackages RecentTag AuthorMap'
poolDictionaries:''
category:'System-SourceCodeManagement'
!
@@ -554,6 +554,22 @@
!CVSSourceCodeManager class methodsFor:'misc operations'!
+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"
+
+ AuthorMap isNil ifTrue:[ ^ authorName ].
+ ^ AuthorMap at:authorName ifAbsent:[ authorName ].
+
+ "
+ AuthorMap := Dictionary new
+ at:'claus' put:'cg';
+ yourself.
+ "
+!
+
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').
@@ -781,7 +797,7 @@
given file there.
Return the name of a temporary directory containing the package, or nil"
- |path absolutePath tempdir workingDir unixPath|
+ |path absolutePath tempdir unixPath|
path := (moduleDir asFilename construct:packageDir) construct:fileToCheckout.
@@ -960,7 +976,7 @@
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.
+ execute command in the dirArg directory (or the current directory if dirArg is nil).
The doLog argument, if false supresses a logEntry to be added
in the cvs log file (used when reading / extracting history)"
@@ -1253,7 +1269,10 @@
'lines:' #numberOfChangedLines
) pairWiseDo:[:word :key |
s := subEntry restAfter:word withoutSeparators:true.
- s notNil ifTrue:[record at:key put:s.].
+ s notNil ifTrue:[
+ key == #'auther' ifTrue:[ s := self authorMappingFor:s ].
+ record at:key put:s.
+ ].
].
].
@@ -1282,7 +1301,6 @@
record at:#logMessage put:s.
].
^record.
-
!
releaseAndRemove:tempdir module:moduleDir outputTo:outputFilename
@@ -1433,10 +1451,8 @@
isResponsibleForPackage:aString
- | id |
-
"JV@2011-07-09: The real check is too slow. Cache needed here"
- ^true.
+ ^ true.
"/ id := aString asPackageId.
"/ ^self checkForExistingModule: id module directory: id directory.
@@ -1996,7 +2012,7 @@
].
(binRevision := cls binaryRevision) notNil ifTrue:[
revision ~= binRevision ifTrue:[
- ('CVSSourceCodeManager [info]: class ' , className , ' is based upon ' , binRevision , ' but has revision ' , (revision ? '?')) infoPrintCR
+ Transcript showCR:('CVSSourceCodeManager [info]: class ' , className , ' is based upon ' , binRevision , ' but has revision ' , (revision ? '?'))
]
].
@@ -3644,6 +3660,81 @@
"
!
+diffListFor:clsOrNil fileName:classFileName directory:packageDir module:moduleDir revision1:rev1 revision2:rev2
+ "return diff info. This is supposed to return a standard diff-like
+ list of lines, representing the diffs between two revisions.
+ experimental (for ownershipGraph)"
+
+ |tempDir fullName modulePath inStream line
+ list s msg|
+
+ clsOrNil notNil ifTrue:[
+ modulePath := clsOrNil package copyReplaceAll:$: with:$/.
+ fullName := modulePath , '/' , clsOrNil getClassFilename.
+ ] ifFalse:[
+ modulePath := moduleDir , '/' , packageDir.
+ fullName := modulePath , '/' , classFileName.
+ ].
+
+ tempDir := self createTempDirectory:nil forModule:nil.
+ tempDir isNil ifTrue:[
+ ('CVSSourceCodeManager [error]: no tempDir - cannot extract status') errorPrintCR.
+ ^ nil.
+ ].
+
+ [
+ self createEntryFor:fullName
+ module:moduleDir
+ in:(tempDir construct:modulePath)
+ revision:'1.1'
+ date:'dummy'
+ special:''
+ overwrite:false.
+
+ msg := 'fetching diff list of '.
+ clsOrNil isNil ifTrue:[
+ msg := msg , fullName.
+ ] ifFalse:[
+ msg := msg , clsOrNil name.
+ ].
+ msg := msg , ' ' , rev1 , ' vs. ' , rev2.
+ self activityNotification:msg.
+
+ inStream := self
+ executeCVSCommand:('diff -r%1 -r%2 %3' bindWith:rev1 with:rev2 with:fullName)
+ module:moduleDir
+ inDirectory:tempDir
+ log:true
+ pipe:true.
+
+ inStream isNil ifTrue:[
+ ('CVSSourceCodeManager [error]: cannot open pipe to cvs diff ', fullName) errorPrintCR.
+ ^ nil
+ ].
+
+ "/
+ "/ read the commands pipe output and extract the container info
+ "/
+ [ inStream nextLine startsWith:'diff -r'] whileFalse.
+
+ list := inStream contents.
+ ] ensure:[
+ inStream notNil ifTrue:[inStream close].
+ tempDir recursiveRemove
+ ].
+ list := list reject:[:line | line startsWith:'\ '].
+ ^ list
+
+ "
+ SourceCodeManager statusOf:Array
+ SourceCodeManager statusOf:Array fileName:'Array.st' directory:'libbasic' module:'stx'
+ SourceCodeManager statusOf:Filename fileName:'Filename.st' directory:'libbasic' module:'stx'
+ SourceCodeManager statusOf:NewSystemBrowser fileName:'NewSystemBrowser.st' directory:'libtool' module:'stx'
+ "
+
+ "Modified: / 29-08-2006 / 13:18:00 / cg"
+!
+
getExistingContainersInModule:aModule directory:aPackage
"return a list of existing containers."
@@ -4750,9 +4841,10 @@
|tempDir modulePath inStream info|
+ tempDir := nil. "use the current directory"
+
self use_rlog ifFalse:[
"/ Uses 'cvs status' - rlog seems not to work
-
^ nil.
].
@@ -4812,9 +4904,9 @@
|tempDir modulePath inStream info|
+ tempDir := nil. "use the current directory"
self use_rlog ifFalse:[
"/ Uses 'cvs status' - rlog seems not to work
-
^ nil.
].
@@ -5096,7 +5188,7 @@
fullName := modulePath , '/' , classFileName.
tempDir := self createTempDirectory:nil forModule:nil.
tempDir isNil ifTrue:[
- ('CVSSourceCodeManager [error]: no tempDir - cannot extract log') errorPrintCR.
+ ('CVSSourceCodeManager [error]: no tempDir - cannot extract status') errorPrintCR.
^ nil.
].
@@ -5125,7 +5217,7 @@
pipe:true.
inStream isNil ifTrue:[
- ('CVSSourceCodeManager [error]: cannot open pipe to cvs log ', fullName) errorPrintCR.
+ ('CVSSourceCodeManager [error]: cannot open pipe to cvs status ', fullName) errorPrintCR.
^ nil
].
@@ -5191,11 +5283,11 @@
!CVSSourceCodeManager class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.463 2013-06-06 20:23:29 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.468 2013-06-29 11:26:04 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.463 2013-06-06 20:23:29 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.468 2013-06-29 11:26:04 cg Exp $'
!
version_HG