CVSSourceCodeManager.st
changeset 4467 982a87cfa97d
parent 4459 996c5e249b27
child 4485 11de50dd8c35
equal deleted inserted replaced
4466:87a487965825 4467:982a87cfa97d
  1055 
  1055 
  1056 executeCVSCommand:cvsCommand module:moduleName inDirectory:dirArg log:doLog pipe:doPipe
  1056 executeCVSCommand:cvsCommand module:moduleName inDirectory:dirArg log:doLog pipe:doPipe
  1057     "execute command and prepend cvs command name and global options.
  1057     "execute command and prepend cvs command name and global options.
  1058      execute command in the dirArg directory.
  1058      execute command in the dirArg directory.
  1059      The doLog argument, if false suppresses a logEntry to be added
  1059      The doLog argument, if false suppresses a logEntry to be added
  1060      in the cvs log file (used when reading / extracting history)"
  1060      in the cvs log file (used when reading / extracting history).
       
  1061      sigh: returns either a stream (if doPipe == true) or a boolean otherwise."
  1061 
  1062 
  1062     ^ self
  1063     ^ self
  1063         executeCVSCommand:cvsCommand
  1064         executeCVSCommand:cvsCommand
  1064         module:moduleName
  1065         module:moduleName
  1065         inDirectory:dirArg
  1066         inDirectory:dirArg
  1076 
  1077 
  1077 executeCVSCommand:cvsCommand module:moduleName inDirectory:dirArg log:doLog pipe:doPipe orElseOutputTo:outStreamOrNil errorTo:errorStreamOrNil
  1078 executeCVSCommand:cvsCommand module:moduleName inDirectory:dirArg log:doLog pipe:doPipe orElseOutputTo:outStreamOrNil errorTo:errorStreamOrNil
  1078     "execute command and prepend cvs command name and global options.
  1079     "execute command and prepend cvs command name and global options.
  1079      execute command in the dirArg directory (or the current directory if dirArg is nil).
  1080      execute command in the dirArg directory (or the current directory if dirArg is nil).
  1080      The doLog argument, if false suppresses a logEntry to be added
  1081      The doLog argument, if false suppresses a logEntry to be added
  1081      in the cvs log file (used when reading / extracting history)"
  1082      in the cvs log file (used when reading / extracting history).
       
  1083      sigh: returns either a stream (if doPipe == true) or a boolean otherwise."
  1082 
  1084 
  1083     |command cvsRoot rslt ok pathOfDir errorString osProcess|
  1085     |command cvsRoot rslt ok pathOfDir errorString osProcess|
  1084 
  1086 
  1085     dirArg notNil ifTrue:[
  1087     dirArg notNil ifTrue:[
  1086         pathOfDir := dirArg asFilename pathName.
  1088         pathOfDir := dirArg asFilename pathName.
  1165         ('CVSSourceCodeManager [info]: command failed: ' , command) errorPrintCR.
  1167         ('CVSSourceCodeManager [info]: command failed: ' , command) errorPrintCR.
  1166         SourceCodeManagerError isHandled ifTrue:[
  1168         SourceCodeManagerError isHandled ifTrue:[
  1167             SourceCodeManagerError raiseRequestErrorString:(errorString ? 'CVS Error').
  1169             SourceCodeManagerError raiseRequestErrorString:(errorString ? 'CVS Error').
  1168         ].
  1170         ].
  1169     ].
  1171     ].
       
  1172     "/ sigh: is either a stream (if doPipe == true)
       
  1173     "/ or a boolean otherwise.
  1170     ^ rslt
  1174     ^ rslt
  1171 
  1175 
  1172     "Modified: / 23-04-1996 / 15:24:00 / stefan"
  1176     "Modified: / 23-04-1996 / 15:24:00 / stefan"
  1173     "Modified: / 10-10-2011 / 14:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1177     "Modified: / 10-10-2011 / 14:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1174     "Modified (format): / 13-10-2011 / 17:06:28 / jv"
  1178     "Modified (format): / 13-10-2011 / 17:06:28 / jv"
  4944                         pipe:true.
  4948                         pipe:true.
  4945 
  4949 
  4946         (inStream isNil or:[inStream atEnd]) ifTrue:[
  4950         (inStream isNil or:[inStream atEnd]) ifTrue:[
  4947             ('CVSSourceCodeManager [error]: cannot open pipe to "cvs log" ', fullName) errorPrintCR.
  4951             ('CVSSourceCodeManager [error]: cannot open pipe to "cvs log" ', fullName) errorPrintCR.
  4948             SourceCodeManagerError raiseRequestWith:'failed to open pipe to "cvs log"'.
  4952             SourceCodeManagerError raiseRequestWith:'failed to open pipe to "cvs log"'.
       
  4953             inStream notNil ifTrue:[ inStream close ].
  4949             ^ nil
  4954             ^ nil
  4950         ].
  4955         ].
  4951 
  4956 
  4952         info := self readRevisionLogFromStream:inStream headerOnly:headerOnly numRevisions:numRevisionsOrNil.
  4957         info := self readRevisionLogFromStream:inStream headerOnly:headerOnly numRevisions:numRevisionsOrNil.
       
  4958         inStream close.
  4953 
  4959 
  4954 "/        "/
  4960 "/        "/
  4955 "/        "/ read the command's pipe output and extract the container info
  4961 "/        "/ read the command's pipe output and extract the container info
  4956 "/        "/
  4962 "/        "/
  4957 "/        info := IdentityDictionary new.
  4963 "/        info := IdentityDictionary new.