compare revision added
authorClaus Gittinger <cg@exept.de>
Tue, 21 Nov 1995 14:39:12 +0100
changeset 187 781f0c88e196
parent 186 4980d43818e5
child 188 247042d21994
compare revision added
BrowserView.st
BrwsrView.st
--- a/BrowserView.st	Tue Nov 21 10:14:45 1995 +0100
+++ b/BrowserView.st	Tue Nov 21 14:39:12 1995 +0100
@@ -28,7 +28,7 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.42 1995-11-17 17:24:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.43 1995-11-21 13:39:12 cg Exp $'
 !
 
 documentation
@@ -874,6 +874,98 @@
     ]
 ! !
 
+!BrowserView methodsFor:'class list source administration'!
+
+classCheckin
+    "check a class into the source repository"
+
+    self doClassMenu:[:currentClass |
+	|logMessage|
+
+	logMessage := Dialog 
+			 request:'enter a log message:' 
+			 initialAnswer:''  
+			 onCancel:nil.
+	logMessage notNil ifTrue:[
+	    SourceCodeManager checkinClass:currentClass logMessage:logMessage
+	]
+    ]
+!
+
+classCompareWithNewestInRepository
+    "open a diff-textView comparing the current (in-image) version
+     with the most recent version found in the repository."
+
+    self doClassMenu:[:currentClass |
+	|aStream newestSource currentSource v|
+
+	aStream := SourceCodeManager mostRecentSourceStreamForClassNamed:currentClass name.
+	newestSource := aStream contents.
+	aStream close.
+
+	aStream := '' writeStream.
+	currentClass fileOutOn:aStream.
+	currentSource := aStream contents.
+	aStream close.
+
+	v := DiffTextView 
+	    openOn:currentSource label:'current (' , currentClass revision , ')'
+	    and:newestSource label:'newest'.      
+	v label:'comparing ' , currentClass name.
+    ]
+
+    "Created: 14.11.1995 / 16:43:15 / cg"
+    "Modified: 17.11.1995 / 17:51:56 / cg"
+!
+
+classRevisionInfo
+    "show current classes revision info in codeView"
+
+    self doClassMenu:[:currentClass |
+	|aStream info info2 s|
+
+	aStream := WriteStream on:(String new:200).
+	currentClass notNil ifTrue:[
+	    info := currentClass revisionInfo.
+	    info notNil ifTrue:[
+		s := info at:#repositoryPath ifAbsent:nil.
+		s notNil ifTrue:[
+		    aStream nextPut:'Source repository : ' , s; cr
+		].
+		aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
+		aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
+		aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
+		aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
+
+		(info2 := currentClass sourceCodeInfo) notNil ifTrue:[
+		    aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
+		    aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
+		].
+		aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
+		aStream cr.
+
+		SourceCodeManager notNil ifTrue:[
+		    aStream nextPutAll:'Revision log:'; cr; cr.
+		    SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
+		]
+	    ]
+	].
+	codeView contents:(aStream contents).
+
+	codeView modified:false.
+	codeView acceptAction:nil.
+	codeView explainAction:nil.
+	methodListView notNil ifTrue:[
+	    methodListView deselect
+	].
+	aspect := #revision. 
+	self normalLabel
+    ]
+
+    "Created: 14.11.1995 / 16:43:15 / cg"
+    "Modified: 17.11.1995 / 17:51:56 / cg"
+! !
+
 !BrowserView methodsFor:'class list menu'!
 
 classDefinition
@@ -972,6 +1064,7 @@
 	labels := labels , #(
 			     '-'
 			     'revision info' 
+			     'compare with repository' 
 			     '-'
 			     'check into source repository'
 			   ).
@@ -979,6 +1072,7 @@
 	selectors := selectors , #(
 			     nil
 			     classRevisionInfo
+			     classCompareWithNewestInRepository
 			     nil
 			     classCheckin
 			    ).
