ConfigurableFeatures.st
changeset 13944 fe1e60a11816
parent 13888 ee32d4db57f5
child 13948 5c482fe46e20
--- a/ConfigurableFeatures.st	Wed Jan 18 10:59:52 2012 +0100
+++ b/ConfigurableFeatures.st	Wed Jan 18 11:00:40 2012 +0100
@@ -85,14 +85,7 @@
 !
 
 hasCVSSupportEnabled
-    |cvs|
-
-    "/ use Smalltalk-at to trick the dependency/prerequisite generator
-    cvs := Smalltalk at: #'CVSSourceCodeManager' ifAbsent:nil.
-
-    ^ cvs notNil
-        and:[ cvs isLoaded 
-        and:[ cvs enabled ]]
+    ^ self hasSCMSupportEnabledFor:#'CVSSourceCodeManager'
 
     "Created: / 03-01-2012 / 15:42:16 / cg"
 !
@@ -109,14 +102,7 @@
 !
 
 hasDataBaseSourceCodeManagerSupportEnabled
-    |repository|
-
-    "/ use Smalltalk-at to trick the dependency/prerequisite generator
-    repository := Smalltalk at: #'DataBaseSourceCodeManager' ifAbsent:nil.
-
-    ^ repository notNil
-        and:[ repository isLoaded 
-        and:[ repository enabled ]]
+    ^ self hasSCMSupportEnabledFor:#'DataBaseSourceCodeManager'
 
     "Created: / 03-01-2012 / 15:36:12 / cg"
 !
@@ -133,17 +119,32 @@
 !
 
 hasFileBasedSourceCodeManagerSupportEnabled
-    |repository|
-
-    "/ use Smalltalk-at to trick the dependency/prerequisite generator
-    repository := Smalltalk at: #'FileBasedSourceCodeManager' ifAbsent:nil.
-    ^ repository notNil
-        and:[ repository isLoaded 
-        and:[ repository enabled ]]
+    ^ self hasSCMSupportEnabledFor:#'FileBasedSourceCodeManager'
 
     "Created: / 21-12-2011 / 17:07:08 / cg"
 !
 
+hasMercurialSupport
+    "/ use Smalltalk-at to trick the dependency/prerequisite generator
+    ^ (Smalltalk at: #'MercurialSourceCodeManager' ifAbsent:nil) notNil
+
+    "
+     ConfigurableFeatures hasMercurialSupport
+    "
+
+    "Created: / 18-01-2012 / 10:58:07 / cg"
+!
+
+hasMercurialSupportEnabled
+    ^ self hasSCMSupportEnabledFor:#'MercurialSourceCodeManager'
+
+    "
+     self hasMercurialSupportEnabled
+    "
+
+    "Created: / 18-01-2012 / 10:58:12 / cg"
+!
+
 hasMonticelloSupport
     "/ use Smalltalk-at to trick the dependency/prerequisite generator
     ^ (Smalltalk at: #'MonticelloSourceCodeManager' ifAbsent:nil) notNil
@@ -156,14 +157,7 @@
 !
 
 hasMonticelloSupportEnabled
-    |cvs|
-
-    "/ use Smalltalk-at to trick the dependency/prerequisite generator
-    cvs := Smalltalk at: #'MonticelloSourceCodeManager' ifAbsent:nil.
-
-    ^ cvs notNil
-        and:[ cvs isLoaded 
-        and:[ cvs enabled ]]
+    ^ self hasSCMSupportEnabledFor:#'MonticelloSourceCodeManager'
 
     "Created: / 03-01-2012 / 15:44:39 / cg"
 !
@@ -180,21 +174,27 @@
 !
 
 hasPerforceSupportEnabled
-    |cvs|
-
-    "/ use Smalltalk-at to trick the dependency/prerequisite generator
-    cvs := Smalltalk at: #'PerforceSourceCodeManager' ifAbsent:nil.
-
-    ^ cvs notNil
-        and:[ cvs isLoaded 
-        and:[ cvs enabled ]]
+    ^ self hasSCMSupportEnabledFor:#'PerforceSourceCodeManager'
 
     "Created: / 03-01-2012 / 15:43:28 / cg"
 !
 
+hasSCMSupportEnabledFor:aSourceCodeManagerClassName
+    |scm|
+
+    "/ use Smalltalk-at to trick the dependency/prerequisite generator
+    scm := Smalltalk at:aSourceCodeManagerClassName ifAbsent:nil.
+
+    ^ scm notNil
+        and:[ scm isLoaded 
+        and:[ scm shownInBrowserMenus ]]
+
+    "Created: / 18-01-2012 / 10:55:58 / cg"
+!
+
 hasSubversionSupport
     "/ use Smalltalk-at to trick the dependency/prerequisite generator
-    ^ (Smalltalk at: #'SVN::RepositoryManager' ifAbsent:nil) notNil
+    ^ (Smalltalk at: #'SVN::SVNSourceCodeManager' ifAbsent:nil) notNil
 
     "
      ConfigurableFeatures hasSubversionSupport
@@ -204,14 +204,7 @@
 !
 
 hasSubversionSupportEnabled
-    |subVersionRepository|
-
-    "/ use Smalltalk-at to trick the dependency/prerequisite generator
-    subVersionRepository := Smalltalk at: #'SVN::RepositoryManager' ifAbsent:nil.
-
-    ^ subVersionRepository notNil
-        and:[ subVersionRepository isLoaded 
-        and:[ subVersionRepository enabled ]]
+    ^ self hasSCMSupportEnabledFor:#'SVNSourceCodeManager'
 
     "Created: / 07-09-2011 / 10:41:33 / cg"
 ! !
@@ -219,9 +212,9 @@
 !ConfigurableFeatures class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.4 2012-01-03 14:44:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.5 2012-01-18 10:00:40 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.4 2012-01-03 14:44:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.5 2012-01-18 10:00:40 cg Exp $'
 ! !