Tools__ChangeSetSpec.st
changeset 13832 00590bb2d7cf
parent 10741 e4645cbb0958
child 14094 c011b525ae2a
--- a/Tools__ChangeSetSpec.st	Wed Feb 05 19:57:53 2014 +0100
+++ b/Tools__ChangeSetSpec.st	Wed Feb 05 19:57:54 2014 +0100
@@ -1,3 +1,14 @@
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
 "{ Package: 'stx:libtool' }"
 
 "{ NameSpace: Tools }"
@@ -16,6 +27,20 @@
 	privateIn:ChangeSetSpec
 !
 
+ChangeSetSpec subclass:#Explicit
+	instanceVariableNames:'changeSet'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:ChangeSetSpec
+!
+
+ChangeSetSpec subclass:#File
+	instanceVariableNames:'file'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:ChangeSetSpec
+!
+
 ChangeSetSpec subclass:#Package
 	instanceVariableNames:'package'
 	classVariableNames:''
@@ -23,6 +48,65 @@
 	privateIn:ChangeSetSpec
 !
 
+ChangeSetSpec::Directory subclass:#PackageDirectory
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:ChangeSetSpec
+!
+
+!ChangeSetSpec class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+! !
+
+!ChangeSetSpec class methodsFor:'instance creation'!
+
+changeSet
+
+    ^Explicit new
+
+    "Created: / 03-08-2012 / 15:35:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+changeSet: changeset
+
+    ^Explicit new changeSet: changeset
+
+    "Created: / 19-03-2012 / 23:59:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+directory: directory
+
+    ^Directory new package: directory
+
+    "Created: / 19-03-2012 / 23:59:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+file: file
+
+    ^File new file: file
+
+    "Created: / 19-03-2012 / 23:58:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+package: package
+
+    ^Package new package: package
+
+    "Created: / 19-03-2012 / 23:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
 !ChangeSetSpec class methodsFor:'accessing'!
 
@@ -42,9 +126,10 @@
 
 specClasses
 
-    ^self allSubclasses
+    ^(self allSubclasses " reject:[:e|e == Explicit]") asSortedCollection:[:a :b | a name < b name ].
 
     "Created: / 05-07-2011 / 23:30:45 / jv"
+    "Modified: / 12-11-2013 / 15:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetSpec methodsFor:'accessing'!
@@ -56,11 +141,61 @@
     "Created: / 05-07-2011 / 23:13:35 / jv"
 !
 
+directory
+    ^'N/A'
+
+    "Created: / 19-03-2012 / 23:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 editorSpecSelector
 
     ^self class editorSpecSelector
 
     "Created: / 06-07-2011 / 09:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+file
+    ^'N/A'
+
+    "Created: / 19-03-2012 / 23:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+package
+    ^'N/A'
+
+    "Created: / 19-03-2012 / 23:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetSpec methodsFor:'testing'!
+
+isChangeSet
+    ^self isExplicit
+
+    "Created: / 20-03-2012 / 14:58:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isDirectory
+    ^false
+
+    "Created: / 20-03-2012 / 14:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isExplicit
+    ^false
+
+    "Created: / 20-03-2012 / 14:58:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isFile
+    ^false
+
+    "Created: / 20-03-2012 / 14:58:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isPackage
+    ^false
+
+    "Created: / 20-03-2012 / 14:58:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetSpec::Directory class methodsFor:'accessing'!
@@ -106,6 +241,105 @@
     directory := aStringOrFilename.
 ! !
 
+!ChangeSetSpec::Directory methodsFor:'testing'!
+
+isDirectory
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetSpec::Explicit class methodsFor:'accessing'!
+
+editorSpecSelector
+    "superclass Tools::ChangeSetSpec class says that I am responsible to implement this method"
+
+    ^ #editorSpecForExplicit
+
+    "Modified: / 03-08-2012 / 15:21:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+label
+    "superclass Tools::ChangeSetSpec class says that I am responsible to implement this method"
+
+    ^ 'ChangeSet object'
+
+    "Modified: / 03-08-2012 / 15:19:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetSpec::Explicit methodsFor:'accessing'!
+
+changeSet
+    "superclass Tools::ChangeSetSpec says that I am responsible to implement this method"
+
+    ^changeSet isNil ifTrue:[changeSet := ChangeSet new].
+
+    "Modified: / 03-08-2012 / 15:22:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+changeSet:something
+    changeSet := something.
+! !
+
+!ChangeSetSpec::Explicit methodsFor:'testing'!
+
+isExplicit
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetSpec::File class methodsFor:'accessing'!
+
+editorSpecSelector
+    "superclass Tools::ChangeSetSpec class says that I am responsible to implement this method"
+
+    ^ #editorSpecForFile
+
+    "Modified: / 19-03-2012 / 22:04:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+label
+    "superclass Tools::ChangeSetSpec class says that I am responsible to implement this method"
+
+    ^ 'File'
+
+    "Modified: / 19-03-2012 / 22:04:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetSpec::File methodsFor:'accessing'!
+
+changeSet
+    "superclass Tools::ChangeSetSpec says that I am responsible to implement this method"
+
+    | name |
+    name := file asString.
+    name size > 50 ifTrue:[
+        name := '...' , (name copyFrom: name size - 47)
+    ].
+
+    ^(ChangeSet fromFile: self file)
+        name: name
+
+    "Modified: / 20-03-2012 / 11:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+file
+    ^ file
+!
+
+file:something
+    file := something.
+! !
+
+!ChangeSetSpec::File methodsFor:'testing'!
+
+isFile
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ChangeSetSpec::Package class methodsFor:'accessing'!
 
 editorSpecSelector
@@ -119,9 +353,10 @@
 label
     "superclass Tools::ChangeSetSpec class says that I am responsible to implement this method"
 
-    ^ 'Loaded package'
+    ^ 'Package (in image)'
 
     "Modified: / 05-07-2011 / 23:31:34 / jv"
+    "Modified: / 12-11-2013 / 15:17:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetSpec::Package methodsFor:'accessing'!
@@ -143,8 +378,45 @@
     package := aStringOrSymbol.
 ! !
 
+!ChangeSetSpec::Package methodsFor:'testing'!
+
+isPackage
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetSpec::PackageDirectory class methodsFor:'accessing'!
+
+label
+    "superclass Tools::ChangeSetSpec class says that I am responsible to implement this method"
+
+    ^ 'Package (in directory)'
+
+    "Created: / 12-11-2013 / 15:17:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetSpec::PackageDirectory methodsFor:'accessing'!
+
+changeSet
+    "superclass Tools::ChangeSetSpec says that I am responsible to implement this method"
+
+    | name |
+    name := directory asString.
+    name size > 50 ifTrue:[
+        name := '...' , (name copyFrom: name size - 47)
+    ].
+
+    ^(ChangeSet fromDirectory: self directory asSmalltalkXPackage: true)
+        name: name
+
+    "Created: / 12-11-2013 / 15:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-12-2013 / 22:28:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ChangeSetSpec class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__ChangeSetSpec.st,v 1.2 2011-10-02 19:52:17 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__ChangeSetSpec.st,v 1.3 2014-02-05 18:57:54 cg Exp $'
 ! !
+