Class.st
changeset 1754 9ce8fd84ebe8
parent 1753 fc2ff98b99f7
child 1756 d2518afa9df8
equal deleted inserted replaced
1753:fc2ff98b99f7 1754:9ce8fd84ebe8
   371     ].
   371     ].
   372     ^ nil
   372     ^ nil
   373 
   373 
   374     "Created: 15.11.1995 / 14:58:35 / cg"
   374     "Created: 15.11.1995 / 14:58:35 / cg"
   375     "Modified: 13.12.1995 / 17:11:28 / cg"
   375     "Modified: 13.12.1995 / 17:11:28 / cg"
       
   376 !
       
   377 
       
   378 revisionStringFromSource:aMethodSourceString
       
   379     "extract a revision string from a methods source string"
       
   380 
       
   381     |lines|
       
   382 
       
   383     lines := aMethodSourceString asCollectionOfLines.
       
   384     lines do:[:l |
       
   385         |i|
       
   386 
       
   387         i := l indexOfSubCollection:'$Header: '.
       
   388         i ~~ 0 ifTrue:[
       
   389             ^ l copyFrom:i
       
   390         ]
       
   391     ].
       
   392     ^ nil
       
   393 
       
   394     "Created: 15.10.1996 / 18:57:57 / cg"
   376 ! !
   395 ! !
   377 
   396 
   378 !Class class methodsFor:'queries'!
   397 !Class class methodsFor:'queries'!
   379 
   398 
   380 isBuiltInClass
   399 isBuiltInClass
   440 
   459 
   441 classFilename
   460 classFilename
   442     "return the name of the file from which the class was compiled.
   461     "return the name of the file from which the class was compiled.
   443      This is currently NOT used."
   462      This is currently NOT used."
   444 
   463 
       
   464     |owner|
       
   465 
       
   466     (owner := self owningClass) notNil ifTrue:[^ owner classFilename].
   445     ^ classFilename
   467     ^ classFilename
       
   468 
       
   469     "Modified: 15.10.1996 / 18:53:21 / cg"
   446 !
   470 !
   447 
   471 
   448 classVarAt:aSymbol
   472 classVarAt:aSymbol
   449     "return the value of a class variable.
   473     "return the value of a class variable.
   450      Currently, this returns nil if there is no such classvar -
   474      Currently, this returns nil if there is no such classvar -
   606 !
   630 !
   607 
   631 
   608 package
   632 package
   609     "return the package of the class"
   633     "return the package of the class"
   610 
   634 
       
   635     |owner|
       
   636 
       
   637     (owner := self owningClass) notNil ifTrue:[^ owner package].
   611     ^ package
   638     ^ package
   612 
   639 
   613     "
   640     "
   614      Object package  
   641      Object package  
   615     "
   642     "
       
   643 
       
   644     "Modified: 15.10.1996 / 18:53:36 / cg"
   616 !
   645 !
   617 
   646 
   618 package:aStringOrSymbol
   647 package:aStringOrSymbol
   619     "set the package of the class."
   648     "set the package of the class."
   620 
   649 
   861 sourceCodeManager
   890 sourceCodeManager
   862     "return my source code manager.
   891     "return my source code manager.
   863      For now, all classes return the same global manager.
   892      For now, all classes return the same global manager.
   864      But future versions may support mixed reporitories"
   893      But future versions may support mixed reporitories"
   865 
   894 
       
   895     |owner|
       
   896 
       
   897     (owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager].
   866     ^ Smalltalk at:#SourceCodeManager
   898     ^ Smalltalk at:#SourceCodeManager
   867 
   899 
   868     "Created: 7.12.1995 / 13:16:46 / cg"
   900     "Created: 7.12.1995 / 13:16:46 / cg"
   869     "Modified: 1.10.1996 / 15:47:35 / cg"
   901     "Modified: 15.10.1996 / 18:54:02 / cg"
   870 ! !
   902 ! !
   871 
   903 
   872 !Class methodsFor:'adding/removing'!
   904 !Class methodsFor:'adding/removing'!
   873 
   905 
   874 addSelector:newSelector withMethod:newMethod
   906 addSelector:newSelector withMethod:newMethod
  3388      Class new isClass
  3420      Class new isClass
  3389     "
  3421     "
  3390 !
  3422 !
  3391 
  3423 
  3392 owningClass
  3424 owningClass
       
  3425     "return my owning class - nil if I am a public class"
       
  3426 
  3393     ^ self class owningClass
  3427     ^ self class owningClass
  3394 
  3428 
  3395     "Created: 11.10.1996 / 18:45:59 / cg"
  3429     "Created: 11.10.1996 / 18:45:59 / cg"
  3396     "Modified: 12.10.1996 / 20:11:28 / cg"
  3430     "Modified: 15.10.1996 / 18:54:56 / cg"
  3397 !
  3431 !
  3398 
  3432 
  3399 wasAutoloaded
  3433 wasAutoloaded
  3400     "return true, if this class came into the system via an
  3434     "return true, if this class came into the system via an
  3401      autoload; false otherwise.
  3435      autoload; false otherwise.
  3456     "return the revision-ID from which the class was stc-compiled;
  3490     "return the revision-ID from which the class was stc-compiled;
  3457      nil if its an autoloaded or filedIn class.
  3491      nil if its an autoloaded or filedIn class.
  3458      If a classes binary is up-to-date w.r.t. the source repository,
  3492      If a classes binary is up-to-date w.r.t. the source repository,
  3459      the returned string is the same as the one returned by #revision."
  3493      the returned string is the same as the one returned by #revision."
  3460 
  3494 
       
  3495     |owner|
       
  3496 
       
  3497     (owner := self owningClass) notNil ifTrue:[^ owner binaryRevision].
  3461     self isMeta ifTrue:[
  3498     self isMeta ifTrue:[
  3462         ^ self soleInstance binaryRevision
  3499         ^ self soleInstance binaryRevision
  3463     ].
  3500     ].
  3464     ^ revision
  3501     ^ revision
  3465 
  3502 
  3477                     select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]].
  3514                     select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]].
  3478      SystemBrowser browseClasses:classes title:'classes which are not up-to-date'
  3515      SystemBrowser browseClasses:classes title:'classes which are not up-to-date'
  3479     "
  3516     "
  3480 
  3517 
  3481     "Created: 7.12.1995 / 10:58:47 / cg"
  3518     "Created: 7.12.1995 / 10:58:47 / cg"
  3482     "Modified: 9.2.1996 / 17:04:39 / cg"
  3519     "Modified: 15.10.1996 / 18:55:28 / cg"
  3483 !
  3520 !
  3484 
  3521 
  3485 packageSourceCodeInfo
  3522 packageSourceCodeInfo
  3486     "return the sourceCodeInfo, which defines the module and the subdirectory
  3523     "return the sourceCodeInfo, which defines the module and the subdirectory
  3487      in which the receiver class was built. 
  3524      in which the receiver class was built. 
  3505      the directory info defaults to library name.
  3542      the directory info defaults to library name.
  3506      The library name may not be left blank.
  3543      The library name may not be left blank.
  3507      (this is done for backward compatibility,)
  3544      (this is done for backward compatibility,)
  3508 
  3545 
  3509      For example: 
  3546      For example: 
  3510 	'....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
  3547         '....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
  3511 	'....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
  3548         '....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
  3512 	'....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
  3549         '....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
  3513 	'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase 
  3550         '....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase 
  3514 
  3551 
  3515      The way how the sourceCodeManager uses this to find the source location
  3552      The way how the sourceCodeManager uses this to find the source location
  3516      depends on the scheme used. For CVS, the module is taken as the -d arg,
  3553      depends on the scheme used. For CVS, the module is taken as the -d arg,
  3517      while the directory is prepended to the file name.
  3554      while the directory is prepended to the file name.
  3518      Other schemes may do things differently - these are not yet specified.
  3555      Other schemes may do things differently - these are not yet specified.
  3519 
  3556 
  3520      Caveat:
  3557      Caveat:
  3521 	Encoding this info in the package string seems somewhat kludgy.
  3558         Encoding this info in the package string seems somewhat kludgy.
  3522     "
  3559     "
  3523 
  3560 
  3524     |sourceInfo packageString idx1 idx2 
  3561     |owner sourceInfo packageString idx1 idx2 
  3525      moduleString directoryString libraryString components|
  3562      moduleString directoryString libraryString components|
       
  3563 
       
  3564     (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
  3526 
  3565 
  3527     package isNil ifTrue:[^ nil].
  3566     package isNil ifTrue:[^ nil].
  3528 
  3567 
  3529     packageString := package asString.
  3568     packageString := package asString.
  3530     idx1 := packageString lastIndexOf:$(.
  3569     idx1 := packageString lastIndexOf:$(.
  3531     idx1 ~~ 0 ifTrue:[
  3570     idx1 ~~ 0 ifTrue:[
  3532 	idx2 := packageString indexOf:$) startingAt:idx1+1.
  3571         idx2 := packageString indexOf:$) startingAt:idx1+1.
  3533 	idx2 ~~ 0 ifTrue:[
  3572         idx2 ~~ 0 ifTrue:[
  3534 	    sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
  3573             sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
  3535 	]
  3574         ]
  3536     ].
  3575     ].
  3537     sourceInfo isNil ifTrue:[^ nil].
  3576     sourceInfo isNil ifTrue:[^ nil].
  3538     components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:.
  3577     components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:.
  3539     components size == 0 ifTrue:[
  3578     components size == 0 ifTrue:[
  3540 	moduleString := 'stx'.
  3579         moduleString := 'stx'.
  3541 	directoryString := libraryString := ''.
  3580         directoryString := libraryString := ''.
  3542 	^ nil
  3581         ^ nil
  3543     ] ifFalse:[
  3582     ] ifFalse:[
  3544 	components size == 1 ifTrue:[
  3583         components size == 1 ifTrue:[
  3545 	    "/ a single name given - the module becomes 'stx',
  3584             "/ a single name given - the module becomes 'stx',
  3546 	    "/ if the component includes slashes, its the directory
  3585             "/ if the component includes slashes, its the directory
  3547 	    "/ otherwise the library
  3586             "/ otherwise the library
  3548 	    "/ 
  3587             "/ 
  3549 	    moduleString := 'stx'.
  3588             moduleString := 'stx'.
  3550 	    directoryString := libraryString := components at:1.
  3589             directoryString := libraryString := components at:1.
  3551 	    (libraryString includes:$/) ifTrue:[
  3590             (libraryString includes:$/) ifTrue:[
  3552 		libraryString := libraryString asFilename baseName
  3591                 libraryString := libraryString asFilename baseName
  3553 	    ]
  3592             ]
  3554 	] ifFalse:[
  3593         ] ifFalse:[
  3555 	    components size == 2 ifTrue:[
  3594             components size == 2 ifTrue:[
  3556 		"/ two components - assume its the module and the directory; 
  3595                 "/ two components - assume its the module and the directory; 
  3557 		"/ the library is assumed to be named after the directory
  3596                 "/ the library is assumed to be named after the directory
  3558 		"/ except, if slashes are in the name; then the libraryname
  3597                 "/ except, if slashes are in the name; then the libraryname
  3559 		"/ is the last component.
  3598                 "/ is the last component.
  3560 		"/
  3599                 "/
  3561 		moduleString := components at:1.
  3600                 moduleString := components at:1.
  3562 		directoryString := libraryString := components at:2.
  3601                 directoryString := libraryString := components at:2.
  3563 		(libraryString includes:$/) ifTrue:[
  3602                 (libraryString includes:$/) ifTrue:[
  3564 		    libraryString := libraryString asFilename baseName
  3603                     libraryString := libraryString asFilename baseName
  3565 		]
  3604                 ]
  3566 	    ] ifFalse:[
  3605             ] ifFalse:[
  3567 		"/ all components given
  3606                 "/ all components given
  3568 		moduleString := components at:1.
  3607                 moduleString := components at:1.
  3569 		directoryString := components at:2.
  3608                 directoryString := components at:2.
  3570 		libraryString := components at:3.
  3609                 libraryString := components at:3.
  3571 	    ]
  3610             ]
  3572 	]
  3611         ]
  3573     ].
  3612     ].
  3574     libraryString isEmpty ifTrue:[
  3613     libraryString isEmpty ifTrue:[
  3575 	directoryString notEmpty ifTrue:[
  3614         directoryString notEmpty ifTrue:[
  3576 	    libraryString := directoryString asFilename baseName
  3615             libraryString := directoryString asFilename baseName
  3577 	].
  3616         ].
  3578 	libraryString isEmpty ifTrue:[
  3617         libraryString isEmpty ifTrue:[
  3579 	    "/ lets extract the library from the liblist file ...
  3618             "/ lets extract the library from the liblist file ...
  3580 	    libraryString := Smalltalk libraryFileNameOfClass:self.
  3619             libraryString := Smalltalk libraryFileNameOfClass:self.
  3581 	    libraryString isNil ifTrue:[^ nil].
  3620             libraryString isNil ifTrue:[^ nil].
  3582 	]
  3621         ]
  3583     ].
  3622     ].
  3584 
  3623 
  3585     moduleString isEmpty ifTrue:[
  3624     moduleString isEmpty ifTrue:[
  3586 	moduleString := 'stx'.
  3625         moduleString := 'stx'.
  3587     ].
  3626     ].
  3588     directoryString isEmpty ifTrue:[
  3627     directoryString isEmpty ifTrue:[
  3589 	directoryString := libraryString.
  3628         directoryString := libraryString.
  3590     ].
  3629     ].
  3591 
  3630 
  3592     ^ IdentityDictionary
  3631     ^ IdentityDictionary
  3593 	with:(#module->moduleString)
  3632         with:(#module->moduleString)
  3594 	with:(#directory->directoryString)
  3633         with:(#directory->directoryString)
  3595 	with:(#library->libraryString)
  3634         with:(#library->libraryString)
  3596 
  3635 
  3597     "
  3636     "
  3598      Object packageSourceCodeInfo     
  3637      Object packageSourceCodeInfo     
  3599      View packageSourceCodeInfo    
  3638      View packageSourceCodeInfo    
  3600      Model packageSourceCodeInfo  
  3639      Model packageSourceCodeInfo  
  3602      MemoryMonitor packageSourceCodeInfo  
  3641      MemoryMonitor packageSourceCodeInfo  
  3603      ClockView packageSourceCodeInfo  
  3642      ClockView packageSourceCodeInfo  
  3604     "
  3643     "
  3605 
  3644 
  3606     "Created: 4.11.1995 / 20:36:53 / cg"
  3645     "Created: 4.11.1995 / 20:36:53 / cg"
  3607     "Modified: 7.2.1996 / 14:26:31 / cg"
  3646     "Modified: 15.10.1996 / 18:56:03 / cg"
  3608 !
  3647 !
  3609 
  3648 
  3610 revision
  3649 revision
  3611     "return the revision-ID of the class which corresponds to the
  3650     "return the revision-ID of the class which corresponds to the
  3612      rcs-id of the source to which this class is equivalent.
  3651      rcs-id of the source to which this class is equivalent.
  3634 
  3673 
  3635 revisionInfo
  3674 revisionInfo
  3636     "return a dictionary filled with revision info.
  3675     "return a dictionary filled with revision info.
  3637      This extracts the relevant info from the revisionString.
  3676      This extracts the relevant info from the revisionString.
  3638      The revisionInfo contains all or a subset of:
  3677      The revisionInfo contains all or a subset of:
  3639 	#binaryRevision - the revision upon which the binary of this class is based
  3678         #binaryRevision - the revision upon which the binary of this class is based
  3640 	#revision       - the revision upon which the class is based logically
  3679         #revision       - the revision upon which the class is based logically
  3641 			  (different, if a changed class was checked in, but not yet recompiled)
  3680                           (different, if a changed class was checked in, but not yet recompiled)
  3642 	#user           - the user who checked in the logical revision
  3681         #user           - the user who checked in the logical revision
  3643 	#date           - the date when the logical revision was checked in
  3682         #date           - the date when the logical revision was checked in
  3644 	#time           - the time when the logical revision was checked in
  3683         #time           - the time when the logical revision was checked in
  3645 	#fileName       - the classes source file name
  3684         #fileName       - the classes source file name
  3646 	#repositoryPath - the classes source container
  3685         #repositoryPath - the classes source container
  3647     "
  3686     "
  3648 
  3687 
  3649     |vsnString info|
  3688     |vsnString info|
  3650 
  3689 
  3651     vsnString := self revisionString.
  3690     vsnString := self revisionString.
  3652     vsnString notNil ifTrue:[
  3691     vsnString notNil ifTrue:[
  3653 	info := Class revisionInfoFromString:vsnString.
  3692         info := Class revisionInfoFromString:vsnString.
  3654 	info notNil ifTrue:[
  3693         info notNil ifTrue:[
  3655 	    info at:#binaryRevision put:revision.
  3694             info at:#binaryRevision put:revision.
  3656 	]
  3695         ]
  3657     ].
  3696     ].
  3658     ^ info
  3697     ^ info
  3659 
  3698 
  3660     "
  3699     "
  3661      Object revisionString 
  3700      Object revisionString 
  3662      Object revisionInfo 
  3701      Object revisionInfo 
  3663      Image revisionInfo 
  3702      Image revisionInfo 
  3664     "
  3703     "
  3665 
  3704 
  3666     "Created: 11.11.1995 / 14:27:20 / cg"
  3705     "Created: 11.11.1995 / 14:27:20 / cg"
  3667     "Modified: 9.12.1995 / 21:35:26 / cg"
  3706     "Modified: 15.10.1996 / 18:56:44 / cg"
  3668 !
  3707 !
  3669 
  3708 
  3670 revisionString
  3709 revisionString
  3671     "return my revision string; that one is extracted from the
  3710     "return my revision string; that one is extracted from the
  3672      classes #version method. Either this is a method returning that string,
  3711      classes #version method. Either this is a method returning that string,
  3673      or its a comment-only method and the comment defines the version.
  3712      or its a comment-only method and the comment defines the version.
  3674      If the source is not accessable or no such method exists,
  3713      If the source is not accessable or no such method exists,
  3675      nil is returned."
  3714      nil is returned."
  3676 
  3715 
  3677     |cls meta m src val|
  3716     |owner cls meta m src val|
       
  3717 
       
  3718     (owner := self owningClass) notNil ifTrue:[^ owner revisionString].
  3678 
  3719 
  3679     thisContext isRecursive ifTrue:[^ nil ].
  3720     thisContext isRecursive ifTrue:[^ nil ].
  3680 
  3721 
  3681     self isMeta ifTrue:[
  3722     self isMeta ifTrue:[
  3682         meta := self. cls := self soleInstance
  3723         meta := self. cls := self soleInstance
  3706     "/ in case we need to access the source code manager
  3747     "/ in case we need to access the source code manager
  3707     "/ for the source ...
  3748     "/ for the source ...
  3708     "/
  3749     "/
  3709     src := m source.
  3750     src := m source.
  3710     src isNil ifTrue:[^ nil].
  3751     src isNil ifTrue:[^ nil].
  3711     ^ self revisionStringFromSource:src 
  3752     ^ self class revisionStringFromSource:src 
  3712 
  3753 
  3713     "
  3754     "
  3714      Smalltalk allClassesDo:[:cls |
  3755      Smalltalk allClassesDo:[:cls |
  3715         Transcript showCR:cls revisionString
  3756         Transcript showCR:cls revisionString
  3716      ].
  3757      ].
  3718      Number revisionString  
  3759      Number revisionString  
  3719      FileDirectory revisionString  
  3760      FileDirectory revisionString  
  3720     "
  3761     "
  3721 
  3762 
  3722     "Created: 29.10.1995 / 19:28:03 / cg"
  3763     "Created: 29.10.1995 / 19:28:03 / cg"
  3723     "Modified: 18.3.1996 / 15:39:36 / cg"
  3764     "Modified: 15.10.1996 / 18:57:43 / cg"
  3724 !
       
  3725 
       
  3726 revisionStringFromSource:aMethodSourceString
       
  3727     "extract a revision string from a methods source string"
       
  3728 
       
  3729     |lines|
       
  3730 
       
  3731     lines := aMethodSourceString asCollectionOfLines.
       
  3732     lines do:[:l |
       
  3733 	|i|
       
  3734 
       
  3735 	i := l indexOfSubCollection:'$Header: '.
       
  3736 	i ~~ 0 ifTrue:[
       
  3737 	    ^ l copyFrom:i
       
  3738 	]
       
  3739     ].
       
  3740     ^ nil
       
  3741 !
  3765 !
  3742 
  3766 
  3743 setBinaryRevision:aString
  3767 setBinaryRevision:aString
  3744     "set the revision-ID.
  3768     "set the revision-ID.
  3745      This should normally not be done in the running system, as the source-manager
  3769      This should normally not be done in the running system, as the source-manager
  3812 !
  3836 !
  3813 
  3837 
  3814 sourceStream
  3838 sourceStream
  3815     "return an open stream on my sourcefile, nil if that is not available"
  3839     "return an open stream on my sourcefile, nil if that is not available"
  3816 
  3840 
  3817     |source cls|
  3841     |owner source cls|
       
  3842 
       
  3843     (owner := self owningClass) notNil ifTrue:[^ owner sourceStream].
  3818 
  3844 
  3819     self isMeta ifTrue:[
  3845     self isMeta ifTrue:[
  3820 	cls := self soleInstance
  3846         cls := self soleInstance
  3821     ] ifFalse:[
  3847     ] ifFalse:[
  3822 	cls := self
  3848         cls := self
  3823     ].
  3849     ].
  3824     classFilename notNil ifTrue:[
  3850     classFilename notNil ifTrue:[
  3825 	source := classFilename
  3851         source := classFilename
  3826     ] ifFalse:[
  3852     ] ifFalse:[
  3827 	source := (Smalltalk fileNameForClass:cls) , '.st'
  3853         source := (Smalltalk fileNameForClass:cls) , '.st'
  3828     ].
  3854     ].
  3829     ^ cls sourceStreamFor:source
  3855     ^ cls sourceStreamFor:source
       
  3856 
       
  3857     "Modified: 15.10.1996 / 18:59:40 / cg"
  3830 !
  3858 !
  3831 
  3859 
  3832 sourceStreamFor:source
  3860 sourceStreamFor:source
  3833     "return an open stream on a sourcefile, nil if that is not available"
  3861     "return an open stream on a sourcefile, nil if that is not available"
  3834 
  3862 
  3835     |fileName aStream mgr|
  3863     |owner fileName aStream mgr|
       
  3864 
       
  3865     (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
  3836 
  3866 
  3837     "/
  3867     "/
  3838     "/ if there is no SourceCodeManager, 
  3868     "/ if there is no SourceCodeManager, 
  3839     "/ or TryLocalSourceFirst is true,
  3869     "/ or TryLocalSourceFirst is true,
  3840     "/ look in standard places first
  3870     "/ look in standard places first
  3911      Clock sourceStream
  3941      Clock sourceStream
  3912      Autoload sourceStream
  3942      Autoload sourceStream
  3913     "
  3943     "
  3914 
  3944 
  3915     "Created: 10.11.1995 / 21:05:13 / cg"
  3945     "Created: 10.11.1995 / 21:05:13 / cg"
  3916     "Modified: 12.10.1996 / 17:21:10 / cg"
  3946     "Modified: 15.10.1996 / 18:59:53 / cg"
  3917 !
  3947 !
  3918 
  3948 
  3919 updateVersionMethodFor:newRevisionString
  3949 updateVersionMethodFor:newRevisionString
  3920     "helper for the checkin procedure.
  3950     "helper for the checkin procedure.
  3921      Update my #version method, to now return newRevisionString."
  3951      Update my #version method, to now return newRevisionString."
  3922 
  3952 
  3923     |cls "vs m mgr"|
  3953     |cls "vs m mgr"|
  3924 
  3954 
  3925     cls := self.
  3955     cls := self.
  3926     self isMeta ifFalse:[
  3956     self isMeta ifFalse:[
  3927 	cls := self class
  3957         cls := self class
  3928     ].
  3958     ].
       
  3959 
  3929 "/    m := cls compiledMethodAt:#version.
  3960 "/    m := cls compiledMethodAt:#version.
  3930 "/    m isNil ifTrue:[^ false].
  3961 "/    m isNil ifTrue:[^ false].
  3931 "/    vs := self revisionString.
  3962 "/    vs := self revisionString.
  3932 "/    vs isNil ifTrue:[^ false].
  3963 "/    vs isNil ifTrue:[^ false].
  3933 "/
  3964 "/
  3934 "/    (mgr := self sourceCodeManager) isNil ifTrue:[^ false].
  3965 "/    (mgr := self sourceCodeManager) isNil ifTrue:[^ false].
  3935 "/    newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs. 
  3966 "/    newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs. 
  3936 "/    newString isNil ifTrue:[^ false].
  3967 "/    newString isNil ifTrue:[^ false].
  3937 
  3968 
  3938     Class withoutUpdatingChangesDo:[
  3969     Class withoutUpdatingChangesDo:[
  3939 	Compiler compile:'version
  3970         Compiler compile:'version
  3940     ^ ''' , newRevisionString , '''
  3971     ^ ''' , newRevisionString , '''
  3941 '
  3972 '
  3942 		 forClass:cls inCategory:#documentation notifying:nil 
  3973                  forClass:cls inCategory:#documentation notifying:nil 
  3943 		     install:true skipIfSame:false silent:true. 
  3974                      install:true skipIfSame:false silent:true. 
  3944     ].
  3975     ].
  3945 "/ ('updated to :' , newRevisionString) printNL.
  3976 "/ ('updated to :' , newRevisionString) printNL.
  3946 
  3977 
  3947     ^ true
  3978     ^ true
  3948 
  3979 
  3949     "Created: 7.12.1995 / 20:42:22 / cg"
  3980     "Created: 7.12.1995 / 20:42:22 / cg"
  3950     "Modified: 7.12.1995 / 23:34:43 / cg"
  3981     "Modified: 15.10.1996 / 18:59:58 / cg"
  3951 ! !
  3982 ! !
  3952 
  3983 
  3953 !Class class methodsFor:'documentation'!
  3984 !Class class methodsFor:'documentation'!
  3954 
  3985 
  3955 version
  3986 version
  3956     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.186 1996-10-15 11:29:55 cg Exp $'
  3987     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.187 1996-10-15 18:00:43 cg Exp $'
  3957 ! !
  3988 ! !
  3958 Class initialize!
  3989 Class initialize!