checkin support
authorClaus Gittinger <cg@exept.de>
Sun, 04 Dec 2011 15:43:35 +0100
changeset 537 f84d9254b1ba
parent 536 c75e274e4796
child 538 2e54a8a0a196
checkin support
MCCommitDialog.st
--- a/MCCommitDialog.st	Sun Dec 04 15:43:28 2011 +0100
+++ b/MCCommitDialog.st	Sun Dec 04 15:43:35 2011 +0100
@@ -38,16 +38,30 @@
         component: 
        (SpecCollection
           collection: (
+           (LabelSpec
+              label: 'Repository:'
+              name: 'Label1'
+              layout: (LayoutFrame 3 0 4 0 94 0 26 0)
+              translateLabel: true
+              adjust: left
+            )
            (ComboListSpec
               name: 'RepositoryList'
-              layout: (LayoutFrame 0 0 0 0 0 1 25 0)
+              layout: (LayoutFrame 101 0 0 0 0 1 25 0)
               model: repositoryHolder
               comboList: repositoryList
               useIndex: false
             )
+           (LabelSpec
+              label: 'Version:'
+              name: 'Label2'
+              layout: (LayoutFrame 3 0 30 0 94 0 52 0)
+              translateLabel: true
+              adjust: left
+            )
            (InputFieldSpec
               name: 'VersionName'
-              layout: (LayoutFrame 0 0 30 0 0 1 55 0)
+              layout: (LayoutFrame 101 0 30 0 0 1 55 0)
               model: versionNameHolder
               immediateAccept: true
               acceptOnReturn: true
@@ -83,30 +97,60 @@
 defaultTitle
     "superclass MCDialog says that I am responsible to implement this method"
 
-    ^ 'Commit'
+    ^ 'Monticello Commit'
 
     "Modified: / 14-09-2010 / 23:00:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-12-2011 / 15:44:08 / cg"
 ! !
 
 !MCCommitDialog methodsFor:'actions'!
 
 doAccept
+    self acceptEnabled ifFalse:[^self].
 
-    | workingCopy version repository |
+    self withWaitCursorDo:[
+        |workingCopy version repository newVersionString stxPackageID defClass|
+
+        workingCopy := self workingCopyHolder value.
+        [
+            version := workingCopy newVersion
+        ] on: MCVersionNameAndMessageRequest do:[:n | 
+            n resume: (Array with: self versionNameHolder value 
+                             with: messageView contents asText string)
+        ].
+
+        stxPackageID := version package name.
+        defClass := ProjectDefinition definitionClassForPackage:stxPackageID.
+        newVersionString := MCSourceCodeManager revisionStringForVersion:version.
 
-    self acceptEnabled ifFalse:[^self].
-    workingCopy := self workingCopyHolder value.
-    [version := workingCopy newVersion]
-                on: MCVersionNameAndMessageRequest
-                do: [:n | 
-                    n resume: 
-                        (Array  with: self versionNameHolder value 
-                                with: messageView contents asText string)].
-    repository := self repositoryHolder value.
-    repository storeVersion: version.
-    super doAccept.
+        "/ update all project classes version_MC
+        defClass allClasses do:[:cls |
+            MCSourceCodeManager 
+                updateVersionMethod:(MCSourceCodeManager nameOfVersionMethodInClasses) 
+                of:cls 
+                for:newVersionString.
+        ].
+
+        "/ update the project definition classes version_MC
+        MCSourceCodeManager 
+            updateVersionMethod:(MCSourceCodeManager nameOfVersionMethodInClasses) 
+            of:defClass 
+            for:newVersionString.
+        MCSourceCodeManager 
+            updateVersionMethod:(MCSourceCodeManager nameOfVersionMethodForExtensions) 
+            of:defClass 
+            for:newVersionString.
+
+        "/ sigh: make a new snapshot (now with updated version methods)
+        version snapshot:version package snapshot.
+
+        repository := self repositoryHolder value.
+        repository storeVersion: version.
+        super doAccept.
+    ].
 
     "Created: / 15-09-2010 / 14:07:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-12-2011 / 16:09:42 / cg"
 ! !
 
 !MCCommitDialog methodsFor:'aspects'!
@@ -315,11 +359,11 @@
 !MCCommitDialog class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.3 2011-12-01 20:02:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.4 2011-12-04 14:43:35 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.3 2011-12-01 20:02:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.4 2011-12-04 14:43:35 cg Exp $'
 !
 
 version_SVN