Tools__CheckinInfoDialog.st
branchjv
changeset 15846 52a1c10461cc
parent 15830 21dc9d6ef3a1
parent 15841 c9885b9e9fc1
child 15850 b23c2ebcf7ae
--- a/Tools__CheckinInfoDialog.st	Fri Sep 11 06:22:07 2015 +0100
+++ b/Tools__CheckinInfoDialog.st	Fri Sep 11 06:22:20 2015 +0100
@@ -19,8 +19,10 @@
 	instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder tagHolder
 		quickCheckInHolder quickCheckInVisibleHolder allowEmptyLogMessage
 		warningMessageHolder logHistory logHistoryHeadLineSelectionHolder
-		validateConsistencyHolder validateConsistencyVisibleHolder'
-	classVariableNames:'RecentlyUsedTags'
+		validateConsistencyHolder validateConsistencyVisibleHolder
+		checkinReasonHolder validateConsistencyEnabledHolder
+		quickCheckInEnabledHolder'
+	classVariableNames:'RecentlyUsedTags LastReason'
 	poolDictionaries:''
 	category:'System-SourceCodeManagement'
 !
@@ -82,7 +84,7 @@
 'Mark this as a stable version (i.e. give it a "stable" tag)'
 
 #quickCheckin
-'Only checkin classes which have been vreated or changed during this session'
+'Only checkin classes which have been created or changed during this session'
 
 #tag
 'Mark this version with a symbolic tag (combo list gives list of recently used tags)'
@@ -91,6 +93,9 @@
 'Perform some consistency checks before checking in. 
 Especially checks the correctness of the ProjectDefinition vs. the actual set of classes in the image'
 
+#checkinReason
+'Adds a keyword to the checkin info, to allow automatic generation of revision information from the log later'
+
 )
 ! !
 
@@ -119,7 +124,7 @@
          label: 'Enter Log Message'
          name: 'Enter Log Message'
          min: (Point 10 10)
-         bounds: (Rectangle 0 0 563 327)
+         bounds: (Rectangle 0 0 574 456)
        )
        component: 
       (SpecCollection
@@ -167,7 +172,7 @@
            )
           (TextEditorSpec
              name: 'TextEditor1'
-             layout: (LayoutFrame 2 0.0 68 0 -2 1 -152 1)
+             layout: (LayoutFrame 2 0.0 68 0 -2 1 -250 1)
              activeHelpKey: logMessage
              model: logMessageHolder
              hasHorizontalScrollBar: true
@@ -176,32 +181,34 @@
            )
           (LabelSpec
              name: 'Label4'
-             layout: (LayoutFrame 0 0.0 -147 1 0 1.0 -125 1)
+             layout: (LayoutFrame 0 0.0 -245 1 0 1.0 -223 1)
              translateLabel: true
              labelChannel: warningMessageHolder
            )
           (CheckBoxSpec
+             label: 'Quick Checkin (Only Classes in ChangeSet)'
+             name: 'CheckInChangedOnlyCheckbox'
+             layout: (LayoutFrame 3 0 -220 1 -3 1 -198 1)
+             activeHelpKey: quickCheckin
+             visibilityChannel: quickCheckInVisibleHolder
+             enableChannel: quickCheckInEnabledHolder
+             model: quickCheckInHolder
+             translateLabel: true
+           )
+          (CheckBoxSpec
              label: 'Validate Package Consistency'
              name: 'CheckBox1'
-             layout: (LayoutFrame 3 0 -122 1 -3 1 -100 1)
+             layout: (LayoutFrame 3 0 -193 1 -3 1 -171 1)
              activeHelpKey: validateConsistency
              visibilityChannel: validateConsistencyVisibleHolder
+             enableChannel: validateConsistencyEnabledHolder
              model: validateConsistencyHolder
              translateLabel: true
            )
           (CheckBoxSpec
-             label: 'Quick Checkin (Only Classes in ChangeSet)'
-             name: 'CheckInChangedOnlyCheckbox'
-             layout: (LayoutFrame 3 0 -95 1 -3 1 -73 1)
-             activeHelpKey: quickCheckin
-             visibilityChannel: quickCheckInVisibleHolder
-             model: quickCheckInHolder
-             translateLabel: true
-           )
-          (CheckBoxSpec
              label: 'Mark as Stable'
              name: 'MarkStableCheckBox'
-             layout: (LayoutFrame 3 0 -68 1 -3 1 -46 1)
+             layout: (LayoutFrame 3 0 -166 1 -3 1 -144 1)
              activeHelpKey: markAsStable
              model: isStableHolder
              translateLabel: true
@@ -209,14 +216,14 @@
           (LabelSpec
              label: 'Tag:'
              name: 'Label3'
-             layout: (LayoutFrame -40 0.5 -67 1 0 0.5 -45 1)
+             layout: (LayoutFrame -40 0.5 -165 1 0 0.5 -143 1)
              activeHelpKey: tag
              translateLabel: true
              adjust: right
            )
           (ComboBoxSpec
              name: 'ComboBox1'
-             layout: (LayoutFrame 0 0.5 -68 1 -3 1 -46 1)
+             layout: (LayoutFrame 0 0.5 -166 1 -3 1 -144 1)
              activeHelpKey: tag
              enableChannel: notMarkAsStableHolder
              model: tagHolder
@@ -242,20 +249,69 @@
                    name: 'Button2'
                    translateLabel: true
                    model: doCancel
-                   extent: (Point 269 22)
+                   extent: (Point 274 22)
                  )
                 (ActionButtonSpec
                    label: 'OK'
                    name: 'Button1'
                    translateLabel: true
                    model: doAccept
-                   extent: (Point 269 22)
+                   extent: (Point 275 22)
                  )
                 )
               
              )
              keepSpaceForOSXResizeHandleH: true
            )
