SourceCodeManagerUtilities.st
author Stefan Vogel <sv@exept.de>
Thu, 23 Feb 2006 16:47:40 +0100
changeset 1462 2b2c6acdb53f
parent 1460 2e1c304e5b52
child 1466 82e4152d5e9e
permissions -rw-r--r--
Take care of timezone information in header strings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     1
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     2
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     3
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     4
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     5
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     6
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     8
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     9
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    10
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    11
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    12
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    13
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    14
"{ Package: 'stx:libbasic3' }"
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    15
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
Object subclass:#SourceCodeManagerUtilities
1053
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    17
	instanceVariableNames:''
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    18
	classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    19
		YesToAllNotification'
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    20
	poolDictionaries:''
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    21
	category:'System-SourceCodeManagement'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
    24
SimpleDialog subclass:#CheckinInfoDialog
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
    25
	instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
    26
	classVariableNames:'LastSourceLogMessage'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
    27
	poolDictionaries:''
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
    28
	privateIn:SourceCodeManagerUtilities
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
    29
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
    30
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    33
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    34
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    35
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    36
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    37
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    38
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    39
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    40
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    41
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    42
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    43
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    44
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    45
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    46
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    47
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
documentation
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    utility code which is useful at more than one place
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    (extracted from the browser)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    [author:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
        Claus Gittinger (cg@exept)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    [see also:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    [instance variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    [class variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    64
!SourceCodeManagerUtilities class methodsFor:'Signal constants'!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    65
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    66
yesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    67
    YesToAllNotification isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    68
        YesToAllNotification := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    69
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    70
    ^ YesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    71
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    72
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    73
yesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    74
    YesToAllQuery isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    75
        YesToAllQuery := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    76
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    77
    ^ YesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    78
! !
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    79
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    80
!SourceCodeManagerUtilities class methodsFor:'accessing'!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    81
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    82
lastModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    83
    "return the value of the static variable 'LastModule' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    84
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    85
    ^ LastModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    86
!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    87
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    88
lastModule:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    89
    "set the value of the static variable 'LastModule' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    90
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    91
    LastModule := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    92
!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    93
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    94
lastPackage
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    95
    "return the value of the static variable 'LastPackage' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    96
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    97
    ^ LastPackage
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    98
!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    99
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   100
lastPackage:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   101
    "set the value of the static variable 'LastPackage' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   102
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   103
    LastPackage := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   104
! !
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   105
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
!SourceCodeManagerUtilities class methodsFor:'utilities'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   108
setPackageOfAllMethodsIn:aClass to:aPackage
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   109
    "make all methods belong to the classes project"
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   110
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   111
    |anyChange anyChangeHere|
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   112
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   113
    anyChange := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   114
    aClass withAllPrivateClassesDo:[:eachClass |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   115
        anyChangeHere := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   116
        eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   117
            mthd package ~= aPackage ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   118
                mthd setPackage:aPackage.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   119
                anyChangeHere := true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   120
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   121
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   122
        anyChangeHere ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   123
            eachClass changed:#projectOrganization
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   124
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   125
        anyChangeHere ifTrue:[anyChange := true].
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   126
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   127
    anyChange ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   128
       Smalltalk changed:#projectOrganization
1185
e86907810d1f handle abortAll in checkIn
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   129
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   130
    ^ anyChange
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   131
!
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   132
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   133
sourceCodeManagerFor:aClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   134
    |mgr|
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   135
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   136
    mgr := (aClass sourceCodeManager).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   137
    mgr isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   138
        SourceCodeManager isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   139
            (self warn:'SourceCodeManagement is disabled or not configured.\\Please setup in the Launcher.' withCRs) ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   140
                ^ nil
1012
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   141
            ].
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   142
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   143
        (self confirm:'Class does not seem to provide a valid sourceCodeManager.\\Assume CVS ?' withCRs) ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   144
            ^ nil
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   145
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   146
        mgr := CVSSourceCodeManager.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   147
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   148
    ^ mgr
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   149
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   150
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   151
sourceCodeOfClass:aClass
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   152
    |stream src|
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   153
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   154
    stream := '' writeStream.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   155
    Method flushSourceStreamCache.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   156
    aClass fileOutOn:stream withTimeStamp:false.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   157
    src := stream contents asString.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   158
    stream close.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   159
    ^ src
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   160
! !
1160
d56159f5a86f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   161
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   162
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs'!
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   163
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   164
checkForExistingModule:module package:package container:containerFileName using:mgr allowCreate:allowCreate
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   165
    |resources moduleName packageName containerName|
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   166
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   167
    resources := self classResources.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   168
    moduleName := module allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   169
    packageName := package allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   170
    containerName := containerFileName allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   171
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   172
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   173
    "/ check for the container
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   174
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   175
    (mgr checkForExistingContainerInModule:module package:package container:containerFileName) ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   176
        allowCreate ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   177
            self warn:(resources string:'A container for ''%1'' does not exist in ''%2:%3''' 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   178
                                   with:containerName with:moduleName with:packageName) withCRs.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   179
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   180
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   181
        (Dialog 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   182
            confirm:(resources string:'''%1'' is a new container (in ''%2:%3'').\\Create it ?' 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   183
                                 with:containerName with:moduleName with:packageName) withCRs
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   184
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   185
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   186
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   187
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   188
        (mgr createContainerForText:'' inModule:module package:package container:containerFileName) ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   189
            self warn:(resources string:'Cannot create new container: ''%1'' (in ''%2:%3'')' 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   190
                                 with:containerName with:moduleName with:packageName).
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   191
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   192
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   193
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   194
    ^ true.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   195
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   196
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   197
checkForExistingModule:module package:package using:mgr allowCreate:allowCreate
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   198
    |resources moduleName packageName|
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   199
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   200
    resources := self classResources.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   201
    moduleName := module allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   202
    packageName := package allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   203
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   204
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   205
    "/ check for the package
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   206
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   207
    (mgr checkForExistingModule:module package:package) ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   208
        allowCreate ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   209
            self warn:(resources string:'A package named ''%1'' does not exist in module ''%2''' 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   210
                                   with:packageName with:moduleName) withCRs.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   211
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   212
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   213
        (Dialog 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   214
            confirm:(resources string:'''%1'' is a new package in module ''%2''.\\create it ?' 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   215
                                 with:packageName with:moduleName) withCRs
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   216
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   217
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   218
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   219
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   220
        (mgr createModule:module package:package) ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   221
            self warn:(resources string:'Cannot create new package: ''%1'' in module ''%2''' 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   222
                                   with:packageName with:moduleName) withCRs.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   223
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   224
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   225
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   226
    ^ true.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   227
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   228
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   229
checkForExistingModule:module using:mgr allowCreate:allowCreate
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   230
    |resources moduleName|
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   231
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   232
    (mgr checkForExistingModule:module) ifFalse:[
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   233
        resources := self classResources.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   234
        moduleName := module allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   235
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   236
        allowCreate ifFalse:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   237
            self warn:(resources stringWithCRs:'A module named ''%1'' does not exist in the repository' 
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   238
                                  with:moduleName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   239
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   240
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   241
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   242
        (Dialog 
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   243
            confirm:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName) 
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   244
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   245
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   246
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   247
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   248
        (mgr createModule:module) ifFalse:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   249
            self warn:(resources stringWithCRs:'Cannot create new module: ''%1''' with:moduleName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   250
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   251
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   252
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   253
    ^ true.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   254
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   255
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   256
checkinClass:aClass
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   257
    "check a class into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   258
     Asks interactively for log-message."
882
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   259
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   260
    ^ self checkinClass:aClass withLog:nil
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   261
!
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   262
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   263
checkinClass:aClass withLog:aLogMessageOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   264
    "check a class into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   265
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   266
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   267
    ^ self checkinClass:aClass withLog:aLogMessageOrNil withCheck:true
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   268
!
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   269
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   270
checkinClass:aClass withLog:aLogMessageOrNil withCheck:doCheckClass
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   271
    "check a class into the source repository.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   272
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   273
     If doCheckClass is true, the class is checked for send of halts etc."
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   274
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   275
    |logMessage checkinInfo info mgr pri resources newSelectors initialLog|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   276
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   277
    aClass isLoaded ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   278
        self information:'cannot checkin unloaded classes (' , aClass name , ').'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   279
        ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   280
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   281
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   282
    mgr := self sourceCodeManagerFor:aClass.
954
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   283
    mgr isNil ifTrue:[
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   284
        ^ false
954
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   285
    ].
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   286
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   287
    aLogMessageOrNil isNil ifTrue:[
1078
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   288
        newSelectors := aClass selectors asSet.
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   289
        newSelectors addAll:(aClass class selectors).
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   290
        newSelectors size == 1 ifTrue:[
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   291
            initialLog := 'Added/changed #' , newSelectors first
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   292
"/        ] ifFalse:[
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   293
"/            newSelectors size > 1 ifTrue:[
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   294
"/                initialLog := 'Added/changed some methods'
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   295
"/            ]
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   296
        ].
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   297
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   298
        checkinInfo := self 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   299
                        getCheckinInfoFor:aClass name 
1078
bf7329c19ed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
   300
                        initialAnswer:initialLog.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   301
        checkinInfo isNil ifTrue:[^ false].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   302
        logMessage := checkinInfo logMessage.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   303
    ] ifFalse:[
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   304
        aLogMessageOrNil isString ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   305
            logMessage := aLogMessageOrNil
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   306
        ] ifFalse:[ 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   307
            checkinInfo := aLogMessageOrNil.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   308
            logMessage := checkinInfo logMessage.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   309
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   310
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   311
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   312
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   313
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   314
    info := mgr sourceInfoOfClass:aClass.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   315
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   316
    (info isNil 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   317
    or:[(info at:#fileName ifAbsent:nil) isNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   318
    or:[(info at:#module ifAbsent:nil) isNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   319
    or:[(info at:#directory ifAbsent:nil) isNil]]]) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   320
        (self createSourceContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   321
"/            self warn:'did not create a container for ''' , aClass name , ''''.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   322
            ^ false
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   323
        ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   324
        ^ true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   325
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   326
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   327
    self activityNotification:(resources string:'checking in %1' with:aClass name).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   328
    pri := Processor activePriority.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   329
    Processor activeProcess withPriority:pri-1 to:pri
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   330
    do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   331
        |revision aborted freshCreated|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   332
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   333
        freshCreated := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   334
        revision := aClass revision.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   335
        revision isNil ifTrue:[ 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   336
            "/ mhmh - check if it has a container.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   337
            (mgr checkForExistingContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   338
                (self createSourceContainerForClass:aClass) ifFalse:[
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   339
                    self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   340
                    ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   341
                ] ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   342
                    freshCreated := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   343
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   344
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   345
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   346
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
   347
        doCheckClass value ifTrue:[
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   348
            "/ check if the class contains halts, error-sends etc.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
   349
            (self checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:doCheckClass) ifFalse:[
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   350
                ^ false
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   351
            ].
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   352
        ].
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   353
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   354
        freshCreated ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   355
            aborted := false.
1113
30540d5fc3b7 class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
   356
            AbortOperationRequest handle:[:ex |
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   357
                aborted := true.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   358
                ex return.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   359
            ] do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   360
                (mgr checkinClass:aClass logMessage:logMessage) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   361
                    Transcript showCR:'checkin of ''' , aClass name , ''' failed'.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   362
                    self warn:'checkin of ''' , aClass name allBold , ''' failed'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   363
                    ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   364
                ].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   365
                (checkinInfo notNil and:[checkinInfo isStable]) ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   366
                    "set stable tag for class that has been checked in"
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   367
                    mgr setSymbolicName:#stable 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   368
                        revision:nil 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   369
                        overWrite:true 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   370
                        path:((mgr sourceInfoOfClass:aClass) at:#pathInRepository).
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   371
                ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   372
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   373
            aborted ifTrue:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   374
                Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   375
                AbortAllOperationRequest isHandled ifTrue:[
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   376
                    (Dialog 
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   377
                        confirm:(resources stringWithCRs:'Checkin of ''' , aClass name , ''' aborted.\\Cancel all ?')
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   378
                        default:false)
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   379
                    ifTrue:[
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   380
                        AbortAllOperationRequest raise.
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   381
                    ]
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   382
                ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   383
                ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   384
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   385
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   386
    ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   387
    ^ true
1113
30540d5fc3b7 class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
   388
30540d5fc3b7 class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
   389
    "Modified: / 16.11.2001 / 17:39:21 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   390
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   391
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   392
checkinClasses:aCollectionOfClass
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   393
    "check a collection of classes into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   394
     Asks interactively for log-message."
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   395
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   396
    ^ self checkinClasses:aCollectionOfClass withLog:nil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   397
!
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   398
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   399
checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   400
    "check a bunch of classes into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   401
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   402
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   403
    ^ self
1142
cba1ede48a4a allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   404
        checkinClasses:aCollectionOfClasses 
cba1ede48a4a allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   405
        withLog:aLogMessageOrNil 
cba1ede48a4a allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   406
        withCheck:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true)
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   407
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   408
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   409
checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil withCheck:doCheckClasses
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   410
    "check a bunch of classes into the source repository.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   411
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   412
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   413
    |classes checkinInfo resources yesOrNoToAll|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   414
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   415
    "/ ignore private classes
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   416
    classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   417
    classes isEmpty ifTrue:[
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   418
        self information:'Only private classes given - nothing checked in.'.
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   419
        ^ self
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   420
    ].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   421
    classes := classes select:[:aClass | aClass isLoaded].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   422
    classes isEmpty ifTrue:[
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   423
        self information:'Only unloaded classes given - nothing checked in.'.
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   424
        ^ self
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   425
    ].
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   426
    classes size == 1 ifTrue:[
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   427
        ^ self checkinClass:classes first withLog:aLogMessageOrNil withCheck:doCheckClasses.
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   428
    ].
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   429
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   430
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   431
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   432
    aLogMessageOrNil isNil ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   433
        checkinInfo := SourceCodeManagerUtilities 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   434
                        getCheckinInfoFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size)
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   435
                        initialAnswer:nil.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   436
        checkinInfo isNil ifTrue:[
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   437
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   438
        ].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   439
    ] ifFalse:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   440
        checkinInfo := aLogMessageOrNil.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   441
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   442
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   443
    AbortAllOperationRequest handle:[:ex |
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   444
        ex return
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   445
    ] do:[
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   446
        self yesToAllNotification handle:[:ex |
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   447
            yesOrNoToAll := ex parameter.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   448
            ex proceed
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   449
        ] do:[
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   450
            self yesToAllQuery handle:[:ex |
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   451
                ex proceedWith:yesOrNoToAll
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   452
            ] do:[
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   453
                classes do:[:aClass |
1137
239b07db4478 dont check twice for bad messages (halt etc.)
Claus Gittinger <cg@exept.de>
parents: 1131
diff changeset
   454
                    self activityNotification:(resources string:'checking in %1' with:aClass name).
239b07db4478 dont check twice for bad messages (halt etc.)
Claus Gittinger <cg@exept.de>
parents: 1131
diff changeset
   455
                    "/ ca does not want boxes to pop up all over ...
1245
1c6076979aa7 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 1210
diff changeset
   456
                    UserInformation handle:[:ex |
1424
2b531fae15e5 oops - must proceed after catching a UserNotification
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   457
                        Transcript showCR:ex description.
2b531fae15e5 oops - must proceed after catching a UserNotification
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   458
                        ex proceed.
1137
239b07db4478 dont check twice for bad messages (halt etc.)
Claus Gittinger <cg@exept.de>
parents: 1131
diff changeset
   459
                    ] do:[
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   460
                        AbortOperationRequest handle:[:ex |
1160
d56159f5a86f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   461
                        ] do:[
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   462
                            self checkinClass:aClass withLog:checkinInfo withCheck:doCheckClasses
1160
d56159f5a86f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   463
                        ]
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   464
                    ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   465
                ]
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   466
            ]
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   467
        ].
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   468
    ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   469
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   470
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   471
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withLog:aLogMessageOrNil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   472
    "checkin a projects extensions into the source repository.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   473
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   474
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   475
    |logMessage checkinInfo mgr pri resources module package i containerFileName s 
1015
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   476
     methodSource methodsSortedByName|
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   477
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   478
    resources := self classResources.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   479
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   480
    mgr := aCollectionOfMethods first mclass theNonMetaclass sourceCodeManager.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   481
    mgr isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   482
        self warn:'No sourceCode manager defined - cannot checkin.'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   483
"/        self error:'No sourceCode manager defined' mayProceed:true.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   484
        ^  false.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   485
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   486
    i := aPackageID indexOf:$:.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   487
    i == 0 ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   488
        self warn:'Cannot extract module/package from the packageID (invalid format)\\Please change the packageID to be of the form <module>:<subdirectory>,\and try again.\Or, alternatively, move the extensions to their classes project and checkIn the class(es).' withCRs.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   489
"/        self error:'cannot extract module/package from packageID' mayProceed:true.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   490
        ^  false.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   491
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   492
    module := aPackageID copyTo:i-1.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   493
    package := aPackageID copyFrom:i+1.
1120
f039453a5562 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   494
    (package startsWith:$:) ifTrue:[
f039453a5562 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   495
        package := package copyFrom:2.
f039453a5562 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   496
    ].
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   497
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   498
    containerFileName := 'extensions.st'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   499
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   500
    aLogMessageOrNil isNil ifTrue:[
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   501
        checkinInfo := SourceCodeManagerUtilities getCheckinInfoFor:containerFileName allBold initialAnswer:nil.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   502
        checkinInfo isNil ifTrue:[^ false].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   503
        logMessage := checkinInfo logMessage.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   504
    ] ifFalse:[
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   505
        aLogMessageOrNil isString ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   506
            logMessage := aLogMessageOrNil
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   507
        ] ifFalse:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   508
            checkinInfo := aLogMessageOrNil.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   509
            logMessage := checkinInfo logMessage.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   510
        ].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   511
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   512
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   513
    (self checkForExistingModule:module using:mgr allowCreate:true) ifFalse:[^ false].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   514
    LastModule := module.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   515
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   516
    (self checkForExistingModule:module package:package using:mgr allowCreate:true) ifFalse:[^ false].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   517
    LastPackage := package.
1015
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   518
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   519
    (self checkForExistingModule:module package:package container:containerFileName using:mgr allowCreate:true) ifFalse:[^ false].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   520
1120
f039453a5562 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   521
    self activityNotification:(resources string:'Checking in %1' with:containerFileName).
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   522
    pri := Processor activePriority.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   523
    Processor activeProcess withPriority:pri-1 to:pri
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   524
    do:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   525
        s := '' writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   526
        
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   527
        s nextPutAll:'"{ Package: '''.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   528
        s nextPutAll:aPackageID asString.
923
0a6c95fe85ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   529
        s nextPutAll:''' }"'; cr; nextPutChunkSeparator; cr; cr.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   530
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   531
"/        s nextPutAll:(Smalltalk timeStamp).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   532
"/        s nextPutChunkSeparator. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   533
"/        s cr; cr.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   534
1015
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   535
        "/ sort them by name (to avoid conflict due to CVS merge)
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   536
        methodsSortedByName := aCollectionOfMethods asOrderedCollection.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   537
        methodsSortedByName sort:[:a :b |
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   538
                                        |clsA clsB|
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   539
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   540
                                        clsA := a mclass name.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   541
                                        clsB := b mclass name.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   542
                                        clsA < clsB ifTrue:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   543
                                            true
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   544
                                        ] ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   545
                                            clsA > clsB ifTrue:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   546
                                                false
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   547
                                            ] ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   548
                                                a selector < b selector
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   549
                                            ]
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   550
                                        ]
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   551
                                  ].
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   552
        methodsSortedByName do:[:aMethod |
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   553
            aMethod mclass fileOutMethod:aMethod on:s.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   554
            s cr.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   555
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   556
        methodSource := s contents.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   557
1245
1c6076979aa7 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 1210
diff changeset
   558
        UserInformation handle:[:ex |
1323
18fefc941a32 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   559
            Transcript showCR:ex description.
18fefc941a32 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   560
            ex proceed.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   561
        ] do:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   562
            (mgr 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   563
                checkin:containerFileName
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   564
                text:methodSource
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   565
                directory:package 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   566
                module:module
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   567
                logMessage:logMessage
1090
8608e5b91fa7 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1084
diff changeset
   568
                force:false) 
8608e5b91fa7 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1084
diff changeset
   569
            ifFalse:[
1120
f039453a5562 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   570
                Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'.
f039453a5562 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   571
                self warn:'Checkin of ''' , containerFileName allBold , ''' failed'.
1090
8608e5b91fa7 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1084
diff changeset
   572
                ^ false.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   573
            ].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   574
            (checkinInfo notNil and:[checkinInfo isStable]) ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   575
                "set stable tag for class that has been checked in"
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   576
                mgr setSymbolicName:#stable 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   577
                    revision:nil 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   578
                    overWrite:true 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   579
                    path:(module, '/', package, '/', containerFileName).
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   580
            ].
1090
8608e5b91fa7 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1084
diff changeset
   581
            mgr postCheckInExtensionsForPackage:aPackageID    
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   582
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   583
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   584
    ^ true
1090
8608e5b91fa7 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1084
diff changeset
   585
8608e5b91fa7 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1084
diff changeset
   586
    "Modified: / 5.11.2001 / 17:06:00 / cg"
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   587
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   588
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   589
checkoutClass:aClass askForMerge:askForMerge
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   590
    "check-out a class from the source repository."
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   591
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   592
    self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   593
        checkoutClass:aClass 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   594
        askForRevision:true
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   595
        askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   596
!
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   597
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   598
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   599
    "check-out a class from the source repository.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   600
     If askForRevision is false, check-out the newest version."
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   601
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   602
    |mgr resources sourceInfo
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   603
     currentClass inChangeSet
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   604
     aStream sourceToLoad currentSource rev revString
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   605
     nm msg rev2 newestRev
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   606
     containerModule containerPackage containerFile rslt
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   607
     pkg listHere listRep diffSet 
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   608
     changed onlyHere onlyInRep answer labels values singleChangeSelector
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   609
     changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions|
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   610
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   611
    aClass isNil ifTrue:[self error:'nil class'].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   612
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   613
    resources := self classResources.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   614
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   615
    currentClass := aClass theNonMetaclass.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   616
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   617
    nm := currentClass name.
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   618
    mgr := self sourceCodeManagerFor:currentClass.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   619
    mgr isNil ifTrue:[
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   620
        ^ self
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   621
    ].
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   622
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   623
    sourceInfo := mgr sourceInfoOfClass:currentClass.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   624
    sourceInfo notNil ifTrue:[
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   625
        currentClass package ~= Project defaultProject package ifTrue:[
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   626
            containerPackage := mgr packageFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   627
            containerModule := mgr moduleFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   628
        ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   629
        containerFile := mgr containerFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   630
    ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   631
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   632
    currentClass isLoaded ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   633
        rev := currentClass binaryRevision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   634
        rev2 := currentClass revision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   635
        rev isNil ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   636
            rev := rev2
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   637
        ].
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   638
        rev isNil ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   639
            pkg := currentClass package.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   640
            (pkg notNil and:[pkg ~= Project defaultProject package]) ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   641
                containerModule := pkg upTo:$:.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   642
                containerPackage := pkg copyFrom:(containerModule size + 2).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   643
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   644
            containerModule size == 0 ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   645
                containerModule := (SourceCodeManagerUtilities lastModule ) ? Project current repositoryModule.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   646
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   647
            containerPackage size == 0 ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   648
                containerPackage := (SourceCodeManagerUtilities lastPackage ) ? Project current package.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   649
            ].
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   650
            answer := self confirmWithCancel:(resources 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   651
                                                string:'The class %3 seems to have no (valid) repository information.\\I assume you want to check it out from: %1/%2.' 
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   652
                                                with:containerModule allBold 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   653
                                                with:containerPackage allBold
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   654
                                                with:currentClass name allBold) withCRs.
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   655
            answer isNil ifTrue:[^ self "cancelled"].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   656
            answer ifFalse:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   657
                rslt := SourceCodeManagerUtilities
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   658
                    askForContainer:(resources string:'The class seems to have no repository information.\\Do you want to checkOut from an existing containers contents ?')
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   659
                    title:'Container to load from' note:nil 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   660
                    initialModule:containerModule 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   661
                    initialPackage:containerPackage 
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   662
                    initialFileName:(currentClass nameWithoutPrefix , '.st')
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   663
                    forNewContainer:false.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   664
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   665
                rslt isNil ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   666
                    "/ canel
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   667
                    ^ self
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   668
                ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   669
                containerModule := "lastModule :=" rslt at:#module.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   670
                containerPackage := "lastPackage :=" rslt at:#package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   671
                containerFile := rslt at:#fileName.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   672
            ].
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   673
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   674
"/            rslt := SourceCodeManagerUtilities
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   675
"/                askForContainer:(resources string:'The class seems to have no (valid) repository information.\\Do you want to check it out from an existing container ?')
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   676
"/                title:'Container to checkOut' note:nil 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   677
"/                initialModule:containerModule 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   678
"/                initialPackage:containerPackage
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   679
"/                initialFileName:(currentClass name , '.st').
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   680
"/                forNewContainer:false.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   681
"/            rslt isNil ifTrue:[^ self].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   682
            "/ self warn:(resources string:'Class %1 seems to be not yet in the repository' with:currentClass name allBold).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   683
            "/ ^ self
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   684
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   685
    ].
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   686
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   687
    "/
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   688
    "/ class in repository - ask for revision
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   689
    "/
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   690
"/    newestRev := mgr newestRevisionOf:currentClass.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   691
    newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   692
    askForRevision ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   693
        rev := newestRev ? ''
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   694
    ] ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   695
        msg := resources string:'CheckOut which revision of ''%1'': (empty for newest)' with:nm allBold.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   696
        rev notNil ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   697
            msg := msg , '\\' , (resources string:'Current ''%1'' is based upon rev %2.'
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   698
                                           with:nm allBold with:rev).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   699
            (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   700
                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   701
                                               with:rev2)
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   702
            ]
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   703
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   704
        newestRev notNil ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   705
            msg := msg , '\' , (resources string:'Newest in reporitory is %1.'
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   706
                                           with:newestRev)
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   707
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   708
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   709
        rev := SourceCodeManagerUtilities
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   710
                    askForExistingRevision:msg 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   711
                    title:'CheckOut from repository' 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   712
                    class:currentClass.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   713
        rev isNil ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   714
            ^ self   "/ canceled
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   715
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   716
    ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   717
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   718
    rev withoutSpaces isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   719
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   720
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   721
        aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   722
        revString := '(newest: ' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   723
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   724
        msg := 'extracting previous %1'.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   725
"/        aStream := mgr getSourceStreamFor:currentClass revision:rev.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   726
"/        revString := rev
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   727
        aStream := mgr  
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   728
            streamForClass:currentClass
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   729
            fileName:containerFile 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   730
            revision:rev 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   731
            directory:containerPackage 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   732
            module:containerModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   733
            cache:true.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   734
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   735
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   736
    aStream isNil ifTrue:[
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   737
        self warn:(resources string:'could not extract source of %1 from repository' with:aClass name allBold).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   738
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   739
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   740
    aStream class readErrorSignal handle:[:ex |
1245
1c6076979aa7 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 1210
diff changeset
   741
        self warn:('read error while reading extracted source\\' , ex description) withCRs.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   742
        aStream close.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   743
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   744
    ] do:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   745
        sourceToLoad := aStream contents asString.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   746
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   747
    aStream close.
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   748
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   749
    currentClass isLoaded ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   750
        rev = newestRev ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   751
            currentClass autoload.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   752
        ] ifFalse:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   753
            sourceToLoad readStream fileIn.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   754
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   755
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   756
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   757
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   758
    self activityNotification:'generating current source...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   759
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   760
    currentSource := self sourceCodeOfClass:currentClass.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   761
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   762
    self activityNotification:'comparing...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   763
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   764
    sourceToLoad = currentSource ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   765
        "/ make all methods belong to the classes project
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   766
        self setPackageOfAllMethodsIn:aClass to:aClass package.
1095
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   767
"/        (ChangeSet current includesChangeForClass:aClass) ifTrue:[
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   768
"/            (self confirm:(resources string:'Versions are identical: %1.\\Remove entries from changeSet ?' with:aClass name) withCRs)
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   769
"/            ifTrue:[
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   770
"/                self halt
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   771
"/            ]
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   772
"/        ] ifFalse:[
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   773
            self information:(resources string:'Versions are identical: %1' with:aClass name).
996e64e955aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1090
diff changeset
   774
"/        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   775
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   776
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   777
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   778
    self activityNotification:'generating diffSet...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   779
    listHere := ChangeSet fromStream:(currentSource readStream).
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   780
    listRep := ChangeSet fromStream:(sourceToLoad readStream).
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   781
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   782
    versionMethodsHere := listHere select:[:change | (change isMethodChange 
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   783
                                           and:[change selector == #version
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   784
                                           and:[change changeClass isMeta]])].
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   785
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   786
    versionMethodsRep := listRep select:[:change | (change isMethodChange 
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   787
                                           and:[change selector == #version
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   788
                                           and:[change changeClass isMeta]])].
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   789
1044
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   790
    "/ compare all but the version methods
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   791
    listHere := listHere select:[:change | (change isMethodChange 
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   792
                                           and:[change selector == #version
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   793
                                           and:[change changeClass isMeta]]) not].
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   794
    listRep := listRep select:[:change | (change isMethodChange 
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   795
                                           and:[change selector == #version
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   796
                                           and:[change changeClass isMeta]]) not].
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   797
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   798
    diffSet := listHere diffSetsAgainst:listRep.
1157
885130aeebd8 refactored
Claus Gittinger <cg@exept.de>
parents: 1142
diff changeset
   799
    changed := diffSet changed.
885130aeebd8 refactored
Claus Gittinger <cg@exept.de>
parents: 1142
diff changeset
   800
    onlyHere := diffSet onlyInReceiver.
885130aeebd8 refactored
Claus Gittinger <cg@exept.de>
parents: 1142
diff changeset
   801
    onlyInRep := diffSet onlyInArg.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   802
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   803
    changedClassDefinitions := changed select:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   804
    changed := changed reject:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   805
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   806
    labels := #('Cancel' 'Merge' 'Load'). 
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   807
    values := #(nil #merge #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   808
    default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   809
                    ifTrue:[3. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   810
                    ifFalse:[2. "i.e. merge"].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   811
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   812
    msg := 'About to load ''%4''.\\'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   813
    onlyInRep size > 0 ifTrue:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   814
        msg := msg , 'The repositories version contains %1 method(s) which are not in your current class.\'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   815
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   816
    onlyHere size > 0 ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   817
        onlyInRep size > 0 ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   818
            msg := msg , 'And there '.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   819
        ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   820
            msg := msg , 'There '.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   821
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   822
        msg := msg , 'are %2 methods in your current class, which are not in the repository.\'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   823
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   824
    changed size > 0 ifTrue:[
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   825
        changed size == 1 ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   826
            msg := msg , 'The ''%6''-method is different (present in both).\\'.
1291
60d89faa389f no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   827
            singleChangeSelector := changed first first selector allBold
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   828
        ] ifFalse:[
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   829
            msg := msg , '%3 methods are different (present in both).\\'.
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   830
        ]
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   831
    ].
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   832
    changedClassDefinitions size > 0 ifTrue:[
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   833
        changedClassDefinitions size == 1 ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   834
            msg := msg , 'The class definition is different.\\'.
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   835
        ] ifFalse:[
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   836
            msg := msg , '%5 class definitions are different.\\'.
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   837
        ]
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   838
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   839
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   840
    inChangeSet := ChangeSet current includesChangeForClass:aClass.
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   841
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   842
    onlyHere isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   843
        onlyInRep isEmpty ifTrue:[
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   844
            (changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   845
                "/ make all methods belong to the classes project
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   846
                versionMethodsRep size == 1 ifTrue:[
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   847
"/                    (self confirm:(resources string:'Versions are identical: %1\\Update the version-ID ?' with:aClass name) withCRs) ifTrue:[
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   848
                        versionMethodsRep first apply.
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   849
"/                    ]
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   850
                ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   851
                self setPackageOfAllMethodsIn:aClass to:aClass package.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   852
                ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   853
            ].
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   854
            inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   855
                msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made).'.
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   856
            ].
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   857
            labels := #('Cancel' 'Load'). 
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   858
            values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   859
            default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   860
                            ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   861
                            ifFalse:[1. "i.e. cancel"].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   862
        ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   863
            changed isEmpty ifTrue:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   864
                msg := msg , '\Attention:\Load will load methods which are not present in ''%4''.'.
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   865
                labels := #('Cancel' 'Load'). 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   866
                values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   867
                default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   868
                                ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   869
                                ifFalse:[1. "i.e. cancel"].
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   870
            ] ifFalse:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   871
                inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   872
                    msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   873
                ].
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   874
                msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   875
            ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   876
        ]
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   877
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   878
        onlyInRep isEmpty ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   879
            inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   880
                msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made),'.
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   881
                msg := msg , '\and remove added methods which are not present in the repository version.'.
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   882
            ].
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   883
            labels := #('Cancel' 'Load'). 
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   884
            values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   885
            default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   886
                            ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   887
                            ifFalse:[1. "i.e. cancel"].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   888
        ] ifFalse:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   889
            inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   890
                msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   891
                msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   892
            ]
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   893
        ]
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   894
    ].
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   895
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   896
    msg := msg bindWith:onlyInRep size printString 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   897
               with:onlyHere size printString 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   898
               with:changed size printString
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   899
               with:aClass name allBold
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   900
               with:changedClassDefinitions size printString
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   901
               with:singleChangeSelector.
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   902
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   903
    answer := (Dialog confirmWithCancel:msg withCRs
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   904
           labels:(resources array:labels)
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   905
           values:values 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   906
           default:default).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   907
    answer isNil ifTrue:[^ self].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   908
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   909
    self activityNotification:'updating...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   910
    changedClasses := IdentitySet new.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   911
1058
90807c795eb5 do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1057
diff changeset
   912
"/    Class withoutUpdatingChangesDo:[
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   913
        answer == #load ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   914
            changedClassDefinitions do:[:eachChangeArr | "apply this change (go to rep-version)"
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   915
                                         |cHere cRep| 
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   916
                                         cHere := eachChangeArr at:1.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   917
                                         cRep := eachChangeArr at:2.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   918
                                         cRep apply.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   919
                                         cRep isMethodChange ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   920
                                             cRep changeMethod setPackage:(cRep changeClass package).
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   921
                                             changedClasses add:cRep changeClass.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   922
                                         ]
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   923
                       ].
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   924
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   925
        onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   926
                                     eachChange apply.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   927
                                     eachChange isMethodChange ifTrue:[
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
   928
                                         eachChange changeMethod setPackage:(eachChange changeClass package).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   929
                                         changedClasses add:eachChange changeClass.   
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   930
                                     ]
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   931
                     ].
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   932
        answer == #load ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   933
            onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   934
                                         |cClass cSel|
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   935
                                         eachChange isMethodChange ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   936
                                             cClass := eachChange changeClass.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   937
                                             cSel := eachChange selector.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   938
                                             cClass removeSelector:cSel.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   939
                                         ]
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   940
                        ].
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   941
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   942
                                         |cHere cRep| 
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   943
                                         cHere := eachChangeArr at:1.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   944
                                         cRep := eachChangeArr at:2.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   945
                                         cRep apply.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   946
                                         cRep isMethodChange ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   947
                                             cRep changeMethod setPackage:(cRep changeClass package).
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   948
                                             changedClasses add:cRep changeClass.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   949
                                         ]
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   950
                       ].
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   951
            "/ make all methods belong to the classes project
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   952
            self setPackageOfAllMethodsIn:aClass to:aClass package.
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   953
            versionMethodsRep size == 1 ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   954
                versionMethodsRep first apply.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   955
                self setPackageOfAllMethodsIn:aClass to:aClass package.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   956
            ] ifFalse:[
1194
d60b2ed25f45 Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 1193
diff changeset
   957
                self error:'too many version methods'.
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
   958
            ].
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   959
        ].
1058
90807c795eb5 do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1057
diff changeset
   960
"/    ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   961
    changedClasses do:[:eachClass |
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   962
         eachClass changed:#projectOrganization.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   963
    ].
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
   964
    Smalltalk changed:#projectOrganization.
1044
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   965
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   966
    "Modified: / 7.2.2001 / 18:18:32 / ps"
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   967
!
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   968
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   969
compareClassWithRepository:aClass
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   970
    "open a diff-textView comparing the current (in-image) version
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   971
     against its orgiginal version found in the repository."
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   972
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   973
    self compareClassWithRepository:aClass askForRevision:true
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   974
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   975
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   976
      self compareClassWithRepository:Array
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   977
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   978
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   979
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   980
compareClassWithRepository:aClass askForRevision:askForRevision
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   981
    "open a diff-textView comparing the current (in-image) version
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   982
     against its orgiginal version found in the repository."
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   983
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   984
    |classToCompare resources brwsr
1194
d60b2ed25f45 Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 1193
diff changeset
   985
     aStream comparedSource currentSource rev revString thisRevString mgr
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   986
     nm msg rev2 newestRev versionsAreTheSame|
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   987
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   988
    resources := self classResources.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   989
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   990
    classToCompare := aClass theNonMetaclass.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   991
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   992
    nm := classToCompare name.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   993
    mgr := self sourceCodeManagerFor:classToCompare.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   994
    mgr isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   995
        ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   996
    ].
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   997
    rev := classToCompare binaryRevision.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   998
    rev2 := classToCompare revision.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   999
    rev isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1000
        rev := rev2
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1001
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1002
    rev isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1003
        self warn:'Class seems to be not yet in the repository'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1004
        ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1005
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1006
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1007
    "/
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1008
    "/ class in repository - ask for revision
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1009
    "/
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1010
    newestRev := mgr newestRevisionOf:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1011
    askForRevision ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1012
        msg := resources string:'compare to revision: (empty for newest)'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1013
        rev notNil ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1014
            msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1015
                                           with:nm allBold with:rev).
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1016
            (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1017
                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1018
                                               with:rev2)
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1019
            ]
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1020
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1021
        newestRev notNil ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1022
            msg := msg , '\' , (resources string:'Newest in reporitory is %1.'
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1023
                                           with:newestRev)
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1024
        ].
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1025
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1026
        rev := SourceCodeManagerUtilities
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1027
                    askForExistingRevision:msg 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1028
                    title:'Compare with repository' 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1029
                    class:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1030
    ] ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1031
        rev := newestRev.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1032
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1033
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1034
    rev notNil ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1035
        rev withoutSpaces isEmpty ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1036
            msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1037
            "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1038
            aStream := mgr getSourceStreamFor:classToCompare revision:newestRev.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1039
            revString := '(newest: ' , (newestRev ? '???') , ')'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1040
        ] ifFalse:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1041
            msg := 'extracting previous %1'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1042
            aStream := mgr getSourceStreamFor:classToCompare revision:rev.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1043
            revString := rev
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1044
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1045
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1046
        aStream isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1047
            self warn:'could not extract source from repository'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1048
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1049
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1050
        aStream class readErrorSignal handle:[:ex |
1245
1c6076979aa7 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 1210
diff changeset
  1051
            self warn:('read error while reading extracted source\\' , ex description) withCRs.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1052
            aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1053
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1054
        ] do:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1055
            comparedSource := aStream contents asString.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1056
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1057
        aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1058
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1059
        self activityNotification:'generating current source...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1060
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1061
        currentSource := self sourceCodeOfClass:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1062
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1063
        self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1064
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1065
        versionsAreTheSame := false.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1066
        comparedSource = currentSource ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1067
            versionsAreTheSame := true.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1068
        ] ifFalse:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1069
            thisRevString := rev2 ? 'no revision'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1070
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1071
            revString = '(newest)' ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1072
                (rev := mgr newestRevisionOf:classToCompare) notNil ifTrue:[
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1073
                    revString := '(newest is ' , rev , ')'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1074
                ]
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1075
            ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1076
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1077
            self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1078
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1079
            brwsr := (UserPreferences versionDiffViewerClass)
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1080
                  openOnClass:classToCompare
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1081
                  labelA:('repository: ' , revString)
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1082
                  sourceA:comparedSource
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1083
                  labelB:('current: (based on: ' , thisRevString , ')')
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1084
                  sourceB:currentSource
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1085
                  title:('comparing ' , classToCompare name)
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1086
                  ifSame:[versionsAreTheSame := true].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1087
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1088
            versionsAreTheSame ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1089
                brwsr classChangeSet 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1090
                    classBeingCompared:classToCompare;
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1091
                    versionA:rev;
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1092
                    versionB:rev , 'mod'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1093
            ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1094
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1095
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1096
        versionsAreTheSame ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1097
            (ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:classToCompare) ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1098
                (self confirm:(resources 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1099
                                stringWithCRs:'Versions of %1 are identical.\\Remove entries from changeSet ?'
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1100
                                with:classToCompare name)) ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1101
                    ChangeSet current condenseChangesForClass:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1102
                ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1103
            ] ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1104
                self information:'Versions are identical.'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1105
                ChangeSet current unrememberChangedClasses.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1106
            ]
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1107
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1108
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1109
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1110
    "
997
c55b39b6c7a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1111
      self compareClassWithRepository:Array
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1112
    "
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1113
!
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1114
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1115
createSourceContainerForClass:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1116
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1117
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1118
    |resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1119
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1120
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1121
    ^ self 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1122
        defineSourceContainerForClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1123
        title:(resources string:'Repository information for %1' with:aClass name)
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1124
        text:(resources string:'Create new repository container for ''%1''' with:aClass name allBold)
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1125
        createDirectories:true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1126
        createContainer:true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1127
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1128
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1129
defineSourceContainerForClass:aClass title:title text:boxText createDirectories:createDirs createContainer:createContainer
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1130
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1131
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1132
    | className
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1133
     oldModule oldPackage oldFileName
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1134
     module package fileName nameSpace nameSpacePrefix
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1135
     info project nm mgr creatingNew msg 
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1136
     answer doCheckinWithoutAsking forceCheckIn resources rslt note
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1137
     requiredPackage|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1138
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1139
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1140
    aClass isLoaded ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1141
        self warn:(resources string:'Please load the %1-class first' with:aClass name).
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1142
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1143
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1144
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1145
    className := aClass name.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1146
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1147
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1148
    "/ defaults, if nothing at all is known
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1149
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1150
    (module := LastModule) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1151
        module := (OperatingSystem getLoginName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1152
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1153
    (package := LastPackage) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1154
        package := 'private'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1155
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1156
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1157
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1158
    "/ try to extract some useful defaults from the current project
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1159
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1160
    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1161
        package isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1162
            (nm := project repositoryDirectory) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1163
                nm := project name
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1164
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1165
            package := nm.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1166
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1167
        module isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1168
            (nm := project repositoryModule) notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1169
                module := nm
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1170
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1171
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1172
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1173
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1174
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1175
    "/ ask the sourceCodeManager if it knows anything about that class
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1176
    "/ if so, take that as a default.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1177
    "/
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1178
    mgr := self sourceCodeManagerFor:aClass.
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1179
    mgr isNil ifTrue:[
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1180
        ^  false
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1181
    ].
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1182
1368
20cde03a3cd6 defineSource - fixed package & module extraction
martin
parents: 1347
diff changeset
  1183
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1184
    info := mgr sourceInfoOfClass:aClass.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1185
    info notNil ifTrue:[
1368
20cde03a3cd6 defineSource - fixed package & module extraction
martin
parents: 1347
diff changeset
  1186
        true "module ~= LastModule" ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1187
            (info includesKey:#module) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1188
                module := (info at:#module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1189
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1190
        ].
1401
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1191
"/        true "package ~= LastPackage" ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1192
"/            (info includesKey:#directory) ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1193
"/                package := (info at:#directory).
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1194
"/            ].
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1195
"/        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1196
        fileName := mgr containerFromSourceInfo:info.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1197
        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1198
            nameSpacePrefix := nameSpace name , '::'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1199
            (fileName startsWith:nameSpacePrefix) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1200
                fileName := fileName copyFrom:(nameSpacePrefix size + 1).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1201
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1202
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1203
"/        (info includesKey:#fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1204
"/            fileName := (info at:#fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1205
"/        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1206
"/            (info includesKey:#expectedFileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1207
"/                fileName := (info at:#expectedFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1208
"/            ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1209
"/                (info includesKey:#classFileNameBase) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1210
"/                    fileName := (info at:#classFileNameBase) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1211
"/                ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1212
"/            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1213
"/        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1214
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1215
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1216
    fileName isNil ifTrue:[
1338
bad5961fbff1 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 1323
diff changeset
  1217
        fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1218
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1219
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1220
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1221
        module replaceAll:$\ with:$/.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1222
        package replaceAll:$\ with:$/.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1223
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1224
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1225
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1226
    "/ check for conflicts (i.e. if such a container already exists) ...
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1227
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1228
    doCheckinWithoutAsking := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1229
    (mgr checkForExistingContainerInModule:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1230
                                   package:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1231
                                 container:fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1232
        answer := Dialog confirmWithCancel:(resources 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1233
                            string:'About to change the source container.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1234
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1235
Notice: there is a container for %1 in:
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1236
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1237
    %2 / %3 / %4
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1238
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1239
Do you want to change it or check right into that container ?'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1240
                            with:className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1241
                            with:module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1242
                            with:package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1243
                            with:fileName)
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1244
                labels:(resources array:#('Cancel' 'Check in' 'Change')).
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1245
        answer isNil ifTrue:[AbortSignal raise].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1246
        answer ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1247
            doCheckinWithoutAsking := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1248
            oldModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1249
            oldPackage := package.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1250
            oldFileName := fileName
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1251
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1252
            doCheckinWithoutAsking := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1253
            creatingNew := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1254
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1255
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1256
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1257
    doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1258
        "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1259
        "/ open a dialog for this
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1260
        "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1261
        (mgr checkForExistingContainerInModule:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1262
                                       package:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1263
                                     container:fileName) ifFalse:[
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1264
            note := 'Notice: class seems to have no container yet.'.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1265
            creatingNew := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1266
        ] ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1267
            creatingNew := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1268
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1269
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1270
        rslt := self 
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1271
                askForContainer:boxText title:title note:note
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1272
                initialModule:module initialPackage:package initialFileName:fileName
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1273
                forNewContainer:true.        
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1274
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1275
        rslt isNil ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1276
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1277
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1278
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1279
        module := rslt at:#module.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1280
        package := rslt at:#package.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1281
        fileName := rslt at:#fileName.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1282
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1283
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1284
    (fileName endsWith:',v') ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1285
        fileName := fileName copyWithoutLast:2
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1286
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1287
    (fileName endsWith:'.st') ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1288
        fileName := fileName , '.st'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1289
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1290
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1291
    "/ we require the packageID to be <module>:<container-dir>
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1292
    "/ check for this ...
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1293
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1294
    requiredPackage := ((module ? '') , ':' , (package ? '')) asSymbol.
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1295
    requiredPackage ~= aClass package ifTrue:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1296
"/        doCheckinWithoutAsking ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1297
"/            (self confirm:'Change the classes packageID to: ''', requiredPackage , ''' ?')
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1298
"/            ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1299
"/                ^ false
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1300
"/            ]
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1301
"/        ].
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  1302
        aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage].
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1303
        aClass package:requiredPackage.
981
91e69bd0352a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
  1304
        aClass changed:#projectOrganization.
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1305
        Smalltalk changed:#projectOrganization with:(Array with:aClass).
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1306
    ].
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1307
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1308
    info := aClass revisionInfo.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1309
    info notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1310
        (info includesKey:#repositoryPathName) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1311
            info := nil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1312
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1313
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1314
    info isNil ifTrue:[
1004
1bd564960810 dont ask if a version method should be created - just do it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
  1315
        true "doCheckinWithoutAsking" ifFalse:[
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1316
            answer := Dialog 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1317
                 confirmWithCancel:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1318
                 labels:(resources array:#( 'Cancel' 'No' 'Yes')).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1319
            answer isNil ifTrue:[^ false].
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1320
        ] ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1321
            answer := true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1322
        ].
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1323
        answer ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1324
            aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1325
                                               inModule:module 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1326
                                               package:package 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1327
                                               container:fileName).
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1328
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1329
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1330
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1331
    (self checkForExistingModule:module using:mgr allowCreate:(createDirs or:[creatingNew]))
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1332
    ifFalse:[^ false].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1333
    LastModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1334
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1335
    (self checkForExistingModule:module package:package using:mgr allowCreate:(createDirs or:[creatingNew]))
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1336
    ifFalse:[^ false].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1337
    LastPackage := package.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1338
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1339
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1340
    "/ check for the container itself
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1341
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1342
    (mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1343
        creatingNew ifTrue:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1344
            self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1345
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1346
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1347
"/            (oldModule notNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1348
"/            and:[(oldModule ~= module)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1349
"/                 or:[oldPackage ~= package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1350
"/                 or:[oldFileName ~= fileName]]])
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1351
"/            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1352
"/                self warn:(resources string:'no change').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1353
"/                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1354
"/            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1355
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1356
        doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1357
            (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1358
                confirm:(resources string:'check %1 into the existing container
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1359
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1360
    %2 / %3 / %4  ?'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1361
                                with:className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1362
                                with:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1363
                                with:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1364
                                with:fileName) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1365
                noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1366
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1367
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1368
            ].  
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1369
        ].  
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1370
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1371
        aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1372
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1373
        oldFileName notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1374
            msg := ('forced checkin / source container change from ' , oldFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1375
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1376
            msg := 'defined source container'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1377
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1378
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1379
        (forceCheckIn := doCheckinWithoutAsking) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1380
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1381
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1382
                fileName:fileName 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1383
                directory:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1384
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1385
                logMessage:msg)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1386
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1387
                doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1388
                    (Dialog 
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1389
                        confirm:'No easy merge seems possible; force checkin (no merge) ?'
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1390
                        noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1391
                    ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1392
                        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1393
                    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1394
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1395
                forceCheckIn := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1396
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1397
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1398
        forceCheckIn ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1399
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1400
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1401
                fileName:fileName 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1402
                directory:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1403
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1404
                logMessage:msg
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1405
                force:true)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1406
            ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1407
                self warn:(resources string:'Failed to check into existing container.').
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1408
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1409
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1410
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1411
        ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1412
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1413
        (createContainer or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1414
            (Dialog
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1415
                 confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1416
                                      with:fileName with:module with:package) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1417
                 noLabel:'Cancel') ifFalse:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1418
                ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1419
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1420
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1421
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1422
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1423
    (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1424
            createContainerFor:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1425
            inModule:module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1426
            package:package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1427
            container:fileName) ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1428
        self warn:(resources string:'Failed to create container.').
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1429
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1430
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1431
    ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1432
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1433
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1434
removeSourceContainerForClass:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1435
    "show container & let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1436
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1437
    ^ self removeSourceContainerForClass:aClass confirm:true warn:true
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1438
!
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1439
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1440
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1441
    "show container & optionally let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1442
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1443
    |module package fileName info mgr resources|
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1444
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1445
    resources := self classResources.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1446
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1447
    aClass isLoaded ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1448
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1449
            self warn:(resources string:'Please load the class first.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1450
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1451
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1452
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1453
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1454
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1455
    "/ ask the sourceCodeManager if it knows anything about that class
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1456
    "/ if so, take that as a default.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1457
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1458
    mgr := aClass sourceCodeManager.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1459
    mgr isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1460
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1461
            self warn:(resources string:'No sourceCodeManagement.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1462
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1463
        ^ false
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1464
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1465
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1466
    info := mgr sourceInfoOfClass:aClass.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1467
    info notNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1468
        (info includesKey:#module) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1469
            module := (info at:#module).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1470
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1471
        (info includesKey:#directory) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1472
            package := (info at:#directory).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1473
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1474
        fileName := mgr containerFromSourceInfo:info.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1475
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1476
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1477
    module isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1478
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1479
            self warn:(resources stringWithCRs:'classes module is unknown.\\It seems to not have a container.') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1480
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1481
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1482
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1483
    package isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1484
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1485
            self warn:(resources stringWithCRs:'classes package is unknown.\\It seems to not have a container.') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1486
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1487
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1488
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1489
    fileName isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1490
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1491
            self warn:(resources stringWithCRs:'classes container fileName is unknown.\\It seems to not have a container.') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1492
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1493
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1494
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1495
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1496
    OperatingSystem isMSDOSlike ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1497
        module replaceAll:$\ with:$/.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1498
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1499
    OperatingSystem isMSDOSlike ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1500
        package replaceAll:$\ with:$/.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1501
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1502
    (mgr checkForExistingContainerInModule:module 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1503
                                   package:package 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1504
                                 container:fileName) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1505
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1506
            self warn:(resources stringWithCRs:'Class has no source container.') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1507
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1508
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1509
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1510
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1511
    doConfirm ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1512
        (Dialog
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1513
            choose:(resources 
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1514
                        stringWithCRs:'Please confirm removal of the container for %1:
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1515
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1516
container:    %2 / %3 / %4
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1517
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1518
Really remove ?' 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1519
                        with:aClass name 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1520
                        with:module 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1521
                        with:package 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1522
                        with:fileName) 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1523
            labels:(Array 
1129
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1524
                        with:(resources string:'No') 
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1525
                        with:(resources string:'Remove'))
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1526
            values:#(false true)
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1527
            default:false) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1528
            ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1529
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1530
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1531
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1532
    (mgr removeContainerFor:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1533
                   inModule:module
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1534
                    package:package
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1535
                  container:fileName) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1536
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1537
            self warn:(resources string:'failed to remove container.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1538
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1539
        ^ true.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1540
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1541
    ^ false
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1542
!
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1543
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1544
repositoryLogOf:aClass onto:aStream
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1545
    |info rv mgr info2 module fn msg s|
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1546
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1547
    info := aClass revisionInfo.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1548
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1549
    rv := aClass binaryRevision.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1550
    rv notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1551
        aStream nextPutLine:'**** Loaded classes binary information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1552
        aStream nextPutLine:'  Binary based upon : ' , rv.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1553
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1554
    ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1555
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1556
    info notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1557
        mgr := aClass sourceCodeManager.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1558
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1559
        (info includesKey:#revision) ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1560
            aStream nextPutLine:'WARNING:'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1561
            aStream nextPutLine:'  The class seems not to be loaded from the repository.'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1562
            aStream nextPutLine:'  Check carefully before checking anything in.'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1563
            aStream nextPutLine:'  (i.e. compare with repository for renamed class(es), same-name but unrelated etc.)'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1564
            aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1565
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1566
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1567
        aStream nextPutLine:'**** Classes source information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1568
        s := info at:#repositoryPath ifAbsent:nil.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1569
        s notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1570
            aStream nextPutLine:'  Source repository : ' , s
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1571
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1572
        aStream nextPutLine:'  Filename ........ : ' , (info at:#fileName ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1573
        aStream nextPutLine:'  Revision ........ : ' , (info at:#revision ifAbsent:'?').
1462
2b2c6acdb53f Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents: 1460
diff changeset
  1574
        aStream nextPutLine:'  Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , 
2b2c6acdb53f Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents: 1460
diff changeset
  1575
                                                       (info at:#time ifAbsent:'?'), ' ', 
2b2c6acdb53f Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents: 1460
diff changeset
  1576
                                                       (info at:#timezone ifAbsent:'').
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1577
        aStream nextPutLine:'  Checkin user .... : ' , (info at:#user ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1578
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1579
        (info2 := aClass packageSourceCodeInfo) notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1580
            aStream nextPutLine:'  Repository: ..... : ' , (info2 at:#module ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1581
            aStream nextPutLine:'  Directory: ...... : ' , (info2 at:#directory ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1582
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1583
        aStream nextPutLine:'  Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1584
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1585
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1586
        mgr notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1587
            aStream nextPutLine:'**** Repository information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1588
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1589
            module := info2 at:#module ifAbsent:nil.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1590
            module notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1591
                aStream nextPutLine:('  CVS Root ......: ' , 
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1592
                                    ((mgr repositoryNameForModule:module) ifNil:[mgr repositoryName , ' (default)'])).
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1593
            ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1594
            mgr writeRevisionLogOf:aClass to:aStream.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1595
        ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1596
    ] ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1597
        aStream nextPutLine:'No revision info found'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1598
        aClass isLoaded ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1599
            aStream cr; nextPutAll:'This is an autoloaded class - you may see more after its loaded.'
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1600
        ] ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1601
            fn := aClass classFilename.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1602
            aClass wasAutoloaded ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1603
                msg := 'This class was autoloaded.'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1604
                fn notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1605
                    msg := msg , ' (from ''' , fn , ''')'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1606
                ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1607
            ] ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1608
                fn notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1609
                    msg := 'This class was loaded from ''' , fn , '''.'
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1610
                ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1611
            ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1612
            msg notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1613
                aStream cr; nextPutAll:msg.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1614
            ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1615
        ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1616
    ]
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1617
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1618
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1619
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-helpers'!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1620
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1621
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1622
    "check-out all previous versions of aClass and retrieve the history of selector.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1623
     Return a dictionary associating revision with a changeList entries for that method.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1624
     Unfinished - need a GUI for that."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1625
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1626
    |mgr theClass revisionLog revisions items s entriesPerRevision previousVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1627
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1628
    theClass := aClass theNonMetaclass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1629
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1630
    mgr := self sourceCodeManagerFor:theClass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1631
    mgr isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1632
        self error:'no sourceCodeManager'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1633
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1634
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1635
    revisionLog := mgr
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1636
                        revisionLogOf:theClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1637
                        numberOfRevisions:numberOfRevisionsOrNil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1638
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1639
    revisions := revisionLog at:#revisions.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1640
    items := revisions collect:[:each | |rev date who|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1641
                                    rev := each at:#revision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1642
                                    date := each at:#date.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1643
                                    who := each at:#author.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1644
                                    rev allBold , ' [' , date , ' by ' , who , ']'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1645
                               ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1646
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1647
    revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1648
    revisions addFirst:#current.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1649
    entriesPerRevision := Dictionary new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1650
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1651
    previousVersion := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1652
    revisions reverseDo:[:eachRevision |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1653
        |srcStream entries thisVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1654
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1655
        eachRevision == #current ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1656
            s := '' writeStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1657
            theClass fileOutOn:s withTimeStamp:false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1658
            srcStream := s contents readStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1659
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1660
            self activityNotification:('checking out revision ' , eachRevision , '...').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1661
            srcStream := mgr getSourceStreamFor:theClass revision:eachRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1662
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1663
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1664
        entries := ChangeSet fromStream:srcStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1665
        srcStream close.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1666
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1667
        "/ remove all definitions       
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1668
        entries := entries select:[:each | each isMethodChange].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1669
        "/ remove all methods which are for other selectors      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1670
        entries := entries select:[:each | each selector == selector].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1671
        "/ remove all methods which are for private subclasses      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1672
        entries := entries select:[:each | each className = aClass name].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1673
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1674
        entries size == 1 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1675
            "/ the method is there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1676
            thisVersion := entries first.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1677
            (previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1678
                "/ no change
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1679
            ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1680
                entriesPerRevision at:eachRevision put:thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1681
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1682
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1683
            "/ the method is not there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1684
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1685
        previousVersion := thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1686
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1687
    self error:'unfinished code'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1688
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1689
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1690
     self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1691
     self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1692
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1693
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1694
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1695
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-user interaction'!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1696
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1697
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1698
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1699
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1700
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1701
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1702
    ^ self
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1703
        askForContainer:boxText title:title note:notice 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1704
        initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1705
        forNewContainer:true
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1706
!
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1707
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1708
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1709
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1710
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1711
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1712
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1713
    |box y component resources answer
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1714
     moduleHolder packageHolder fileNameHolder
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1715
     module package fileName 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1716
     knownContainers knownPackages packageUpdater
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1717
     packageBoxComponent fileNameBoxComponent fileNameUpdater|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1718
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1719
    knownContainers := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1720
    Smalltalk allClassesDo:[:cls | |pckg|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1721
        pckg := cls package.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1722
        pckg size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1723
            knownContainers add:(pckg upTo:$:)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1724
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1725
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1726
    knownContainers := knownContainers asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1727
    knownContainers := knownContainers select:[:module | module isBlank not].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1728
    knownContainers sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1729
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1730
    packageUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1731
        |theModulePrefix|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1732
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1733
        theModulePrefix := moduleHolder value , ':'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1734
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1735
        Cursor wait showWhile:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1736
            knownPackages := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1737
            Smalltalk allClassesDo:[:cls | |pckg idx|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1738
                pckg := cls package.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1739
                pckg size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1740
                    (pckg startsWith:theModulePrefix) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1741
                        idx := pckg indexOf:$:.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1742
                        knownPackages add:(pckg copyFrom:idx + 1)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1743
                    ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1744
                ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1745
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1746
            knownPackages := knownPackages asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1747
            knownPackages := knownPackages select:[:package | package isBlank not].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1748
            knownPackages sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1749
            packageBoxComponent list:knownPackages.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1750
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1751
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1752
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1753
    fileNameUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1754
        |module package files|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1755
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1756
        Cursor read showWhile:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1757
            module := moduleHolder value ? '__NoProject__'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1758
            package := packageHolder value ? '__NoProject__'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1759
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1760
            files := SourceCodeManager getExistingContainersInModule:module package:package.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1761
            files := files asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1762
            files := files select:[:eachFile | eachFile asFilename hasSuffix:'st'].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1763
            files sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1764
            fileNameBoxComponent list:files.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1765
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1766
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1767
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1768
    moduleHolder := initialModule asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1769
    packageHolder := initialPackage asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1770
    fileNameHolder := initialFileName asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1771
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1772
    resources := self classResources.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1773
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1774
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1775
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1776
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1777
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1778
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1779
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1780
    component := box addTextLabel:boxText withCRs.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1781
    component adjust:#left; borderWidth:0.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1782
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1783
    box addVerticalSpace.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1784
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1785
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1786
    component := box addTextLabel:(resources string:'Module:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1787
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1788
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1789
    component := box addComboBoxOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1790
    component list:knownContainers.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1791
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1792
"/    component := box addInputFieldOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1793
    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1794
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1795
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1796
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1797
    component := box addTextLabel:(resources string:'Package:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1798
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1799
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1800
    packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1801
"/    component := box addInputFieldOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1802
    component width:0.6; left:0.4; "immediateAccept:true; "acceptOnLeave:true; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1803
    packageUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1804
    moduleHolder onChangeEvaluate:packageUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1805
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1806
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1807
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1808
    component := box addTextLabel:(resources string:'Filename:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1809
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1810
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1811
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1812
    forNewContainer ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1813
        component := box addInputFieldOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1814
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1815
    ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1816
        fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1817
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1818
        fileNameUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1819
        packageHolder onChangeEvaluate:fileNameUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1820
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1821
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1822
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1823
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1824
    notice notNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1825
        component := box addTextLabel:notice.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1826
        component adjust:#left; borderWidth:0.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1827
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1828
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1829
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1830
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1831
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1832
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1833
        component := Button label:'Yes to all'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1834
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1835
                            YesToAllNotification queryWith:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1836
                            box doAccept.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1837
                         ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1838
        (DialogBox defaultOKButtonAtLeft) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1839
            box addButton:component after:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1840
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1841
            box addButton:component before:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1842
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1843
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1844
    (AbortAllSignal isHandled) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1845
        component := Button label:'Cancel all'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1846
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1847
                            box hide.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1848
                            AbortAllSignal raiseSignal.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1849
                         ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1850
        (DialogBox defaultOKButtonAtLeft) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1851
            box addButton:component before:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1852
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1853
            box addButton:component after:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1854
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1855
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1856
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1857
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1858
        answer := YesToAllQuery query.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1859
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1860
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1861
    answer isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1862
        box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1863
        answer := box accepted
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1864
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1865
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1866
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1867
    answer ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1868
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1869
    ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1870
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1871
    module := moduleHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1872
    package := packageHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1873
    fileName := fileNameHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1874
    ^ Dictionary new
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1875
        at:#module put:module;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1876
        at:#package put:package;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1877
        at:#fileName put:fileName;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1878
        yourself
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1879
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1880
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1881
     self 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1882
        askForContainer:'enter container' title:'container' note:'some note'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1883
        initialModule:'foo' initialPackage:'bar' initialFileName:'baz'        
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1884
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1885
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1886
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1887
askForExistingRevision:boxText title:title class:aClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1888
    "open a dialog asking for a containers revision;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1889
     return a revision number, or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1890
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1891
    |mgr sourceInfo module package fileName|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1892
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1893
    mgr := aClass sourceCodeManager.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1894
    sourceInfo := mgr sourceInfoOfClass:aClass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1895
    sourceInfo isNil ifTrue:[^ nil].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1896
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1897
    package := mgr packageFromSourceInfo:sourceInfo.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1898
    module := mgr moduleFromSourceInfo:sourceInfo.  
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1899
    fileName := mgr containerFromSourceInfo:sourceInfo.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1900
    ^ self
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1901
        askForExistingRevision:boxText 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1902
        title:title 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1903
        class:aClass 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1904
        manager:mgr 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1905
        module:module package:package fileName:fileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1906
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1907
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1908
     SourceCodeManagerUtilities
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1909
        askForRevisionToCompare:'enter revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1910
        title:'revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1911
        class:Array
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1912
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1913
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1914
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1915
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:package fileName:fileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1916
    "open a dialog asking for a containers revision;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1917
     return a revision number, or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1918
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1919
    |partialLog revisions items newestRev
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1920
     box y component resources 
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1921
     revisionHolder symbolicNames stableRevision releasedRevision|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1922
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1923
    partialLog := aSourceCodeManager
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1924
        revisionLogOf:clsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1925
        numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1926
        fileName:fileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1927
        directory:package 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1928
        module:module.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1929
    partialLog notNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1930
        newestRev := partialLog at:#newestRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1931
        revisions := partialLog at:#revisions.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1932
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1933
        symbolicNames notNil ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1934
            stableRevision := symbolicNames at:'stable' ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1935
            releasedRevision := symbolicNames at:'released' ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1936
        ].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1937
            
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1938
        items := revisions collect:[:each | |rev date who flag|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1939
                                        rev := each at:#revision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1940
                                        date := each at:#date.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1941
                                        who := each at:#author.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1942
                                        rev = stableRevision ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1943
                                            flag := ' Stable' allBold.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1944
                                        ] ifFalse:[rev = releasedRevision ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1945
                                            flag := ' Released' allBold.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1946
                                        ] ifFalse:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1947
                                            flag := ' '
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1948
                                        ]].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  1949
                                        rev allBold , flag, ' [' , date , ' by ' , who , ']'
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1950
                                   ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1951
        revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1952
    ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1953
        newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:package module:module.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1954
        revisions := items := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1955
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1956
        newestRev isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1957
            (aSourceCodeManager checkForExistingContainerInModule:module package:package container:fileName)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1958
            ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1959
                self warn:'Could not find/access the container for ',fileName,' in the repository.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1960
This could be due to:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1961
    - invalid/wrong CVS-Root setting
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1962
    - missing CVS access rights
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1963
        (no access / not logged in)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1964
    - changed CVSRoot after compilation
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1965
        (i.e. wrong CVS-path in classes version method)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1966
'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1967
                ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1968
            ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1969
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1970
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1971
    revisionHolder  := newestRev asValue.
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1972
    resources := self classResources.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1973
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1974
    revisionHolder onChangeEvaluate:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1975
        "/ cut off everything after revision
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1976
        |s first words|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1977
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1978
        s := revisionHolder value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1979
        words := s asCollectionOfWords.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1980
        words size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1981
            first := words first string.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1982
            first ~= s ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1983
                revisionHolder value:first
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1984
            ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1985
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1986
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1987
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1988
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1989
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1990
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1991
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1992
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1993
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1994
    component := box addTextLabel:boxText withCRs.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1995
    component adjust:#left; borderWidth:0.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1996
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1997
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1998
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1999
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2000
    component := box addTextLabel:(resources string:'Revision:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2001
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2002
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2003
    component := box addComboBoxOn:revisionHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2004
    component list:items.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2005
    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2006
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2007
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2008
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2009
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2010
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2011
    Object abortAllSignal isHandled ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2012
        (box addAbortButtonLabelled:'Cancel all') action:[AbortAllSignal raise].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2013
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2014
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2015
    box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2016
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2017
    box accepted ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2018
        box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2019
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2020
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2021
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2022
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2023
    ^ revisionHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2024
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2025
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2026
     SourceCodeManagerUtilities
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2027
        askForRevisionToCompare:'enter revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2028
        title:'revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2029
        class:nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2030
        manager:SourceCodeManager 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2031
        module:'stx'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2032
        package:'libbasic'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2033
        fileName:'Array.st'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2034
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2035
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2036
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2037
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2038
    "check if a class contains message-sends to:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2039
        #halt
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2040
        #halt:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2041
        #error
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2042
        (and maybe more in the future)"
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2043
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2044
    |badStuff whatIsBad msg answer labels values defaultAnswer dontShowAgain|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2045
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2046
    badStuff := #(
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2047
        ( halt         'sent of #halt (use for debugging only) - better use #error:''some message''' )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2048
        ( halt:        'sent of #halt: (use for debugging only) - better use #error:' )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2049
        ( error        'sent of #error without descriptive message - better use #error:''some message''' )
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2050
    ).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2051
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2052
    whatIsBad := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2053
    aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2054
        |setOfLiterals setOfSentMessages|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2055
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2056
        setOfLiterals := mthd literals.  "/ try without parsing first.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2057
        (badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2058
            setOfSentMessages := mthd messagesSent.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2059
            badStuff do:[:eachEntry |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2060
                (setOfSentMessages includes:eachEntry first) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2061
                    whatIsBad add:eachEntry second
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2062
                ]
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2063
            ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2064
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2065
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2066
    whatIsBad notEmpty ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2067
        (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2068
            answer := YesToAllQuery query.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2069
            answer notNil ifTrue:[ ^ answer ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2070
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2071
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2072
        msg := '%1 contains the following  (considered bad style) message sends:\\'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2073
        whatIsBad do:[:each |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2074
            msg := msg , '   ' , each , '\'
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2075
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2076
        msg := msg , '\\' , 'Do you really want to checkIn the %1 class ?'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2077
        msg := msg bindWith:aClass name.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2078
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2079
        (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2080
            labels := #('Cancel All' 'Cancel' 'No to All' 'No' 'Yes to All' 'Yes') "#('Yes' 'Yes to All' 'No' 'No to All' 'Cancel')".
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2081
            values := #(#cancelAll nil #noToAll false #yesToAll true) "#(true #yesToAll false #noToAll nil)".
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2082
            defaultAnswer := #yesToAll.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2083
        ] ifFalse:[
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2084
            labels := #('No' 'Yes').
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2085
            values := #(false true).
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2086
            defaultAnswer := true.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2087
        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2088
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2089
"/        AbortAllOperationRequest isHandled ifTrue:[
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2090
"/            labels := #('Cancel All') , labels.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2091
"/            values := #(#cancelAll) , values.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2092
"/        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2093
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2094
        DialogBox aboutToOpenBoxNotificationSignal handle:[:ex |
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2095
            |box|
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2096
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2097
            checkAgainHolder isValueModel ifTrue:[
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2098
                dontShowAgain := checkAgainHolder value not asValue.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2099
                box := ex parameter.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2100
                box verticalPanel 
1429
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
  2101
                    add:(CheckBox label:'Do not show this Dialog again.'
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2102
                                  model:dontShowAgain).
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2103
            ].
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2104
            ex proceed.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2105
        ] do:[
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2106
            answer := OptionBox 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2107
                          request:msg withCRs
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2108
                          label:'Really checkIn ?'
1391
68432469745f dont send obsolete message (OptionBox request:..form:..)
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
  2109
                          image:(InfoBox iconBitmap)
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2110
                          buttonLabels:labels
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2111
                          values:values
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2112
                          default:defaultAnswer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2113
                          onCancel:nil.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2114
        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2115
        answer isNil ifTrue:[
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2116
            AbortSignal raise.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2117
        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2118
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2119
        dontShowAgain notNil ifTrue:[
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2120
            checkAgainHolder value:dontShowAgain value not 
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2121
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2122
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2123
        answer == #cancelAll ifTrue:[
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2124
            AbortAllSignal raise.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2125
        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2126
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2127
        answer == #yesToAll ifTrue:[
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2128
            YesToAllNotification queryWith:true.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2129
            ^ true
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2130
        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2131
        answer == #noToAll ifTrue:[
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2132
            YesToAllNotification queryWith:false.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2133
            ^ false
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2134
        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2135
        ^ answer
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2136
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2137
    ^ true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2138
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2139
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2140
     self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities)  
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2141
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2142
!
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2143
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2144
getCheckinInfoFor:aString initialAnswer:initialAnswerOrNil
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2145
    "get a log message for checking in a class.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2146
     Return the message or nil if aborted."
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2147
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2148
    |logMsg info initialAnswer|
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2149
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2150
    initialAnswerOrNil isNil ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2151
        initialAnswer := LastSourceLogMessage.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2152
    ] ifFalse:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2153
        initialAnswer := initialAnswerOrNil.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2154
    ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2155
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2156
    info := CheckinInfoDialog getCheckinInfoFor:aString initialAnswer:initialAnswer.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2157
    info notNil ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2158
        logMsg := info logMessage.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2159
        logMsg notNil ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2160
            LastSourceLogMessage := logMsg
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2161
        ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2162
    ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2163
    ^ info
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2164
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2165
    "
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2166
     SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla'
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2167
    "
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2168
!
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2169
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2170
getLogMessageFor:aString
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2171
    "get a log message for checking in a class.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2172
     Return the message or nil if aborted."
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2173
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2174
    ^ self getLogMessageFor:aString initialAnswer:LastSourceLogMessage
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2175
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2176
    "
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2177
     SourceCodeManagerUtilities getLogMessageFor:'hello'
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2178
    "
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2179
!
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2180
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2181
getLogMessageFor:aString initialAnswer:initialAnswer
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2182
    "get a log message for checking in a class.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2183
     Return the message or nil if aborted."
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2184
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2185
    |logMsg info|
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2186
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2187
    info := self getCheckinInfoFor:aString initialAnswer:initialAnswer.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2188
    info notNil ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2189
        logMsg := info logMessage.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2190
    ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2191
    ^ logMsg
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2192
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2193
    "
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2194
     SourceCodeManagerUtilities getLogMessageFor:'hello'
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2195
    "
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2196
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2197
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2198
!SourceCodeManagerUtilities class methodsFor:'utilities-encoding'!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2199
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2200
guessEncodingOfBuffer:buffer
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2201
    "look for a string of the form
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2202
            encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2203
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2204
            encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2205
     within the given buffer 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2206
     (which is usually the first few bytes of a textFile)."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2207
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  2208
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  2209
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  2210
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  2211
    ^ CharacterEncoder guessEncodingOfBuffer:buffer
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  2212
!
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  2213
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2214
guessEncodingOfFile:aFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2215
    "look for a string
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2216
        encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2217
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2218
        encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2219
     within the given buffer 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2220
     (which is usually the first few bytes of a textFile).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2221
     If thats not found, use heuristics (in CharacterArray) to guess."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2222
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  2223
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  2224
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  2225
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  2226
    ^ CharacterEncoder guessEncodingOfFile:aFilename
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2227
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2228
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2229
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2230
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2231
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2232
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2233
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2234
guessEncodingOfStream:aStream
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2235
    "look for a string of the form
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2236
            encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2237
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2238
            encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2239
     in the first few bytes of aStream."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2240
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  2241
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  2242
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  2243
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  2244
    ^ CharacterEncoder guessEncodingOfStream:aStream
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2245
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2246
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2247
!SourceCodeManagerUtilities::CheckinInfoDialog class methodsFor:'interface specs'!
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2248
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2249
windowSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2250
    "This resource specification was automatically generated
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2251
     by the UIPainter of ST/X."
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2252
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2253
    "Do not manually edit this!! If it is corrupted,
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2254
     the UIPainter may not be able to read the specification."
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2255
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2256
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2257
     UIPainter new openOnClass:SourceCodeManagerUtilities::CheckinInfoDialog andSelector:#windowSpec
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2258
     SourceCodeManagerUtilities::CheckinInfoDialog new openInterface:#windowSpec
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2259
     SourceCodeManagerUtilities::CheckinInfoDialog open
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2260
    "
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2261
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2262
    <resource: #canvas>
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2263
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2264
    ^ 
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2265
     #(FullSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2266
        name: windowSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2267
        window: 
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2268
       (WindowSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2269
          label: 'Enter Log Message'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2270
          name: 'Enter Log Message'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2271
          min: (Point 10 10)
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2272
          bounds: (Rectangle 0 0 563 290)
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2273
        )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2274
        component: 
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2275
       (SpecCollection
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2276
          collection: (
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2277
           (HorizontalPanelViewSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2278
              name: 'HorizontalPanel2'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2279
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2280
              horizontalLayout: left
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2281
              verticalLayout: center
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2282
              horizontalSpace: 3
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2283
              verticalSpace: 3
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2284
              component: 
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2285
             (SpecCollection
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2286
                collection: (
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2287
                 (LabelSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2288
                    label: 'Enter log message for: '
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2289
                    name: 'Label1'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2290
                    translateLabel: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2291
                    resizeForLabel: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2292
                    useDefaultExtent: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2293
                  )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2294
                 (LabelSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2295
                    name: 'Label2'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2296
                    translateLabel: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2297
                    labelChannel: descriptionHolder
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2298
                    useDefaultExtent: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2299
                  )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2300
                 )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2301
               
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2302
              )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2303
            )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2304
           (TextEditorSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2305
              name: 'TextEditor1'
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2306
              layout: (LayoutFrame 2 0.0 38 0 -2 1 -76 1)
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2307
              model: logMessageHolder
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2308
              hasHorizontalScrollBar: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2309
              hasVerticalScrollBar: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2310
            )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2311
           (CheckBoxSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2312
              label: 'Mark as stable'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2313
              name: 'CheckBox1'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2314
              layout: (AlignmentOrigin 3 0 -65 1 0 0)
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2315
              model: isStableHolder
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2316
              translateLabel: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2317
            )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2318
           (HorizontalPanelViewSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2319
              name: 'HorizontalPanel1'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2320
              layout: (LayoutFrame 0 0.0 -42 1 0 1.0 0 1.0)
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2321
              horizontalLayout: fitSpace
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2322
              verticalLayout: center
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2323
              horizontalSpace: 3
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2324
              verticalSpace: 3
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2325
              component: 
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2326
             (SpecCollection
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2327
                collection: (
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2328
                 (ActionButtonSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2329
                    label: 'OK'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2330
                    name: 'Button1'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2331
                    translateLabel: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2332
                    model: doAccept
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2333
                    extent: (Point 277 22)
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2334
                  )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2335
                 (ActionButtonSpec
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2336
                    label: 'Cancel'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2337
                    name: 'Button2'
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2338
                    translateLabel: true
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2339
                    model: doCancel
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2340
                    extent: (Point 277 22)
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2341
                  )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2342
                 )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2343
               
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2344
              )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2345
            )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2346
           )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2347
         
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2348
        )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2349
      )
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2350
! !
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2351
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2352
!SourceCodeManagerUtilities::CheckinInfoDialog class methodsFor:'opening'!
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2353
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2354
getCheckinInfoFor:aString initialAnswer:initialAnswer
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2355
    |dialog|
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2356
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2357
    dialog := self new.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2358
    dialog description:aString; logMessage:initialAnswer.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2359
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2360
    dialog open.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2361
    dialog accepted ifFalse:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2362
        ^ nil.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2363
    ].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2364
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2365
    ^ dialog    
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2366
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2367
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2368
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2369
         self getCheckinInfoFor:'hello' initialAnswer:'bla'
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2370
    "
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2371
! !
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2372
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2373
!SourceCodeManagerUtilities::CheckinInfoDialog methodsFor:'accessing'!
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2374
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2375
description
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2376
    ^ self descriptionHolder value
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2377
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2378
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2379
description:aString
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2380
    self descriptionHolder value:aString
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2381
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2382
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2383
isStable
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2384
    ^ self isStableHolder value
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2385
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2386
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2387
isStable:aBoolean
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2388
    self isStableHolder value:aBoolean
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2389
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2390
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2391
logMessage
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2392
    ^ self logMessageHolder value
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2393
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2394
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2395
logMessage:aString
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2396
    self logMessageHolder value:aString
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2397
! !
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2398
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2399
!SourceCodeManagerUtilities::CheckinInfoDialog methodsFor:'aspects'!
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2400
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2401
descriptionHolder
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2402
    "return/create the 'descriptionHolder' value holder (automatically generated)"
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2403
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2404
    descriptionHolder isNil ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2405
        descriptionHolder := ValueHolder new.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2406
    ].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2407
    ^ descriptionHolder
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2408
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2409
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2410
isStableHolder
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2411
    isStableHolder isNil ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2412
        isStableHolder := false asValue.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2413
    ].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2414
    ^ isStableHolder.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2415
!
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2416
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2417
logMessageHolder
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2418
    logMessageHolder isNil ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2419
        logMessageHolder := LastSourceLogMessage asValue.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2420
    ].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2421
    ^ logMessageHolder.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2422
! !
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2423
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2424
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2425
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2426
version
1462
2b2c6acdb53f Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents: 1460
diff changeset
  2427
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.117 2006-02-23 15:47:40 stefan Exp $'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2428
! !