common/SCMAbstractPackageModel.st
changeset 380 c8b3776ece29
parent 379 8a13fa172b54
child 382 b661dd389038
--- a/common/SCMAbstractPackageModel.st	Thu Feb 20 00:32:41 2014 +0000
+++ b/common/SCMAbstractPackageModel.st	Fri Feb 21 22:08:09 2014 +0000
@@ -5,7 +5,7 @@
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
-version 2.1 of the License. 
+version 2.1 of the License.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -36,7 +36,7 @@
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
-version 2.1 of the License. 
+version 2.1 of the License.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -79,7 +79,7 @@
 
 !SCMAbstractPackageModel class methodsFor:'instance creation'!
 
-named: package 
+named: package
     self subclassResponsibility
 
     "Created: / 16-11-2012 / 19:52:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -120,7 +120,7 @@
 !
 
 commitTask
-    ^self commitTaskClass new 
+    ^self commitTaskClass new
         package: self;
         yourself
 
@@ -187,9 +187,9 @@
      <repo>/mercurial/tests/...
      <repo>/common/..
 
-     then 
+     then
 
-     (HGPackageModelRegistry packageNamed: 'stx:libscm/mercurial/tests') path 
+     (HGPackageModelRegistry packageNamed: 'stx:libscm/mercurial/tests') path
         == 'mercurial/tests'
     "
 
@@ -249,7 +249,7 @@
 !
 
 containerNameForClass:cls
-    ^self 
+    ^self
         containerNameForClassNamed: cls theNonMetaclass fullName
         language: cls programmingLanguage
 
@@ -284,12 +284,12 @@
 
     class := aJavaClass theNonMetaClass.
     "Sigh, make it compatible with old and new naming of Java classes
-           
+
     old -> aJavaClass name == #'java/lang/Object'
     new -> aJavaClass name == JAVA::java::lang::Object
            aJavaClass binaryName == #'java/lang/Object'
     "
