isDirectory implies exists.
authorClaus Gittinger <cg@exept.de>
Mon, 27 Oct 2003 11:01:43 +0100
changeset 5318 02eada09b745
parent 5317 8f813402542f
child 5319 8e89bb5c737f
isDirectory implies exists.
AbstractFileBrowser.st
AbstractSettingsApplication.st
--- a/AbstractFileBrowser.st	Mon Oct 27 10:29:32 2003 +0100
+++ b/AbstractFileBrowser.st	Mon Oct 27 11:01:43 2003 +0100
@@ -5437,7 +5437,7 @@
 
             dirOfFile := self getDirWithoutFileName:fileName.
             cvsDir := dirOfFile construct:'CVS'.
-            (cvsDir isDirectory and:[cvsDir exists])
+            cvsDir isDirectory
         ].
 ! !
 
@@ -6435,5 +6435,5 @@
 !AbstractFileBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.181 2003-10-24 11:20:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.182 2003-10-27 10:01:43 cg Exp $'
 ! !
--- a/AbstractSettingsApplication.st	Mon Oct 27 10:29:32 2003 +0100
+++ b/AbstractSettingsApplication.st	Mon Oct 27 11:01:43 2003 +0100
@@ -8950,10 +8950,9 @@
                            makeExecutableForAll.
                     ]
                 ].
-                (fn exists 
-                and:[fn isDirectory
+                (fn isDirectory
                 and:[fn isReadable
-                and:[fn isWritable]]]) ifTrue:[
+                and:[fn isWritable]]) ifTrue:[
                     AbstractSourceCodeManager cacheDirectoryName:(self sourceCacheDir value).
                 ] ifFalse:[
                     self warn:'Invalid sourceCache directory.'
@@ -9089,27 +9088,28 @@
 cvsRootHolder
 
     cvsRootHolder isNil ifTrue:[
-        cvsRootHolder := ValueHolder new.
+        cvsRootHolder := self cvsRootFromCVSRootFileOrNil asValue.
         cvsRootHolder onChangeSend:#updateModifiedChannel to:self
     ].
     ^ cvsRootHolder.
 !
 
 cvsRootPrototypeList
+    |cvsRoot|
 
     cvsRootPrototypeList isNil ifTrue:[
-        OperatingSystem getDomainName = 'exept' ifFalse:[
+        OperatingSystem getDomainName = 'exept' ifTrue:[
+            cvsRootPrototypeList := #(
+                                '/cvs/stx' 
+                                'exept:/cvs/stx' 
+                             ).
+            cvsRootPrototypeList := cvsRootPrototypeList copyWith:(':pserver:' , OperatingSystem getLoginName , '@exept:/cvs/stx')
+        ] ifFalse:[
             cvsRootPrototypeList := #(
                                 'host:/cvs/stx' 
                                 ':pserver:user@host:/cvs/stx'
                              ).
             cvsRootPrototypeList := cvsRootPrototypeList copyWith:(':pserver:' , OperatingSystem getLoginName , '@host:/cvs/stx')
-        ] ifTrue:[
-            cvsRootPrototypeList := #(
-                                '/cvs/stx' 
-                                'exept:/cvs/stx' 
-                             ).
-            cvsRootPrototypeList := cvsRootPrototypeList copyWith:(':pserver:' , OperatingSystem getLoginName , '@exept:/cvs/stx')
         ].
 
         OperatingSystem isUNIXlike ifTrue:[
@@ -9125,6 +9125,11 @@
                 "there might be more here in the future"
             ]
         ].
+
+        cvsRoot := self cvsRootFromCVSRootFileOrNil.
+        (cvsRoot notNil and:[(cvsRootPrototypeList includes:cvsRoot) not]) ifTrue:[
+            cvsRootPrototypeList := (Array with:cvsRoot) , cvsRootPrototypeList    
+        ].
     ].
     ^ cvsRootPrototypeList.
 !
@@ -9227,10 +9232,9 @@
             ^ self.
         ].
     ].
-    (fn exists 
-    and:[fn isDirectory
+    (fn isDirectory
     and:[fn isReadable
-    and:[fn isWritable]]]) ifTrue:[
+    and:[fn isWritable]]) ifTrue:[
         AbstractSourceCodeManager cacheDirectoryName:nm.
     ] ifFalse:[
         self warn:'Invalid sourceCache directory.'.
@@ -9277,6 +9281,19 @@
 
 !AbstractSettingsApplication::SourceCodeManagementSettingsAppl methodsFor:'queries'!
 
+cvsRootFromCVSRootFileOrNil
+    |cvsDir cvsRootFile cvsRoot|
+
+    cvsDir := 'CVS' asFilename.
+    cvsDir isDirectory ifTrue:[
+        cvsRootFile := cvsDir construct:'Root'.
+        cvsRootFile isReadable ifTrue:[
+            cvsRoot := cvsRootFile contents firstIfEmpty:nil.
+        ].
+    ].
+    ^ cvsRoot
+!
+
 hasManager
     ^ AbstractSourceCodeManager notNil
                   and:[AbstractSourceCodeManager isLoaded]
@@ -10894,5 +10911,5 @@
 !AbstractSettingsApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.117 2003-10-21 22:55:18 cg Exp $'
-! !
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.118 2003-10-27 10:01:19 cg Exp $'
+! !