refactoring
authorClaus Gittinger <cg@exept.de>
Thu, 22 Dec 2011 10:00:21 +0100
changeset 11000 c7b3a7eea7ea
parent 10999 ad10cd0cd55e
child 11001 dc458429e214
refactoring
FileBasedSourceCodeManagementSettingsAppl.st
--- a/FileBasedSourceCodeManagementSettingsAppl.st	Thu Dec 22 10:00:17 2011 +0100
+++ b/FileBasedSourceCodeManagementSettingsAppl.st	Thu Dec 22 10:00:21 2011 +0100
@@ -12,8 +12,7 @@
 "{ Package: 'stx:libtool' }"
 
 AbstractSourceCodeManagementSettingsAppl subclass:#FileBasedSourceCodeManagementSettingsAppl
-	instanceVariableNames:'sourceCacheDir repositoryHolder manager repository listOfModules
-		removeEnabled acceptChannel rootsPerModule pathPerModule
+	instanceVariableNames:'listOfModules removeEnabled acceptChannel pathPerModule
 		verboseSourceCodeAccess repositoryPathHolder perModulePath
 		perModulePathModule selectedPerModulePath'
 	classVariableNames:'RecentlyUsedCVSRoots RecentlyUsedStoreHosts
@@ -48,8 +47,7 @@
 !FileBasedSourceCodeManagementSettingsAppl class methodsFor:'defaults'!
 
 defaultRepositoryPath
-
-    ^ './versions'
+    ^ FileBasedSourceCodeManager defaultRepositoryPath
 
     "Created: / 21-12-2011 / 14:55:40 / cg"
 ! !
@@ -136,8 +134,8 @@
         name: windowSpec
         window: 
        (WindowSpec
-          label: 'CVS Settings'
-          name: 'CVS Settings'
+          label: 'FileBased SCM Settings'
+          name: 'FileBased SCM Settings'
           min: (Point 10 10)
           bounds: (Rectangle 0 0 659 580)
         )
@@ -195,7 +193,7 @@
                                             name: 'RepositoryPathField'
                                             layout: (LayoutFrame 64 0.25 0 0 0 1 22 0)
                                             tabable: true
-                                            model: cvsExecutableHolder
+                                            model: repositoryPathHolder
                                             acceptChannel: acceptChannel
                                             acceptOnPointerLeave: true
                                           )
@@ -314,8 +312,6 @@
          
         )
       )
-
-    "Modified: / 21-12-2011 / 14:36:29 / cg"
 ! !
 
 !FileBasedSourceCodeManagementSettingsAppl class methodsFor:'queries'!
@@ -367,14 +363,14 @@
         pathPerModule at:module put:(Array with:FileBasedSourceCodeManager with:info).
     ].
 
-    self repositoryPathHolder value:FileBasedSourceCodeManager repositoryPath ? self class defaultRepositoryPath.
+    self repositoryPathHolder value:FileBasedSourceCodeManager repositoryPath ? FileBasedSourceCodeManager defaultRepositoryPath.
 
     pathPerModule notNil ifTrue:[
         self listOfModules removeAll.
         listOfModules addAll:pathPerModule keys asList.
     ].
 
-    "Modified: / 21-12-2011 / 14:29:08 / cg"
+    "Modified: / 22-12-2011 / 00:29:05 / cg"
 !
 
 basicSaveSettings
@@ -387,11 +383,13 @@
             infoPerModule at:module put:(entry second).
         ].
     ].
+
     FileBasedSourceCodeManager repositoryInfoPerModule:infoPerModule.
+    FileBasedSourceCodeManager repositoryPath:(self repositoryPathHolder value).
 
     self acceptChannel value.
 
-    "Modified: / 21-12-2011 / 14:27:47 / cg"
+    "Modified (format): / 22-12-2011 / 00:32:16 / cg"
 !
 
 condenseSourceCache
@@ -448,7 +446,7 @@
 
 pathPrototypeList
     ^ #(
-            './versions'
+            './repository'
         )
 
     "Created: / 21-12-2011 / 13:13:05 / cg"
@@ -482,9 +480,8 @@
 !
 
 repositoryPathHolder
-
     repositoryPathHolder isNil ifTrue:[
-        repositoryPathHolder := './versions' asValue.
+        repositoryPathHolder := FileBasedSourceCodeManager defaultRepositoryPath asValue.
         repositoryPathHolder addDependent:self.
     ].
     ^ repositoryPathHolder.
@@ -544,10 +541,14 @@
         self selectedPerModulePathChanged.
         ^ self
     ].
+    changedObject == repositoryPathHolder ifTrue:[
+        self updateModifiedChannel.
+        ^ self
+    ].
 
     super update:something with:aParameter from:changedObject
 
-    "Modified: / 21-12-2011 / 14:37:54 / cg"
+    "Modified: / 22-12-2011 / 00:27:48 / cg"
 !
 
 validateDirectoryExistsAndIsWritable:aDirectory
@@ -615,7 +616,6 @@
 initialize
     (AbstractSourceCodeManager notNil) ifTrue:[ AbstractSourceCodeManager autoload ].
 
-    repositoryHolder := '' asValue.
     pathPerModule := Dictionary new.
 
     FileBasedSourceCodeManager repositoryInfoPerModule 
@@ -628,27 +628,17 @@
 
     super initialize.
 
-    "Modified: / 21-12-2011 / 14:32:23 / cg"
+    "Modified: / 21-12-2011 / 23:50:23 / cg"
 ! !
 
 !FileBasedSourceCodeManagementSettingsAppl 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
-!
-
 hasUnsavedChanges
     |modules|
 
+    (FileBasedSourceCodeManager repositoryPath ? FileBasedSourceCodeManager defaultRepositoryPath) ~= self repositoryPathHolder value    
+        ifTrue:[^ true].
+
     modules := pathPerModule select:[:entry | entry first == FileBasedSourceCodeManager].
 
     FileBasedSourceCodeManager repositoryInfoPerModule keysAndValuesDo:[:module :info |
@@ -662,17 +652,17 @@
 
     ^ false
 
-    "Modified: / 21-12-2011 / 14:33:14 / cg"
+    "Modified (format): / 22-12-2011 / 00:25:23 / cg"
 ! !
 
 !FileBasedSourceCodeManagementSettingsAppl class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileBasedSourceCodeManagementSettingsAppl.st,v 1.1 2011-12-21 18:44:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileBasedSourceCodeManagementSettingsAppl.st,v 1.2 2011-12-22 09:00:21 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/FileBasedSourceCodeManagementSettingsAppl.st,v 1.1 2011-12-21 18:44:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileBasedSourceCodeManagementSettingsAppl.st,v 1.2 2011-12-22 09:00:21 cg Exp $'
 !
 
 version_FileRepository