#UI_ENHANCEMENT by cg
class: AbstractSourceCodeManager
changed: #checkinClass:fileName:directory:module:logMessage:force:
better info message
--- a/AbstractSourceCodeManager.st Sat Apr 30 14:40:49 2016 +0200
+++ b/AbstractSourceCodeManager.st Sat Apr 30 14:42:15 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1995 by Claus Gittinger
All Rights Reserved
@@ -2096,15 +2098,16 @@
"checkin of a class into the source repository.
Return true if ok, false if not."
- |className answer allLabel allValue
- nameOfVersionMethodInClasses revision|
+ |theMetaclass className answer allLabel allValue
+ nameOfVersionMethodInClasses revision question|
className := aClass name.
+ theMetaclass := aClass theMetaclass.
nameOfVersionMethodInClasses := self nameOfVersionMethodInClasses.
(revision := aClass revisionOfManager:self) isNil ifTrue:[
force ifFalse:[
- ('SourceCodeManager [warning]: class ' , className, ' has no revision string') errorPrintCR.
+ ('SourceCodeManager [warning]: class "%1" has no revision string (for %2)' bindWith:className with:self managerTypeName) errorPrintCR.
AbortAllOperationWantedQuery query ifTrue:[
allLabel := #('Cancel All').
@@ -2114,16 +2117,22 @@
allValue := #().
].
- ((aClass theMetaclass includesSelector:#version)
- or:[aClass theMetaclass includesSelector: nameOfVersionMethodInClasses]) ifTrue:[
+ ((theMetaclass includesSelector:#version)
+ or:[theMetaclass includesSelector: nameOfVersionMethodInClasses]) ifTrue:[
+
+ (theMetaclass includesSelector: nameOfVersionMethodInClasses) ifTrue:[
+ question := 'Class "%1" has a broken revision string (for %2).\\Checkin as newest?'
+ ] ifFalse:[
+ question := 'Class "%1" has no revision string (for %2).\\Initial Checkin?'
+ ].
answer := OptionBox
- request:('Class %1 has unusable or broken revision string.\\Check in as newest ?' bindWith:className allBold) withCRs
+ request:(question bindWith:className allBold with:self managerTypeName) withCRs
label:'Confirm'
buttonLabels:(allLabel , #('Cancel' 'Browse & Cancel' 'CheckIn'))
values:(allValue , #(false #browse #checkIn))
default:#checkIn.
answer == #browse ifTrue:[
- UserPreferences browserClass openInClass:aClass theMetaclass.
+ UserPreferences browserClass openInClass:theMetaclass.
AbortOperationRequest raise. ^ false
].
] ifFalse:[
@@ -2162,7 +2171,7 @@
"Created: / 11-09-1996 / 16:15:17 / cg"
"Modified: / 25-09-1997 / 12:16:00 / stefan"
- "Modified: / 21-12-2011 / 19:30:38 / cg"
+ "Modified: / 30-04-2016 / 12:59:59 / cg"
!
checkinClass:aClass logMessage:logMessage
@@ -2525,12 +2534,12 @@
|versionString|
- versionString := aString copyWithout: $§.
+ versionString := aString copyWithout: $§.
^ self ensureKeywordExpansionWith: $$ inVersionMethod:versionString.
"
self ensureDollarsInVersionMethod:'foo ^ ''hello'' '
- self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' '
+ self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' '
self ensureDollarsInVersionMethod:'foo ^ '' hello '' '
self ensureDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '
-- errors:
@@ -2615,17 +2624,17 @@
,aCharacter asString ,(aString copyFrom:indexOfLastQuote)
"
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ '' hello '' '
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ '' hello '' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''hello'' '
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ '' hello '' '
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '
-- errors:
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '
- self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '
+ self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '
"
!
@@ -2638,23 +2647,23 @@
ensureNoDollarsInVersionMethod:aString
"given the source code of another manager's version method, ensure that it does NOT
- contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
+ contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
|versionString|
versionString := aString copyWithout: $$.
- ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
+ ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
"
self ensureNoDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '
self ensureNoDollarsInVersionMethod:'foo ^ ''$','Head'' '
self ensureNoDollarsInVersionMethod:'foo ^ ''Header$'' '
- self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '
+ self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '
-- errors:
- self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '
- self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '
+ self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '
+ self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '
"
!