@@ -1098,7 +1192,7 @@
 	    selectors:selectors.
 
     SourceCodeManager isNil ifTrue:[
-	m disableAll:#(classRevisionInfo classCheckin).
+	m disableAll:#(classRevisionInfo classCheckin classCompareWithNewestInRepository).
     ].
 
     ^ m
@@ -1126,70 +1220,6 @@
     ]
 !
 
-classCheckin
-    "check a class into the source repository"
-
-    self doClassMenu:[:currentClass |
-	|logMessage|
-
-	logMessage := Dialog 
-			 request:'enter a log message:' 
-			 initialAnswer:''  
-			 onCancel:nil.
-	logMessage notNil ifTrue:[
-	    SourceCodeManager checkinClass:currentClass logMessage:logMessage
-	]
-    ]
-!
-
-classRevisionInfo
-    "show current classes revision info in codeView"
-
-    self doClassMenu:[:currentClass |
-	|aStream info info2 s|
-
-	aStream := WriteStream on:(String new:200).
-	currentClass notNil ifTrue:[
-	    info := currentClass revisionInfo.
-	    info notNil ifTrue:[
-		s := info at:#repositoryPath ifAbsent:nil.
-		s notNil ifTrue:[
-		    aStream nextPut:'Source repository : ' , s; cr
-		].
-		aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
-		aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
-		aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
-		aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
-
-		(info2 := currentClass sourceCodeInfo) notNil ifTrue:[
-		    aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
-		    aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
-		].
-		aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
-		aStream cr.
-
-		SourceCodeManager notNil ifTrue:[
-		    aStream nextPutAll:'Revision log:'; cr; cr.
-		    SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
-		]
-	    ]
-	].
-	codeView contents:(aStream contents).
-
-	codeView modified:false.
-	codeView acceptAction:nil.
-	codeView explainAction:nil.
-	methodListView notNil ifTrue:[
-	    methodListView deselect
-	].
-	aspect := #revision. 
-	self normalLabel
-    ]
-
-    "Created: 14.11.1995 / 16:43:15 / cg"
-    "Modified: 17.11.1995 / 17:51:56 / cg"
-!
-
 doClassMenuWithSelection:aBlock
     "a helper - if there is a selection, which represents a classes name,
      evaluate aBlock, passing that class and optional selector as arguments.
--- a/BrwsrView.st	Tue Nov 21 10:14:45 1995 +0100
+++ b/BrwsrView.st	Tue Nov 21 14:39:12 1995 +0100
@@ -28,7 +28,7 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.42 1995-11-17 17:24:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.43 1995-11-21 13:39:12 cg Exp $'
 !
 
 documentation
@@ -874,6 +874,98 @@
     ]
 ! !
 
+!BrowserView methodsFor:'class list source administration'!
+
+classCheckin
+    "check a class into the source repository"
+
+    self doClassMenu:[:currentClass |
+	|logMessage|
+
+	logMessage := Dialog 
+			 request:'enter a log message:' 
+			 initialAnswer:''  
+			 onCancel:nil.
+	logMessage notNil ifTrue:[
+	    SourceCodeManager checkinClass:currentClass logMessage:logMessage
+	]
+    ]
+!
+
+classCompareWithNewestInRepository
+    "open a diff-textView comparing the current (in-image) version
+     with the most recent version found in the repository."
+
+    self doClassMenu:[:currentClass |
+	|aStream newestSource currentSource v|
+
+	aStream := SourceCodeManager mostRecentSourceStreamForClassNamed:currentClass name.
+	newestSource := aStream contents.
+	aStream close.
+
+	aStream := '' writeStream.
+	currentClass fileOutOn:aStream.
+	currentSource := aStream contents.
+	aStream close.
+
+	v := DiffTextView 
+	    openOn:currentSource label:'current (' , currentClass revision , ')'
+	    and:newestSource label:'newest'.      
+	v label:'comparing ' , currentClass name.
+    ]
+
+    "Created: 14.11.1995 / 16:43:15 / cg"
+    "Modified: 17.11.1995 / 17:51:56 / cg"
+!
+
+classRevisionInfo
+    "show current classes revision info in codeView"
+
+    self doClassMenu:[:currentClass |
+	|aStream info info2 s|
+
+	aStream := WriteStream on:(String new:200).
+	currentClass notNil ifTrue:[
+	    info := currentClass revisionInfo.
+	    info notNil ifTrue:[
+		s := info at:#repositoryPath ifAbsent:nil.
+		s notNil ifTrue:[
+		    aStream nextPut:'Source repository : ' , s; cr
+		].
+		aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
+		aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
+		aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
+		aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
+
+		(info2 := currentClass sourceCodeInfo) notNil ifTrue:[
+		    aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
+		    aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
+		].
+		aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
+		aStream cr.
+
+		SourceCodeManager notNil ifTrue:[
+		    aStream nextPutAll:'Revision log:'; cr; cr.
+		    SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
+		]
+	    ]
+	].
+	codeView contents:(aStream contents).
+
+	codeView modified:false.
+	codeView acceptAction:nil.
+	codeView explainAction:nil.
+	methodListView notNil ifTrue:[
+	    methodListView deselect
+	].
+	aspect := #revision. 
+	self normalLabel
+    ]
+
+    "Created: 14.11.1995 / 16:43:15 / cg"
+    "Modified: 17.11.1995 / 17:51:56 / cg"
+! !
+
 !BrowserView methodsFor:'class list menu'!
 
 classDefinition