+          (LabelSpec
+             label: 'Reason for Checkin:'
+             name: 'Label6'
+             layout: (AlignmentOrigin -126 0.5 -122 1 1 0.5)
+             activeHelpKey: checkinReason
+             translateLabel: true
+             resizeForLabel: true
+             adjust: right
+           )
+          (RadioButtonSpec
+             activeHelpKey: checkinReason
+             label: 'Bugfix'
+             name: 'RadioButton1'
+             layout: (LayoutFrame -123 0.5 323 0 -126 1 345 0)
+             translateLabel: true
+             model: checkinReasonHolder
+             isTriggerOnDown: true
+             select: 'reasonBugfix'
+           )
+          (RadioButtonSpec
+             activeHelpKey: checkinReason
+             label: 'Feature / Enhancement'
+             name: 'RadioButton2'
+             layout: (LayoutFrame -123 0.5 347 0 -126 1 369 0)
+             translateLabel: true
+             model: checkinReasonHolder
+             isTriggerOnDown: true
+             select: reasonFeature
+           )
+          (RadioButtonSpec
+             activeHelpKey: checkinReason
+             label: 'Refactoring / Code Cleanup'
+             name: 'RadioButton3'
+             layout: (LayoutFrame -123 0.5 371 0 -126 1 393 0)
+             translateLabel: true
+             model: checkinReasonHolder
+             isTriggerOnDown: true
+             select: reasonRefactoring
+           )
+          (RadioButtonSpec
+             activeHelpKey: checkinReason
+             label: 'None of the Above'
+             name: 'RadioButton4'
+             layout: (LayoutFrame -123 0.5 395 0 -126 1 417 0)
+             translateLabel: true
+             model: checkinReasonHolder
+             isTriggerOnDown: true
+             select: reasonOther
+           )
           )
         
        )
@@ -308,7 +364,31 @@
     "Created: / 12-03-2012 / 12:36:26 / cg"
 !
 
-getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer withQuickOption:withQuickOption logHistory:logHistoryArg withValidateConsistencyOption:withValidateConsistencyOption
+getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer 
+                withQuickOption:withQuickOption 
+                logHistory:logHistoryArg 
+                withValidateConsistencyOption:withValidateConsistencyOption
+    ^ self
+        getCheckinInfoFor:aClassNameOrPackageNameString 
+        initialAnswer:initialAnswer 
+        withQuickOption:withQuickOption 
+        logHistory:logHistoryArg 
+        withValidateConsistencyOption:withValidateConsistencyOption
+        initialReason:(LastReason ? self reasonBugfix)
+
+    "
+     self getCheckinInfoFor:'hello' initialAnswer:'bla'
+    "
+
+    "Created: / 12-03-2012 / 12:36:26 / cg"
+!
+
+getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer 
+            withQuickOption:withQuickOption 
+            logHistory:logHistoryArg 
+            withValidateConsistencyOption:withValidateConsistencyOption
+            initialReason:defaultReason
+
     |dialog warnMessage|
 
     warnMessage := nil.