-    classBinaryName := (class respondsTo: #binaryName) 
+    classBinaryName := (class respondsTo: #binaryName)
                             ifTrue:[ class binaryName ]
                             ifFalse:[ class name ].
     self assert: (classBinaryName includes: $:) not.
@@ -328,7 +328,7 @@
     "Modified: / 04-09-2012 / 23:44:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-containerWriteStreamForClass:cls 
+containerWriteStreamForClass:cls
     ^self containerWriteStreamFor: (self containerNameForClass:cls)
 
     "Created: / 07-10-2012 / 10:27:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -359,7 +359,7 @@
     | containers jextensions |
 
     containers := OrderedCollection new.
-    containers addAll: 
+    containers addAll:
         (wcroot directoryContents select:
                 [:container|self containerSuffixes anySatisfy:
                     [:suffix|container endsWith:suffix]]) asSet.
@@ -396,10 +396,10 @@
 
             container := self containerNameForExtensions: m programmingLanguage javaClass: m mclass.
             (containers includes: container) ifFalse:[
-                 containers add: container 
+                 containers add: container
             ].
         ].
-    ].    
+    ].
 
     "Keep all directories"
     wcroot directoryContents do: [:f|
@@ -432,10 +432,10 @@
     | childNames nameSizePlus1 |
 
     nameSizePlus1 := name size + 1.
-    childNames := Smalltalk allProjectIDs select:[:each | 
+    childNames := Smalltalk allProjectIDs select:[:each |
         (each startsWith: name)
-        and:[ each ~= name 
-        and:[ ((each at: nameSizePlus1) == $/ or:[ (each at: nameSizePlus1) == $: ]) 
+        and:[ each ~= name
+        and:[ ((each at: nameSizePlus1) == $/ or:[ (each at: nameSizePlus1) == $: ])
         and:[ (each indexOf: $/ startingAt: nameSizePlus1 + 1) == 0]]]].
     ^ childNames collect:[:each |  self childNamed: (each copyFrom: nameSizePlus1 + 1) ].
 
@@ -464,13 +464,13 @@
 !
 
 root
-    "Returns the root of this package model hierarchy, i.e., grand-parent which itself has no parent. 
+    "Returns the root of this package model hierarchy, i.e., grand-parent which itself has no parent.
      See class documentation for details on parents"
 
     | p |
 
     p := self.
-    [ p parent notNil ] whileTrue:[ 
+    [ p parent notNil ] whileTrue:[
         p := p parent.
     ].
     ^ p
@@ -481,9 +481,9 @@
 siblings
     "Returns all my siblings"
 
-    ^ parent notNil
-        ifTrue:[self parent children copy remove: self; yourself]
-        ifFalse:[ #() ]
+    parent notNil
+        ifTrue:[ ^ self parent children copy remove: self; yourself]
+        ifFalse:[ ^ #() ]
 
     "
     (HGPackageModelRegistry packageNamed: 'stx:libscm') siblings
@@ -512,7 +512,7 @@
 
     children at: aString ifPresent:[:child|^child].
     child := self class new.
-    nm := (name includes: $:) 
+    nm := (name includes: $:)
         ifTrue: [name , '/' , aString]
         ifFalse:[name , ':' , aString].
     child setName: nm repository: repository.
@@ -533,7 +533,7 @@
     stream := self  containerWriteStreamForClass:cls.
     [
         self fileOutClass:cls on:stream
-    ] ensure:[ 
+    ] ensure:[
         stream close
     ]
 
@@ -551,10 +551,10 @@
 "/        [:each|each makeLocalStringSource].
 
     self manager
-                fileOutSourceCodeOf:cls 
-                                 on:clsStream 
-                      withTimeStamp:false 
-                     withInitialize:true 
+                fileOutSourceCodeOf:cls
+                                 on:clsStream
+                      withTimeStamp:false
+                     withInitialize:true
                      withDefinition:true
                        methodFilter:[:mth | mth package = name ]
 
@@ -583,7 +583,7 @@
 
 fileOutExtensions: extensionMethods in: directory
 
-    ProgrammingLanguage all do:[:lang| 
+    ProgrammingLanguage all do:[:lang|
         | stream methods |
 
         methods := extensionMethods select:[:mth|mth programmingLanguage = lang].
@@ -632,7 +632,7 @@
     "Modified: / 15-12-2012 / 17:50:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-fileOutExtensions: extensionMethods on:stream language: language 
+fileOutExtensions: extensionMethods on:stream language: language
 
     extensionMethods do:[:each|each makeLocalStringSource].
 
@@ -726,7 +726,7 @@
     "Modified: / 21-06-2013 / 23:45:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-setWorkingCopy: aSCMAbstractWorkingCopy 
+setWorkingCopy: aSCMAbstractWorkingCopy
     wc := aSCMAbstractWorkingCopy.
     wcroot := wc root / self repositoryRoot
 
@@ -782,7 +782,7 @@
                         pkgDef autoloaded_classNames.
 
     realClasses := self classes collect:[:cls | cls fullName ].
-    listedClasses size ~= realClasses size 
+    listedClasses size ~= realClasses size
         ifTrue:[^ true].
     (realClasses allSatisfy:[:realClass | listedClasses includes:realClass ])
         ifFalse:[^true].
@@ -797,7 +797,7 @@
         (CommitTask new package: 'cvut:fel/smallruby')
             computePackageClassesChanged
         (SVN::RepositoryManager workingCopyForPackage: #'stx:libbasic')
-            computePackageClassesChanged 
+            computePackageClassesChanged
     "
 
     "Created: / 06-10-2012 / 23:17:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -808,26 +808,26 @@
     "
         Answers true iff package extension method differs from
         those listed in ProjectDefinition>>extensionMethodNames"
-    
+
     | listedExtensions listedExtensionsDictionary realExtensions |
 
     realExtensions := self  extensions.
-    listedExtensions := self definition 
+    listedExtensions := self definition
                 extensionMethodNames.
     (listedExtensions size / 2) ~= realExtensions size ifTrue:[
         ^ true
     ].
     listedExtensionsDictionary := Dictionary new.
-    listedExtensions 
-        pairWiseDo:[:className :selector | 
+    listedExtensions
+        pairWiseDo:[:className :selector |
             (listedExtensionsDictionary at:className
                 ifAbsentPut:[ OrderedCollection new ]) add:selector
         ].
-    ^ (realExtensions 
-        allSatisfy:[:mth | 
-            (listedExtensionsDictionary includesKey:mth mclass name) 
+    ^ (realExtensions
+        allSatisfy:[:mth |
+            (listedExtensionsDictionary includesKey:mth mclass name)
                 and:[ (listedExtensionsDictionary at:mth mclass name) includes:mth selector ]
-        ]) 
+        ])
             not
 
     "
@@ -842,7 +842,7 @@
 
 ensureTemporaryWorkingCopy
     "raise an error: must be redefined in concrete subclass(es)"
-    
+
     ^ self subclassResponsibility
 ! !