@@ -972,6 +1064,7 @@
 	labels := labels , #(
 			     '-'
 			     'revision info' 
+			     'compare with repository' 
 			     '-'
 			     'check into source repository'
 			   ).
@@ -979,6 +1072,7 @@
 	selectors := selectors , #(
 			     nil
 			     classRevisionInfo
+			     classCompareWithNewestInRepository
 			     nil
 			     classCheckin
 			    ).
@@ -1098,7 +1192,7 @@
 	    selectors:selectors.
 
     SourceCodeManager isNil ifTrue:[
-	m disableAll:#(classRevisionInfo classCheckin).
+	m disableAll:#(classRevisionInfo classCheckin classCompareWithNewestInRepository).
     ].
 
     ^ m
@@ -1126,70 +1220,6 @@
     ]
 !
 
-classCheckin
-    "check a class into the source repository"
-
-    self doClassMenu:[:currentClass |
-	|logMessage|
-
-	logMessage := Dialog 
-			 request:'enter a log message:' 
-			 initialAnswer:''  
-			 onCancel:nil.
-	logMessage notNil ifTrue:[
-	    SourceCodeManager checkinClass:currentClass logMessage:logMessage
-	]
-    ]
-!
-
-classRevisionInfo
-    "show current classes revision info in codeView"
-
-    self doClassMenu:[:currentClass |
-	|aStream info info2 s|
-
-	aStream := WriteStream on:(String new:200).
-	currentClass notNil ifTrue:[
-	    info := currentClass revisionInfo.
-	    info notNil ifTrue:[
-		s := info at:#repositoryPath ifAbsent:nil.
-		s notNil ifTrue:[
-		    aStream nextPut:'Source repository : ' , s; cr
-		].
-		aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
-		aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
-		aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
-		aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
-
-		(info2 := currentClass sourceCodeInfo) notNil ifTrue:[
-		    aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
-		    aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
-		].
-		aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
-		aStream cr.
-
-		SourceCodeManager notNil ifTrue:[
-		    aStream nextPutAll:'Revision log:'; cr; cr.
-		    SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
-		]
-	    ]
-	].
-	codeView contents:(aStream contents).
-
-	codeView modified:false.
-	codeView acceptAction:nil.
-	codeView explainAction:nil.
-	methodListView notNil ifTrue:[
-	    methodListView deselect
-	].
-	aspect := #revision. 
-	self normalLabel
-    ]
-
-    "Created: 14.11.1995 / 16:43:15 / cg"
-    "Modified: 17.11.1995 / 17:51:56 / cg"
-!
-
 doClassMenuWithSelection:aBlock
     "a helper - if there is a selection, which represents a classes name,
      evaluate aBlock, passing that class and optional selector as arguments.