@@ -319,7 +399,8 @@
             logMessage:initialAnswer;
             withQuickOption:withQuickOption;
             withValidateConsistencyOption:withValidateConsistencyOption;
-            logHistory:logHistoryArg.
+            logHistory:logHistoryArg;
+            checkinReason:defaultReason.
 
         dialog warningMessageHolder value:warnMessage.
         dialog open.
@@ -336,6 +417,7 @@
         ].
         stopAsking
     ].
+    LastReason := dialog checkinReason.
     ^ dialog    
 
 
@@ -344,6 +426,22 @@
     "
 
     "Created: / 12-03-2012 / 12:36:26 / cg"
+!
+
+reasonBugfix
+    ^ #reasonBugfix
+!
+
+reasonFeature
+    ^ #reasonFeature
+!
+
+reasonOther
+    ^ #reasonOther
+!
+
+reasonRefactoring
+    ^ #reasonRefactoring
 ! !
 
 !CheckinInfoDialog methodsFor:'accessing'!
@@ -360,6 +458,17 @@
     "Created: / 06-07-2010 / 11:23:31 / cg"
 !
 
+checkinReason
+    "returns one of: #(reasonBugfix reasonFeature reasonRefactoring reasonOther)"
+
+    ^ self checkinReasonHolder value
+!
+
+checkinReason:aSymbolicReason
+    self assert:( #(reasonBugfix reasonFeature reasonRefactoring reasonOther) includes:aSymbolicReason).
+    self checkinReasonHolder value:aSymbolicReason
+!
+
 description
     ^ self descriptionHolder value
 !
@@ -417,15 +526,24 @@
 !
 
 withQuickOption:aBoolean
-    ^ self quickCheckInVisibleHolder value:aBoolean
+    self quickCheckInEnabledHolder value:aBoolean
+    "/ self quickCheckInVisibleHolder value:aBoolean
 !
 
 withValidateConsistencyOption:aBoolean
-    ^ self validateConsistencyVisibleHolder value:aBoolean
+    self validateConsistencyEnabledHolder value:aBoolean
+    "/ self validateConsistencyVisibleHolder value:aBoolean
 ! !
 
 !CheckinInfoDialog methodsFor:'aspects'!
 
+checkinReasonHolder
+    checkinReasonHolder isNil ifTrue:[
+        checkinReasonHolder := (LastReason ? self class reasonBugfix) asValue.
+    ].
+    ^ checkinReasonHolder
+!
+
 descriptionHolder
     descriptionHolder isNil ifTrue:[
         descriptionHolder := ValueHolder new.
@@ -478,6 +596,13 @@
     ^ BlockValue forLogicalNot:self isStableHolder
 !
 
+quickCheckInEnabledHolder
+    quickCheckInEnabledHolder isNil ifTrue:[
+        quickCheckInEnabledHolder := false asValue.
+    ].
+    ^ quickCheckInEnabledHolder
+!
+
 quickCheckInHolder
     quickCheckInHolder isNil ifTrue:[
         quickCheckInHolder := true asValue.
@@ -487,7 +612,7 @@
 
 quickCheckInVisibleHolder
     quickCheckInVisibleHolder isNil ifTrue:[
-        quickCheckInVisibleHolder := false asValue.
+        quickCheckInVisibleHolder := true asValue.
     ].
     ^ quickCheckInVisibleHolder
 !
@@ -503,6 +628,13 @@
     ^ tagHolder
 !
 
+validateConsistencyEnabledHolder
+    validateConsistencyEnabledHolder isNil ifTrue:[
+        validateConsistencyEnabledHolder := false asValue.
+    ].
+    ^ validateConsistencyEnabledHolder
+!
+
 validateConsistencyHolder
     validateConsistencyHolder isNil ifTrue:[
         validateConsistencyHolder := true asValue.
@@ -512,7 +644,7 @@
 
 validateConsistencyVisibleHolder
     validateConsistencyVisibleHolder isNil ifTrue:[
-        validateConsistencyVisibleHolder := false asValue.
+        validateConsistencyVisibleHolder := true asValue.
     ].
     ^ validateConsistencyVisibleHolder
 !