extension checkIn
authorClaus Gittinger <cg@exept.de>
Thu, 23 Nov 2000 22:43:44 +0100
changeset 1015 89f96d45303e
parent 1014 adf578f3bd16
child 1016 ab35c6af1614
extension checkIn
SourceCodeManagerUtilities.st
--- a/SourceCodeManagerUtilities.st	Thu Nov 23 14:18:15 2000 +0100
+++ b/SourceCodeManagerUtilities.st	Thu Nov 23 22:43:44 2000 +0100
@@ -560,7 +560,8 @@
     "checkin a projects extensions into the source repository.
      If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
 
-    |logMessage info mgr pri resources module package i containerFileName|
+    |logMessage info mgr pri resources module package i containerFileName s 
+     methodSource methodsSortedByName|
 
     resources := ResourcePack for:self.
 
@@ -620,14 +621,31 @@
             ^ false.
         ]
     ].
+
+    "/
+    "/ check for the container
+    "/
+    (mgr checkForExistingContainerInModule:module package:package container:containerFileName) ifFalse:[
+        (Dialog 
+            confirm:(resources string:'%1 is a new container (in %2:%3).\\create it ?' 
+                                 with:containerFileName with:module with:package) withCRs
+            noLabel:'cancel') 
+        ifFalse:[
+            ^ false.
+        ].
+        (mgr createContainerForText:'' inModule:module package:package container:containerFileName) ifFalse:[
+            self warn:(resources string:'cannot create new container: %1 (in %2:%3)' 
+                                 with:containerFileName with:module with:package).
+            ^ false.
+        ]
+    ].
+
     LastPackage := package.
 
     self activityNotification:(resources string:'checking in %1' with:containerFileName).
     pri := Processor activePriority.
     Processor activeProcess withPriority:pri-1 to:pri
     do:[
-        |s methodSource|
-
         s := '' writeStream.
         
         s nextPutAll:'"{ Package: '''.
@@ -638,7 +656,24 @@
 "/        s nextPutChunkSeparator. 
 "/        s cr; cr.
 
-        aCollectionOfMethods do:[:aMethod |
+        "/ sort them by name (to avoid conflict due to CVS merge)
+        methodsSortedByName := aCollectionOfMethods asOrderedCollection.
+        methodsSortedByName sort:[:a :b |
+                                        |clsA clsB|
+
+                                        clsA := a mclass name.
+                                        clsB := b mclass name.
+                                        clsA < clsB ifTrue:[
+                                            true
+                                        ] ifFalse:[
+                                            clsA > clsB ifTrue:[
+                                                false
+                                            ] ifFalse:[
+                                                a selector < b selector
+                                            ]
+                                        ]
+                                  ].
+        methodsSortedByName do:[:aMethod |
             aMethod mclass fileOutMethod:aMethod on:s.
             s cr.
         ].
@@ -1604,5 +1639,5 @@
 !SourceCodeManagerUtilities class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.41 2000-11-22 11:17:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.42 2000-11-23 21:43:44 cg Exp $'
 ! !