more revision stuff for sourceCodeManager
authorClaus Gittinger <cg@exept.de>
Sat, 25 Nov 1995 10:13:57 +0100
changeset 649 6a2a1eec91fe
parent 648 b70bfd63446a
child 650 9aef9de12f65
more revision stuff for sourceCodeManager
Class.st
--- a/Class.st	Fri Nov 24 22:40:17 1995 +0100
+++ b/Class.st	Sat Nov 25 10:13:57 1995 +0100
@@ -106,7 +106,7 @@
 !
 
 version
-^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.83 1995-11-23 17:50:57 cg Exp $'! !
+^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.84 1995-11-25 09:13:57 cg Exp $'! !
 
 !Class class methodsFor:'initialization'!
 
@@ -2040,7 +2040,7 @@
 	    |wanted|
 
 	    (aCategory = aMethod category) ifTrue:[
-	        skippedMethods notNil ifTrue:[
+		skippedMethods notNil ifTrue:[
 		    wanted := (skippedMethods includesIdentical:aMethod) not
 		] ifFalse:[
 		    savedMethods notNil ifTrue:[
@@ -2383,7 +2383,7 @@
     "/ finally, the previously skipped version method
     "/
     versionMethod notNil ifTrue:[
-        self class fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream.
+	self class fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream.
     ].
 
     "/
@@ -2828,7 +2828,7 @@
 
 revisionInfo
     "return a dictionary filled with revision info.
-     This extracts the reevant info from the revisionString."
+     This extracts the relevant info from the revisionString."
 
     |vsnString|
 
@@ -2844,7 +2844,7 @@
     "
 
     "Created: 11.11.1995 / 14:27:20 / cg"
-    "Modified: 15.11.1995 / 14:59:34 / cg"
+    "Modified: 24.11.1995 / 10:18:25 / cg"
 !
 
 revisionString
@@ -2912,14 +2912,42 @@
 
 updateRevisionString
     "update my revision string, to reflect a change w.r.t.
-     the original source.
-     The original revision string is kept as a reference i.e.
+     the original source. Every change in a class should be
+     followed by a send to this method, to enable later search
+     for modified classes (i.e. all classes which have been changed,
+     but not yet checked into the sourceRepository).
+
+     Info about the original revision is kept as a reference i.e.
        Header: /files/CVS/stx/libbasic/Class.st,v 1.63 1995/10/28 16:44:51 cg Exp $
      is changed into:
        Header: /files/CVS/stx/libbasic/Class.st,v 1.63mod 1995/10/28 16:44:51 cg Exp $
+
+     to tell the fact that the classes source is a ``modification''
+     based on 1.63.
     "
 
-    |cls vs m idx leftPart rightPart vsnString|
+    ^ self updateRevisionStringTo:nil 
+
+    "
+     Class updateRevisionString
+     Number updateRevisionString
+     ProcessMonitor updateRevisionString
+    "
+
+    "Created: 29.10.1995 / 19:25:15 / cg"
+    "Modified: 24.11.1995 / 10:41:21 / cg"
+!
+
+updateRevisionStringTo:newRevision
+    "helper for updateRevisionString and checkin procedure.
+     Update my revision string, to either reflect a change w.r.t.
+     the original source or a checkin with new version.
+     If the argument is nil, the revision is updated from 
+     'x.y' to 'x.ymod' (to be done whenever class is changed).
+     If its nonNil, that is taken as the new revision (to be done
+     whenever class is checked into the sourceRepository)."
+
+    |cls vs m idx leftPart rightPart vsnString newVsn|
 
     cls := self.
     self isMeta ifFalse:[
@@ -2939,25 +2967,34 @@
     idx == 0 ifTrue:[^ self].
     vsnString := rightPart copyTo:idx - 1.
     rightPart := rightPart copyFrom:idx + 1.
-    (vsnString ~= self revision
-    or:[vsnString endsWith:'mod']) ifTrue:[
+
+    (newRevision isNil
+    and:[vsnString endsWith:'mod']) ifTrue:[
 	"/ alread a modified class
 "/        ('already modified: ' , vsnString) printNL.
 	^ self
     ].
+
+    newRevision isNil ifTrue:[  
+	newVsn := vsnString , 'mod'
+    ] ifFalse:[
+	newVsn := newRevision
+    ].
     m source:'version
-^ ''' , leftPart , ' ' , vsnString , 'mod' , ' ' , rightPart , ''''.
-
-"/ ('updated to :' , vsnString , 'mod') printNL.
+^ ''' , leftPart , ' ' , newVsn , ' ' , rightPart , ''''.
+
+"/ ('updated to :' , newVsn) printNL.
 
     "
      Class updateRevisionString
      Number updateRevisionString
      ProcessMonitor updateRevisionString
+     Number revisionString
+     Number revisionString
     "
 
     "Created: 29.10.1995 / 19:25:15 / cg"
-    "Modified: 20.11.1995 / 13:40:29 / cg"
+    "Modified: 24.11.1995 / 10:50:13 / cg"
 ! !
 
 !Class methodsFor:'queries'!