DataBaseSourceCodeManager.st
branchjv
changeset 3063 5334204e354f
parent 3042 48e76977cdc3
child 3121 19723298dd2c
child 3125 08d6603c4fe9
equal deleted inserted replaced
3062:3bef6850206d 3063:5334204e354f
   442     "{ Pragma: +optSpace }"
   442     "{ Pragma: +optSpace }"
   443 
   443 
   444     "return a VersionInfo object filled with revision info.
   444     "return a VersionInfo object filled with revision info.
   445      This extracts the relevant info from aString."
   445      This extracts the relevant info from aString."
   446 
   446 
   447     |info path version user ts timeStamp idx1 idx2|
   447     ^ self revisionInfoFromStandardVersionString:aString
   448 
       
   449     "/ 'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826'
       
   450 
       
   451     idx1 := aString indexOfSubCollection:'Path: '.
       
   452     idx1 ~~ 0 ifTrue:[
       
   453         idx1 := idx1 + 'Path: ' size.
       
   454         idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
       
   455         path := aString copyFrom:idx1 to:idx2-1.     
       
   456     ].
       
   457     idx1 := aString indexOfSubCollection:'Version: '.
       
   458     idx1 ~~ 0 ifTrue:[
       
   459         idx1 := idx1 + 'Version: ' size.
       
   460         idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
       
   461         idx2 == 0 ifTrue:[
       
   462             version := aString copyFrom:idx1     
       
   463         ] ifFalse:[
       
   464             version := aString copyFrom:idx1 to:idx2-1.     
       
   465         ].
       
   466     ].
       
   467     idx1 := aString indexOfSubCollection:'User: '.
       
   468     idx1 ~~ 0 ifTrue:[
       
   469         idx1 := idx1 + 'User: ' size.
       
   470         idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
       
   471         idx2 == 0 ifTrue:[
       
   472             user := aString copyFrom:idx1     
       
   473         ] ifFalse:[
       
   474             user := aString copyFrom:idx1 to:idx2-1.     
       
   475         ].
       
   476     ].
       
   477     idx1 := aString indexOfSubCollection:'Time: '.
       
   478     idx1 ~~ 0 ifTrue:[
       
   479         idx1 := idx1 + 'Time: ' size.
       
   480         idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
       
   481         idx2 == 0 ifTrue:[
       
   482             ts := aString copyFrom:idx1     
       
   483         ] ifFalse:[
       
   484             ts := aString copyFrom:idx1 to:idx2-1.     
       
   485         ].
       
   486         timeStamp := Timestamp readIso8601FormatFrom:ts
       
   487     ].
       
   488 
       
   489     info := VersionInfo new.
       
   490     path notNil ifTrue:[ info fileName:(path asFilename baseName) ].
       
   491     info revision:version.
       
   492     user notNil ifTrue:[ info user:user ].
       
   493     timeStamp notNil ifTrue:[ info timeStamp:timeStamp ].
       
   494     ^ info
       
   495 
   448 
   496     "
   449     "
   497      self revisionInfoFromString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' 
   450      self revisionInfoFromString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' 
   498     "
   451     "
   499 
   452 
   564 
   517 
   565     "Created: / 21-12-2011 / 20:39:31 / cg"
   518     "Created: / 21-12-2011 / 20:39:31 / cg"
   566 !
   519 !
   567 
   520 
   568 revisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
   521 revisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
   569     "return a string usable as initial revision string"
   522     "utility function: return a string usable as initial revision string"
   570 
   523 
   571     ^ 'Path: %1/%2/%3, Version: %4, User: %5, Time: %6'
   524     ^ self standardRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
   572         bindWith:moduleDir
       
   573         with:packageDir
       
   574         with:fileName
       
   575         with:revisionString
       
   576         with:(OperatingSystem getLoginName)
       
   577         with:(Timestamp now printStringIso8601Format)
       
   578 
   525 
   579     "
   526     "
   580      self revisionStringFor:Array inModule:'stx' directory:'libbasic' container:'Array.st' revision:'123'
   527      self 
       
   528         revisionStringFor:Array 
       
   529         inModule:'stx' 
       
   530         directory:'libbasic' 
       
   531         container:'Array.st' 
       
   532         revision:'123'          
   581     "
   533     "
   582 
   534 
   583     "Created: / 21-12-2011 / 19:33:33 / cg"
   535     "Created: / 21-12-2011 / 19:33:33 / cg"
   584 !
   536 !
   585 
   537 
   595 ! !
   547 ! !
   596 
   548 
   597 !DataBaseSourceCodeManager class methodsFor:'documentation'!
   549 !DataBaseSourceCodeManager class methodsFor:'documentation'!
   598 
   550 
   599 version
   551 version
   600     ^ '$Id: DataBaseSourceCodeManager.st 1909 2012-03-31 00:14:49Z vranyj1 $'
   552     ^ '$Header: /cvs/stx/stx/libbasic3/DataBaseSourceCodeManager.st,v 1.10 2012/07/24 07:44:39 cg Exp $'
   601 !
   553 !
   602 
   554 
   603 version_CVS
   555 version_CVS
   604     ^ '§Header: /cvs/stx/stx/libbasic3/DataBaseSourceCodeManager.st,v 1.9 2012/01/19 15:19:52 cg Exp §'
   556     ^ '§Header: /cvs/stx/stx/libbasic3/DataBaseSourceCodeManager.st,v 1.10 2012/07/24 07:44:39 cg Exp §'
   605 !
   557 !
   606 
   558 
   607 version_SVN
   559 version_SVN
   608     ^ '$Id: DataBaseSourceCodeManager.st 1909 2012-03-31 00:14:49Z vranyj1 $'
   560     ^ '$Id: DataBaseSourceCodeManager.st 1937 2012-07-25 08:46:08Z vranyj1 $'
   609 ! !
   561 ! !