SourceCodeManagerUtilities.st
author Claus Gittinger <cg@exept.de>
Fri, 19 Mar 2010 13:12:43 +0100
changeset 2253 7d7b0d2d1fe7
parent 2242 8ea64354212d
child 2254 a746281a4088
permissions -rw-r--r--
changed: #askForContainer:title:note:initialModule:initialPackage:initialFileName:forNewContainer:
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
"
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    13
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#SourceCodeManagerUtilities
1728
495b738df5fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
    15
	instanceVariableNames:''
495b738df5fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
    16
	classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery
495b738df5fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
    17
		YesToAllNotification'
495b738df5fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
    18
	poolDictionaries:''
495b738df5fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
    19
	category:'System-SourceCodeManagement'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    24
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    25
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    26
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    27
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    28
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    29
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    30
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    32
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    33
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    34
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    35
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    36
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    37
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    38
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    utility code which is useful at more than one place
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    (extracted from the browser)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    [author:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        Claus Gittinger (cg@exept)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [see also:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [instance variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [class variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    55
!SourceCodeManagerUtilities class methodsFor:'Signal constants'!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    56
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    57
yesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    58
    YesToAllNotification isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    59
        YesToAllNotification := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    60
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    61
    ^ YesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    62
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    63
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    64
yesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    65
    YesToAllQuery isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    66
        YesToAllQuery := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    67
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    68
    ^ YesToAllQuery
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
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    71
!SourceCodeManagerUtilities class methodsFor:'accessing'!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    72
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    73
lastModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    74
    "return the value of the static variable 'LastModule' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    75
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    76
    ^ LastModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    77
!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    78
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    79
lastModule:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    80
    "set the value of the static variable 'LastModule' (automatically generated)"
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 := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    83
!
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
lastPackage
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    86
    "return the value of the static variable 'LastPackage' (automatically generated)"
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
    ^ LastPackage
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    89
!
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
lastPackage:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    92
    "set the value of the static variable 'LastPackage' (automatically generated)"
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 := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    95
! !
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    96
1806
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
    97
!SourceCodeManagerUtilities class methodsFor:'resources'!
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
    98
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
    99
resourcePackage
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   100
    ^ #'stx:libtool'
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   101
! !
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   102
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!SourceCodeManagerUtilities class methodsFor:'utilities'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   105
classIsNotYetInRepository:aClass withManager:mgr
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   106
    |info|
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   107
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   108
    info := mgr sourceInfoOfClass:aClass.
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   109
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   110
    ^ (info isNil 
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   111
    or:[(info at:#fileName ifAbsent:nil) isNil
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   112
    or:[(info at:#module ifAbsent:nil) isNil
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   113
    or:[(info at:#directory ifAbsent:nil) isNil]]])
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   114
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   115
    "Created: / 25-10-2006 / 09:43:00 / cg"
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   116
!
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   117
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   118
nameOfExtensionsContainer
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   119
    ^ 'extensions.st'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   120
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   121
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   122
setPackageOfAllMethodsIn:aClass to:aPackage
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   123
    "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
   124
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   125
    |anyChange anyChangeHere|
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 := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   128
    aClass withAllPrivateClassesDo:[:eachClass |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   129
        anyChangeHere := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   130
        eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   131
            mthd package ~= aPackage ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   132
                mthd setPackage:aPackage.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   133
                anyChangeHere := true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   134
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   135
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   136
        anyChangeHere ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   137
            eachClass changed:#projectOrganization
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   138
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   139
        anyChangeHere ifTrue:[anyChange := true].
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   140
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   141
    anyChange ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   142
       Smalltalk changed:#projectOrganization
1185
e86907810d1f handle abortAll in checkIn
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   143
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   144
    ^ anyChange
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   145
!
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   146
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   147
setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   148
    "make all methods belong to the classes project"
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   149
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   150
    aChangeSet do:[:eachChange |
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   151
        eachChange isMethodCodeChange ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   152
            eachChange changeMethod package ~= aPackage ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   153
                Transcript showCR:'change package of ',eachChange changeMethod whoString.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   154
                eachChange changeMethod setPackage:aPackage.        
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   155
            ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   156
        ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   157
    ].
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   158
!
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   159
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   160
sourceCodeManagerFor:aClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   161
    |mgr|
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   162
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
   163
    mgr := aClass theNonMetaclass sourceCodeManager.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   164
    mgr isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   165
        SourceCodeManager isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   166
            (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
   167
                ^ nil
1012
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   168
            ].
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   169
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   170
        (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
   171
            ^ nil
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   172
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   173
        mgr := CVSSourceCodeManager.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   174
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   175
    ^ mgr
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
   176
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
   177
    "Modified: / 12-09-2006 / 14:14:35 / cg"
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   178
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   179
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   180
sourceCodeOfClass:aClass
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   181
    |stream src|
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   182
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   183
    stream := '' writeStream.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   184
    Method flushSourceStreamCache.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   185
    aClass fileOutOn:stream withTimeStamp:false.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   186
    src := stream contents asString.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   187
    stream close.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   188
    ^ src
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   189
! !
1160
d56159f5a86f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   190
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   191
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs'!
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   192
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   193
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision using:aSourceCodeManager
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   194
    "check-out an extension container from the source repository, and return the methods there as a change set.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   195
     If askForRevision is false, check-out the newest version.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   196
     Return a changeSet or nil (if any error occurred)"
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   197
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   198
    ^ self
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   199
        changeSetForExtensionMethodsForPackage:packageToCheckOut 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   200
        revision:nil orAskForRevision:askForRevision 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   201
        using:aSourceCodeManager
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   202
!
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   203
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   204
changeSetForExtensionMethodsForPackage:packageToCheckOut revision:revisionOrNil orAskForRevision:askForRevision using:aSourceCodeManager
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   205
    "check-out an extension container from the source repository, and return the methods there as a change set.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   206
     If askForRevision is false, check-out the newest version.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   207
     Return a changeSet or nil (if any error occurred)"
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   208
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   209
    |resources directory module file
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   210
     inChangeSet extensionMethods
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   211
     aStream sourceToLoad rev msg newestRev
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   212
     listHere listRep diffSet 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   213
     changed onlyHere onlyInRep answer labels values singleChangeSelector
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   214
     changedClasses default |
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   215
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   216
    resources := self classResources.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   217
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   218
    directory := packageToCheckOut asPackageId directory.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   219
    module := packageToCheckOut asPackageId module.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   220
    file := self nameOfExtensionsContainer.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   221
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   222
    "/
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   223
    "/ ask for revision
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   224
    "/
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   225
    (rev := revisionOrNil) isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   226
        newestRev := aSourceCodeManager newestRevisionInFile:file directory:directory module:module.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   227
        askForRevision ifFalse:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   228
            rev := newestRev ? ''
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   229
        ] ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   230
            msg := resources string:'CheckOut which revision of extensions for ''%1'': (empty for newest)' with:packageToCheckOut allBold.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   231
            newestRev notNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   232
                msg := msg , '\' , (resources string:'Newest in reporitory is %1.' with:newestRev)
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   233
            ].
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   234
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   235
            rev := SourceCodeManagerUtilities
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   236
                    askForExistingRevision:msg 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   237
                    title:'CheckOut from repository' 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   238
                    class:nil 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   239
                    manager:aSourceCodeManager 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   240
                    module:module package:directory fileName:file.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   241
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   242
            rev isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   243
                ^ nil   "/ canceled
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   244
            ].
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   245
        ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   246
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   247
    rev withoutSpaces isEmpty ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   248
        rev := #newest.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   249
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   250
    ] ifFalse:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   251
        msg := 'extracting previous %1'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   252
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   253
    aStream := aSourceCodeManager  
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   254
        streamForClass:nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   255
        fileName:file 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   256
        revision:rev 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   257
        directory:directory 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   258
        module:module
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   259
        cache:true.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   260
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   261
    aStream isNil ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   262
        self warn:(resources string:'Could not extract "extensions.st" for %1 from repository' with:packageToCheckOut allBold).
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   263
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   264
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   265
    aStream class readErrorSignal handle:[:ex |
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   266
        self warn:('read error while reading extracted source\\' , ex description) withCRs.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   267
        aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   268
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   269
    ] do:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   270
        sourceToLoad := aStream contents asString.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   271
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   272
    aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   273
    ^ ChangeSet fromStream:(sourceToLoad readStream).
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   274
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   275
    "Created: / 09-10-2006 / 13:04:37 / cg"
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   276
!
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   277
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   278
checkForExistingModule:module directory:directory container:containerFileName using:mgr allowCreate:allowCreate
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   279
    |resources moduleName directoryName containerName|
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   280
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   281
    resources := self classResources.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   282
    moduleName := module allBold.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   283
    directoryName := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   284
    containerName := containerFileName allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   285
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   286
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   287
    "/ check for the container
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   288
    "/
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
   289
    (mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   290
        allowCreate ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   291
            self warn:(resources string:'A container for ''%1'' does not exist in ''%2:%3''' 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   292
                                   with:containerName with:moduleName with:directoryName) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   293
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   294
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   295
        (Dialog 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   296
            confirm:(resources string:'''%1'' is a new container (in ''%2:%3'').\\Create it ?' 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   297
                                 with:containerName with:moduleName with:directoryName) withCRs
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   298
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   299
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   300
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   301
        ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   302
        (mgr createContainerForText:'' inModule:module package:directory container:containerFileName) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   303
            self warn:(resources string:'Cannot create new container: ''%1'' (in ''%2:%3'')' 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   304
                                 with:containerName with:moduleName with:directoryName).
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   305
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   306
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   307
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   308
    ^ true.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   309
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
   310
    "Modified: / 13-09-2006 / 18:24:57 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   311
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   312
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   313
checkForExistingModule:module directory:directory using:mgr allowCreate:allowCreate
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   314
    |resources moduleNameBold directoryNameBold|
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   315
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   316
    resources := self classResources.
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   317
    moduleNameBold := module allBold.
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   318
    directoryNameBold := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   319
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   320
    "/
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   321
    "/ check for the directory
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   322
    "/
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   323
    (mgr checkForExistingModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   324
        allowCreate ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   325
            self warn:(resources string:'A directory for ''%1'' does not exist in module ''%2''' 
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   326
                                   with:directoryNameBold with:moduleNameBold) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   327
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   328
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   329
        (Dialog 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   330
            confirm:(resources string:'''%1'' is a new directory in module ''%2''.\\create it ?' 
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   331
                                 with:directoryNameBold with:moduleNameBold) withCRs
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   332
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   333
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   334
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   335
        ].
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   336
        (mgr createModule:module directory:directory) ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   337
            self warn:(resources string:'Cannot create new directory: ''%1'' in module ''%2''' 
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   338
                                   with:directoryNameBold with:moduleNameBold) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   339
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   340
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   341
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   342
    ^ true.
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   343
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   344
    "Modified: / 06-10-2006 / 17:08:08 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   345
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   346
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   347
checkForExistingModule:module using:mgr allowCreate:allowCreate
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   348
    |resources moduleName answer|
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   349
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   350
    (mgr checkForExistingModule:module) ifFalse:[
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   351
        resources := self classResources.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   352
        moduleName := module allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   353
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   354
        allowCreate ifFalse:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   355
            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
   356
                                  with:moduleName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   357
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   358
        ].
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   359
        AbortAllOperationRequest isHandled ifTrue:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   360
            answer := Dialog 
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   361
                confirmWithCancel:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName)
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   362
                labels:(resources array:#('Cancel All' 'Cancel' 'Yes' )).
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   363
            answer isNil ifTrue:[ AbortAllOperationRequest raise ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   364
        ] ifFalse:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   365
            answer := Dialog 
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   366
                confirm:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName) 
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   367
                noLabel:'Cancel'
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   368
        ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
   369
        answer ifFalse:[ ^ false].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   370
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   371
        (mgr createModule:module) ifFalse:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   372
            self warn:(resources stringWithCRs:'Cannot create new module: ''%1''' with:moduleName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   373
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   374
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   375
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   376
    ^ true.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   377
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   378
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   379
checkinClass:aClass
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   380
    "check a class into the source repository.
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   381
     Asks interactively for a log-message."
882
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   382
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   383
    ^ self checkinClass:aClass withInfo:nil
882
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   384
!
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   385
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   386
checkinClass:aClass withInfo:aLogInfoOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   387
    "check a class into the source repository.
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   388
     If the argument, aLogInfoOrNil isNil, ask interactively for a log-message."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   389
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   390
    ^ self checkinClass:aClass withInfo:aLogInfoOrNil withCheck:true
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   391
!
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   392
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   393
checkinClass:aClass withInfo:aLogInfoNil withCheck:doCheckClass
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   394
    "check a class into the source repository.
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   395
     If the argument, aLogInfoNil isNil, ask interactively for log-message.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   396
     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
   397
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
   398
    |logMessage checkinInfo mgr pri resources initialLogMessage|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   399
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   400
    aClass isLoaded ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   401
        self information:'cannot checkin unloaded classes (' , aClass name , ').'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   402
        ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   403
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   404
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   405
    mgr := self sourceCodeManagerFor:aClass.
954
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   406
    mgr isNil ifTrue:[
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   407
        ^ false
954
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   408
    ].
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   409
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
   410
    "/ heuristics for a useful initial log message...
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   411
    aLogInfoNil isNil ifTrue:[
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   412
        initialLogMessage := self goodInitialLogMessageForCheckinClassOfClass:aClass.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   413
        checkinInfo := self 
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   414
                        getCheckinInfoFor:aClass name 
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
   415
                        initialAnswer:initialLogMessage.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   416
        checkinInfo isNil ifTrue:[^ false].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   417
        logMessage := checkinInfo logMessage.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   418
    ] ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   419
        aLogInfoNil isString ifTrue:[
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   420
            "soon obsolete..."    
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   421
            logMessage := aLogInfoNil
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   422
        ] ifFalse:[ 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   423
            checkinInfo := aLogInfoNil.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   424
            logMessage := checkinInfo logMessage.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   425
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   426
    ].
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
   427
    logMessage notNil ifTrue:[  
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
   428
        logMessage := logMessage asSingleByteStringReplaceInvalidWith:$?
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
   429
    ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   430
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   431
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   432
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   433
    (self classIsNotYetInRepository:aClass withManager:mgr) ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   434
        (self createSourceContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   435
"/            self warn:'did not create a container for ''' , aClass name , ''''.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   436
            ^ false
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   437
        ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   438
        ^ true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   439
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   440
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   441
    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
   442
    pri := Processor activePriority.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   443
    Processor activeProcess withPriority:pri-1 to:pri
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   444
    do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   445
        |revision aborted freshCreated|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   446
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   447
        freshCreated := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   448
        revision := aClass revision.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   449
        revision isNil ifTrue:[ 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   450
            "/ mhmh - check if it has a container.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   451
            (mgr checkForExistingContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   452
                (self createSourceContainerForClass:aClass) ifFalse:[
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   453
                    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
   454
                    ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   455
                ].
1503
87c2f93ff941 care for files in the Attic
Claus Gittinger <cg@exept.de>
parents: 1501
diff changeset
   456
                freshCreated := true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   457
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   458
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   459
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
   460
        doCheckClass value ifTrue:[
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   461
            "/ check if the class contains halts, error-sends etc.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
   462
            (self checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:doCheckClass) ifFalse:[
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   463
                ^ false
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   464
            ].
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   465
        ].
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   466
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   467
        freshCreated ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   468
            aborted := false.
1113
30540d5fc3b7 class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
   469
            AbortOperationRequest handle:[:ex |
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   470
                aborted := true.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   471
                ex return.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   472
            ] do:[
1828
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   473
                |checkinState cause|
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   474
                checkinState := false.
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   475
                cause := ''.
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   476
                [
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   477
                    checkinState := mgr checkinClass:aClass logMessage:logMessage
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   478
                ] on:SourceCodeManagerError do:[:ex| cause := ex description].
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   479
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   480
                checkinState ifFalse:[
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   481
                    Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause.
e2eafc59fa91 handle checkin errors
Stefan Vogel <sv@exept.de>
parents: 1811
diff changeset
   482
                    self warn:'checkin of ''' , aClass name allBold , ''' failed - ', cause.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   483
                    ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   484
                ].
1725
b54eeae38942 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
   485
                checkinInfo notNil ifTrue:[
b54eeae38942 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
   486
                    checkinInfo isStable ifTrue:[
b54eeae38942 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
   487
                        "set stable tag for class that has been checked in"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   488
                        self tagClass:aClass as:#stable.
1725
b54eeae38942 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
   489
                    ].
b54eeae38942 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
   490
                    checkinInfo tagIt ifTrue:[
b54eeae38942 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
   491
                        "set an additional tag for class that has been checked in"
1728
495b738df5fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
   492
                        self tagClass:aClass as:(checkinInfo tag).
1725
b54eeae38942 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
   493
                    ].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   494
                ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   495
            ].
1519
c0e28a7d3c73 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1514
diff changeset
   496
            aborted ifTrue:[  |con|
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   497
                Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'.
1519
c0e28a7d3c73 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1514
diff changeset
   498
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   499
                AbortAllOperationRequest isHandled ifTrue:[
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   500
                    (Dialog 
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   501
                        confirm:(resources stringWithCRs:'Checkin of ''' , aClass name , ''' aborted.\\Cancel all ?')
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   502
                        default:false)
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   503
                    ifTrue:[
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   504
                        AbortAllOperationRequest raise.
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   505
                    ]
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   506
                ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   507
                ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   508
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   509
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   510
    ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   511
    ^ true
1113
30540d5fc3b7 class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
   512
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   513
    "Modified: / 25-10-2006 / 09:43:26 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   514
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   515
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   516
checkinClasses:aCollectionOfClass
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   517
    "check a collection of classes into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   518
     Asks interactively for log-message."
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   519
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   520
    ^ self checkinClasses:aCollectionOfClass withInfo:nil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   521
!
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   522
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   523
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   524
    "check a bunch of classes into the source repository.
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   525
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   526
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   527
    ^ self
1142
cba1ede48a4a allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   528
        checkinClasses:aCollectionOfClasses 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   529
        withInfo:aLogInfoOrNil 
1142
cba1ede48a4a allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   530
        withCheck:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true)
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   531
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   532
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   533
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   534
    "check a bunch of classes into the source repository.
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   535
     If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message."
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   536
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   537
    |classes allClasses checkinInfoOrString resources yesOrNoToAll unchangedClasses|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   538
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   539
    "/ ignore private classes
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   540
    classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   541
    classes isEmpty ifTrue:[
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   542
        self information:'Only private classes given - nothing checked in.'.
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   543
        ^ self
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   544
    ].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   545
    classes := classes select:[:aClass | aClass isLoaded].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   546
    classes isEmpty ifTrue:[
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   547
        self information:'Only unloaded classes given - nothing checked in.'.
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   548
        ^ self
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   549
    ].
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   550
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   551
    classes size == 1 ifTrue:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   552
        ^ self checkinClass:classes first withInfo:aLogInfoOrStringNil withCheck:doCheckClasses.
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   553
    ].
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   554
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   555
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   556
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   557
    "ask once, for all classes"
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   558
    aLogInfoOrStringNil isNil ifTrue:[
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   559
        checkinInfoOrString := self 
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   560
                        getCheckinInfoFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size)
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   561
                        initialAnswer:nil
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   562
                        withQuickOption:true.
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   563
        checkinInfoOrString isNil ifTrue:[^ self].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   564
    ] ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   565
        checkinInfoOrString := aLogInfoOrStringNil.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   566
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   567
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   568
    allClasses := classes.    
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   569
    checkinInfoOrString quickCheckIn ifTrue:[
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
   570
        classes := classes select:[:aClass | aClass hasUnsavedChanges].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   571
    ].
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   572
1727
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   573
    AbortAllOperationRequest handle:[:ex |
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   574
        ex return
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   575
    ] do:[
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   576
        classes notEmpty ifTrue:[
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   577
            self yesToAllNotification handle:[:ex |
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   578
                yesOrNoToAll := ex parameter.
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   579
                ex proceed
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   580
            ] do:[
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   581
                self yesToAllQuery handle:[:ex |
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   582
                    ex proceedWith:yesOrNoToAll
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   583
                ] do:[
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   584
                    classes do:[:aClass |
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   585
                        self activityNotification:(resources string:'checking in %1' with:aClass name).
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   586
                        "/ ca does not want boxes to pop up all over ...
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   587
                        UserInformation handle:[:ex |
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   588
                            Transcript showCR:ex description.
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   589
                            ex proceed.
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   590
                        ] do:[
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   591
                            AbortOperationRequest catch:[
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   592
                                self 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   593
                                    checkinClass:aClass 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   594
                                    withInfo:checkinInfoOrString 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   595
                                    withCheck:doCheckClasses
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   596
                            ]
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   597
                        ].
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   598
                    ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   599
                ]
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   600
            ].
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   601
        ].
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   602
1727
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   603
        (checkinInfoOrString isStable or:[checkinInfoOrString tagIt])
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   604
        ifTrue:[
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   605
            "/mhmh - but tag should be set on all (even unchanged ones)
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   606
            "/ the other onces have already been tagged
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   607
            unchangedClasses := allClasses select:[:eachClass | (classes includes:eachClass) not].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   608
1727
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   609
            "mhmh - could still have to tag them"
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   610
            checkinInfoOrString isStable ifTrue:[
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   611
                unchangedClasses do:[:eachClass |
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   612
                    self tagClass:eachClass as:#stable.
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   613
                ].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   614
            ].
1727
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   615
            checkinInfoOrString tagIt ifTrue:[
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   616
                unchangedClasses do:[:eachClass |
1728
495b738df5fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
   617
                    self tagClass:eachClass as:(checkinInfoOrString tag).
1727
8a1718270366 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1726
diff changeset
   618
                ].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   619
            ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   620
        ].
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   621
    ].
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
   622
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
   623
    "Modified: / 12-09-2006 / 13:07:49 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   624
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   625
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   626
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   627
    "checkin a projects extensions into the source repository.
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   628
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   629
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   630
    |logMessage checkinInfo mgr pri resources module directory containerFileName s 
2233
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   631
     methodSource methodsSortedByName defClass|
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   632
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   633
    resources := self classResources.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   634
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   635
    "/ the following is wrong - must ask the projectDefinition !!
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
   636
    mgr := self sourceCodeManagerFor:aCollectionOfMethods first mclass.
2200
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   637
    mgr isNil ifTrue:[ ^ false ].
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
   638
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   639
    module := aPackageID asPackageId module.
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   640
    directory := aPackageID asPackageId directory.
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   641
    containerFileName := self nameOfExtensionsContainer.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   642
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   643
    aLogInfoOrStringOrNil isNil ifTrue:[
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   644
        checkinInfo := self getCheckinInfoFor:containerFileName allBold initialAnswer:nil.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   645
        checkinInfo isNil ifTrue:[^ false].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   646
        logMessage := checkinInfo logMessage.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   647
    ] ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   648
        aLogInfoOrStringOrNil isString ifTrue:[
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   649
            logMessage := aLogInfoOrStringOrNil
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   650
        ] ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   651
            checkinInfo := aLogInfoOrStringOrNil.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   652
            logMessage := checkinInfo logMessage.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
   653
        ].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   654
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   655
2200
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   656
    (mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   657
        (self checkForExistingModule:module using:mgr allowCreate:true) ifFalse:[^ false].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   658
        LastModule := module.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   659
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   660
        (self checkForExistingModule:module directory:directory using:mgr allowCreate:true) ifFalse:[^ false].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   661
        LastPackage := directory.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   662
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   663
        (self checkForExistingModule:module directory:directory container:containerFileName using:mgr allowCreate:true) ifFalse:[^ false].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   664
    ].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   665
1120
f039453a5562 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   666
    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
   667
    pri := Processor activePriority.
2200
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   668
    Processor activeProcess 
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   669
        withPriority:pri-1 to:pri
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   670
        do:[
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   671
            s := '' writeStream.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   672
            
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   673
            s nextPutAll:'"{ Package: '''.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   674
            s nextPutAll:aPackageID asString.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   675
            s nextPutAll:''' }"'; nextPutChunkSeparator; cr; cr.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   676
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   677
"/        s nextPutAll:(Smalltalk timeStamp).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   678
"/        s nextPutChunkSeparator. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   679
"/        s cr; cr.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   680
2200
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   681
            "/ sort them by name (to avoid conflict due to CVS merge)
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   682
            methodsSortedByName := aCollectionOfMethods asOrderedCollection.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   683
            methodsSortedByName sort:[:a :b |
1015
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   684
                                        |clsA clsB|
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   685
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   686
                                        clsA := a mclass name.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   687
                                        clsB := b mclass name.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   688
                                        clsA < clsB ifTrue:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   689
                                            true
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   690
                                        ] ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   691
                                            clsA > clsB ifTrue:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   692
                                                false
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   693
                                            ] ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   694
                                                a selector < b selector
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   695
                                            ]
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   696
                                        ]
2200
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   697
                                      ].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   698
            methodsSortedByName do:[:aMethod |
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   699
                aMethod mclass fileOutMethod:aMethod on:s.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   700
                s cr.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   701
            ].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   702
2233
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   703
            defClass := ProjectDefinition definitionClassForPackage:aPackageID.
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   704
            defClass notNil ifTrue:[
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   705
                "/ make sure, an extensionVersion_XXX method is included...
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   706
                "/ (notice: no need to support a secondary backward compatible non-manager related version method here)
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   707
                (methodsSortedByName contains:[:aMethod | aMethod selector == mgr nameOfVersionMethodForExtensions]) ifFalse:[
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   708
                    s nextPutLine:('!!%1 class methodsFor:''documentation''!!' bindWith:defClass name).
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   709
                    s cr.
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   710
                    s nextChunkPut:
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   711
                        (mgr versionMethodTemplateForSmalltalkFor:(mgr nameOfVersionMethodForExtensions)).
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   712
                    s space; nextPutChunkSeparator.
59fc21dd040d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2209
diff changeset
   713
                ].
2200
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   714
            ].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   715
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   716
            methodSource := s contents.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   717
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   718
            UserInformation handle:[:ex |
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   719
                Transcript showCR:ex description.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   720
                ex proceed.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   721
            ] do:[
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   722
                Transcript showCR:('checking in ',containerFileName,' ...').
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   723
                (mgr 
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   724
                    checkin:containerFileName
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   725
                    text:methodSource
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   726
                    directory:directory 
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   727
                    module:module
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   728
                    logMessage:logMessage
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   729
                    force:false) 
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   730
                ifFalse:[
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   731
                    Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   732
                    self warn:'Checkin of ''' , containerFileName allBold , ''' failed'.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   733
                    ^ false.
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   734
                ].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   735
                checkinInfo notNil ifTrue:[
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   736
                    |path|
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   737
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   738
                    path := (module, '/', directory, '/', containerFileName).
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   739
                    checkinInfo isStable ifTrue:[
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   740
                        "set stable tag for class that has been checked in"
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   741
                        self tagPath:path as:#stable using:mgr.    
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   742
                    ].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   743
                    checkinInfo tagIt ifTrue:[
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   744
                        "set an additional tag for class that has been checked in"
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   745
                        self tagPath:path as:(checkinInfo tag) using:mgr.    
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   746
                    ].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   747
                ].
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   748
                mgr postCheckInExtensionsForPackage:aPackageID    
b9e1551c5a0d changed: #checkinExtensionMethods:forPackage:withInfo:
Claus Gittinger <cg@exept.de>
parents: 2194
diff changeset
   749
            ].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   750
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   751
    ^ true
1090
8608e5b91fa7 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1084
diff changeset
   752
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
   753
    "Modified: / 12-09-2006 / 14:14:49 / cg"
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   754
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   755
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   756
checkoutClass:aClass askForMerge:askForMerge
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   757
    "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
   758
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   759
    self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   760
        checkoutClass:aClass 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   761
        askForRevision:true
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   762
        askForMerge:askForMerge
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
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   765
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   766
    "check-out a class from the source repository.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   767
     If askForRevision is false, check-out the newest version."
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   768
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   769
    self
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   770
        checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge 
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   771
        askForConfirmation:true
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   772
!
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   773
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   774
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge askForConfirmation:askForConfirmation
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   775
    "check-out a class from the source repository.
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   776
     If askForRevision is false, check-out the newest version."
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   777
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   778
    |mgr resources sourceInfo
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   779
     currentClass inChangeSet
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   780
     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
   781
     nm msg rev2 newestRev
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   782
     containerModule containerPackage containerFile rslt
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   783
     pkg listHere listRep diffSet 
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   784
     changed onlyHere onlyInRep answer labels values singleChangeSelector
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   785
     changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   786
     wasInChangeSetBefore|
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   787
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   788
    aClass isNil ifTrue:[self error:'nil class'].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   789
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   790
    resources := self classResources.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   791
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   792
    currentClass := aClass theNonMetaclass.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   793
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   794
    nm := currentClass name.
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   795
    mgr := self sourceCodeManagerFor:currentClass.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   796
    mgr isNil ifTrue:[
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   797
        ^ self
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   798
    ].
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   799
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   800
    sourceInfo := mgr sourceInfoOfClass:currentClass.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   801
    sourceInfo notNil ifTrue:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
   802
        currentClass package ~= PackageId noProjectID ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   803
            containerPackage := mgr directoryFromSourceInfo:sourceInfo.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   804
            containerModule := mgr moduleFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   805
        ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   806
        containerFile := mgr containerFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   807
    ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   808
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   809
    currentClass isLoaded ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   810
        rev := currentClass binaryRevision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   811
        rev2 := currentClass revision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   812
        rev isNil ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   813
            rev := rev2
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   814
        ].
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   815
        rev isNil ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   816
            pkg := currentClass package.
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
   817
            (pkg notNil and:[pkg ~= PackageId noProjectID]) ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   818
                containerModule := pkg upTo:$:.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   819
                containerPackage := pkg copyFrom:(containerModule size + 2).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   820
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   821
            containerModule size == 0 ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   822
                containerModule := (SourceCodeManagerUtilities lastModule ) ? Project current repositoryModule.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   823
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   824
            containerPackage size == 0 ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   825
                containerPackage := (SourceCodeManagerUtilities lastPackage ) ? Project current package.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   826
            ].
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   827
            answer := self confirmWithCancel:(resources 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   828
                                                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
   829
                                                with:containerModule allBold 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   830
                                                with:containerPackage allBold
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   831
                                                with:currentClass name allBold) withCRs.
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   832
            answer isNil ifTrue:[^ self "cancelled"].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   833
            answer ifFalse:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   834
                rslt := SourceCodeManagerUtilities
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   835
                    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
   836
                    title:'Container to load from' note:nil 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   837
                    initialModule:containerModule 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   838
                    initialPackage:containerPackage 
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   839
                    initialFileName:(currentClass nameWithoutPrefix , '.st')
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   840
                    forNewContainer:false.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   841
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   842
                rslt isNil ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   843
                    "/ canel
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   844
                    ^ self
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   845
                ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   846
                containerModule := "lastModule :=" rslt at:#module.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   847
                containerPackage := "lastPackage :=" rslt at:#package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   848
                containerFile := rslt at:#fileName.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   849
            ].
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   850
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   851
"/            rslt := SourceCodeManagerUtilities
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   852
"/                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
   853
"/                title:'Container to checkOut' note:nil 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   854
"/                initialModule:containerModule 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   855
"/                initialPackage:containerPackage
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   856
"/                initialFileName:(currentClass name , '.st').
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   857
"/                forNewContainer:false.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   858
"/            rslt isNil ifTrue:[^ self].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   859
            "/ 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
   860
            "/ ^ self
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   861
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   862
    ].
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   863
1966
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   864
    containerFile isNil ifTrue:[
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   865
        containerFile := currentClass classFilename.
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   866
    ].
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   867
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   868
    "/
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   869
    "/ 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
   870
    "/
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   871
"/    newestRev := mgr newestRevisionOf:currentClass.
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
   872
    containerModule isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
   873
        containerModule := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
   874
                                        stringWithCRs:'Missing Module Information for CheckOut of "%1".\\Module:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
   875
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
   876
        containerModule isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
   877
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
   878
    containerPackage isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
   879
        containerPackage := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
   880
                                        stringWithCRs:'Missing Package Information for CheckOut of "%1".\\Package:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
   881
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
   882
        containerPackage isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
   883
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
   884
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   885
    newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   886
    askForRevision ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   887
        rev := newestRev ? ''
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   888
    ] ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   889
        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
   890
        rev notNil ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   891
            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
   892
                                           with:nm allBold with:rev).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   893
            (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   894
                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
   895
                                               with:rev2)
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   896
            ]
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   897
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   898
        newestRev notNil ifTrue:[
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   899
            msg := msg , '\' , (resources string:'Newest in repository is %1.'
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   900
                                           with:newestRev)
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   901
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   902
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   903
        rev := SourceCodeManagerUtilities
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   904
                    askForExistingRevision:msg 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   905
                    title:'CheckOut from repository' 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   906
                    class:currentClass.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   907
        rev isNil ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
   908
            ^ self   "/ canceled
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   909
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   910
    ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   911
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   912
    rev withoutSpaces isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   913
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   914
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   915
        aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   916
        revString := '(newest: ' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   917
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   918
        msg := 'extracting previous %1'.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   919
"/        aStream := mgr getSourceStreamFor:currentClass revision:rev.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   920
"/        revString := rev
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   921
        aStream := mgr  
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   922
            streamForClass:currentClass
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   923
            fileName:containerFile 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   924
            revision:rev 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   925
            directory:containerPackage 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   926
            module:containerModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   927
            cache:true.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   928
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   929
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   930
    aStream isNil ifTrue:[
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   931
        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
   932
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   933
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   934
    aStream class readErrorSignal handle:[:ex |
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   935
        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
   936
        aStream close.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   937
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   938
    ] do:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   939
        sourceToLoad := aStream contents asString.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   940
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   941
    aStream close.
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   942
1919
8d30ac5be40f *** empty log message ***
boris
parents: 1913
diff changeset
   943
    wasInChangeSetBefore := ChangeSet current includesChangeForClassOrMetaclass:currentClass.
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   944
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   945
    currentClass isLoaded ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   946
        rev = newestRev ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   947
            currentClass autoload.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   948
        ] ifFalse:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   949
            sourceToLoad readStream fileIn.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   950
        ].
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   951
        wasInChangeSetBefore ifFalse:[
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   952
            ChangeSet current condenseChangesForClass:currentClass.
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   953
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   954
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   955
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   956
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
   957
    inChangeSet := aClass hasUnsavedChanges.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   958
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   959
    self activityNotification:'generating current source...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   960
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   961
    currentSource := self sourceCodeOfClass:currentClass.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   962
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   963
    self activityNotification:'comparing...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   964
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   965
    sourceToLoad = currentSource ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   966
        "/ make all methods belong to the classes project
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   967
        self setPackageOfAllMethodsIn:aClass to:aClass package.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   968
        inChangeSet ifTrue:[
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   969
            rev = newestRev ifTrue:[
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   970
                (askForConfirmation not
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   971
                or:[ wasInChangeSetBefore not
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   972
                or:[ self confirm:(resources 
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   973
                                stringWithCRs:'%1 is up-to-date.\\Remove entries for %1 from changeSet ?'
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
   974
                                with:aClass name)]]) 
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   975
                ifTrue:[
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   976
                    ChangeSet current condenseChangesForClass:aClass.
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   977
                ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   978
            ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
   979
        ].
2001
d91e3065c3b6 Again: #checkoutClass:...
Stefan Vogel <sv@exept.de>
parents: 2000
diff changeset
   980
        self activityNotification:'... nothing changed in repository'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   981
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   982
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   983
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   984
    self activityNotification:'generating diffSet...'.
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   985
    Error handle:[:ex |
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   986
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   987
            confirm:(resources 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   988
                        stringWithCRs:'An error was encountered while generating the current source of the class %1.\This might be due to some missing or corrupted source file.\You may proceed, but no information about the differences between your current version and the repositories version can be shown.\\Continue ?'
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   989
                        with:currentClass name allBold) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   990
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
   991
        ifFalse:[
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
   992
            AbortOperationRequest raise
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   993
        ].
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   994
        listHere := ChangeSet new
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   995
    ] do:[
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   996
        listHere := ChangeSet fromStream:(currentSource readStream).
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   997
    ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   998
    listRep := ChangeSet fromStream:(sourceToLoad readStream).
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   999
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1000
    Error handle:[:ex |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1001
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1002
            confirm:(resources 
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1003
                        stringWithCRs:'An error:
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1004
    ',ex description,'
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1005
was encountered while trying to figure out what has changed.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1006
This might be due to some missing or corrupted source file.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1007
IF you proceed, the old code will be loaded over the existing code without further checks (fileIn).
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1008
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1009
Continue ?'
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1010
                        ) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1011
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1012
        ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1013
            ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1014
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1015
        sourceToLoad readStream fileIn.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1016
        ^ self.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1017
    ] do:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1018
        versionMethodsHere := listHere select:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  1019
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1020
                                               and:[change changeClass isMeta]])].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1021
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1022
        versionMethodsRep := listRep select:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  1023
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1024
                                               and:[change changeClass isMeta]])].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1025
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1026
        "/ compare all but the version methods
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1027
        listHere := listHere select:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  1028
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1029
                                               and:[change changeClass isMeta]]) not].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1030
        listRep := listRep select:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  1031
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1032
                                               and:[change changeClass isMeta]]) not].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1033
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1034
        diffSet := listHere diffSetsAgainst:listRep.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1035
        changed := diffSet changed.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1036
        onlyHere := diffSet onlyInReceiver.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1037
        onlyHere := onlyHere select:[:eachDiff|  |methodsPackage|
2097
2cb761062819 take care of class definitions
Stefan Vogel <sv@exept.de>
parents: 2096
diff changeset
  1038
                eachDiff isClassDefinitionChange not and:[
2cb761062819 take care of class definitions
Stefan Vogel <sv@exept.de>
parents: 2096
diff changeset
  1039
                    methodsPackage := (eachDiff changeClass compiledMethodAt:eachDiff selector) package.
2cb761062819 take care of class definitions
Stefan Vogel <sv@exept.de>
parents: 2096
diff changeset
  1040
                    methodsPackage == containerPackage
2cb761062819 take care of class definitions
Stefan Vogel <sv@exept.de>
parents: 2096
diff changeset
  1041
                ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1042
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1043
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1044
        onlyInRep := diffSet onlyInArg.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1045
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1046
        changedClassDefinitions := changed select:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1047
        changed := changed reject:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1048
        changed := changed reject:[:eachChangePair | eachChangePair first isClassCommentChange]. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1049
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1050
        labels := #('Cancel' 'Merge' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1051
        values := #(nil #merge #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1052
        default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1053
                        ifTrue:[3. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1054
                        ifFalse:[2. "i.e. merge"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1055
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1056
        msg := 'About to load ''%4''.\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1057
        onlyInRep size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1058
            msg := msg , 'The repositories version contains %1 method(s) which are not in your current class.\'.
2064
3e7b6104ce47 When checking out newest sources from a repository,
Stefan Vogel <sv@exept.de>
parents: 2063
diff changeset
  1059
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1060
        onlyHere size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1061
            onlyInRep size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1062
                msg := msg , 'And there '.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1063
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1064
                msg := msg , 'There '.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1065
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1066
            msg := msg , 'are %2 methods in your current class, which are not in the repository.\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1067
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1068
        changed size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1069
            changed size == 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1070
                msg := msg , 'The ''%6''-method is different (present in both).\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1071
                singleChangeSelector := changed first first selector allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1072
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1073
                msg := msg , '%3 methods are different (present in both).\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1074
            ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1075
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1076
        changedClassDefinitions size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1077
            changedClassDefinitions size == 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1078
                msg := msg , 'The class definition is different.\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1079
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1080
                msg := msg , '%5 class definitions are different.\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1081
            ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1082
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1083
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1084
        onlyHere isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1085
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1086
                (changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1087
                    versionMethodsRep size == 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1088
    "/                    (self confirm:(resources string:'Versions are identical: %1\\Update the version-ID ?' with:aClass name) withCRs) ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1089
                            versionMethodsRep first apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1090
    "/                    ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1091
                    ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1092
                    "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1093
                    "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1094
                    self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1095
                    self activityNotification:'Only the version method has been changed in repository'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1096
                    ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1097
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1098
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1099
                    msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made).'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1100
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1101
                labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1102
                values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1103
                default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1104
                                ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1105
                                ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1106
                default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1107
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1108
                changed isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1109
                    msg := msg , '\Attention:\Load will load methods which are not present in ''%4''.'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1110
                    labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1111
                    values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1112
                    default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1113
                                    ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1114
                                    ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1115
                    default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1116
                ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1117
                    inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1118
                        msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1119
                    ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1120
                    msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1121
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1122
            ]
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1123
        ] ifFalse:[
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1124
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1125
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1126
                    msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made),'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1127
                    msg := msg , '\and remove added methods which are not present in the repository version.'.
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1128
                ].
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1129
                labels := #('Cancel' 'Load'). 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1130
                values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1131
                default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1132
                                ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1133
                                ifFalse:[1. "i.e. cancel"].
1907
30ca5aea5a7a dialogs defaults
fm
parents: 1886
diff changeset
  1134
                default := 2. 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1135
            ] ifFalse:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1136
                inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1137
                    msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1138
                    msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1139
                ]
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1140
            ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1141
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1142
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1143
        msg := msg bindWith:onlyInRep size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1144
                   with:onlyHere size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1145
                   with:changed size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1146
                   with:aClass name allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1147
                   with:changedClassDefinitions size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1148
                   with:singleChangeSelector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1149
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1150
        askForConfirmation ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1151
            answer := #load           
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1152
        ] ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1153
            answer := (Dialog confirmWithCancel:msg withCRs
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1154
                   labels:(resources array:labels)
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1155
                   values:values 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1156
                   default:default).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1157
            answer isNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1158
                self activityNotification:'...cancelled'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1159
                ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1160
            ].
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1161
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1162
        self activityNotification:'updating...'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1163
        changedClasses := IdentitySet new.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1164
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1165
    "/    Class withoutUpdatingChangesDo:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1166
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1167
            "when loading, remove all the methods which are no longer in classes with a changed
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1168
             class definition. So we avoid possible compile errors of old methods, which will go away"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1169
            onlyHere do:[:eachChange |   
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1170
                 "remove this change (method not present in repository version)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1171
                 |cClass cSel|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1172
                 eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1173
                     cClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1174
                     cSel := eachChange selector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1175
                     cClass basicRemoveSelector:cSel.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1176
                 ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1177
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1178
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1179
            changedClassDefinitions do:[:eachChangeArr | 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1180
                |cHere eachChangedClass| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1181
                cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1182
                eachChangedClass := cHere changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1183
                eachChangedClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1184
                    changedClasses add:eachChangedClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1185
                    eachChangedClass := eachChangedClass theNonMetaclass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1186
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1187
                    "remove changed methods now, but keep the changes (to be applied later)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1188
                    changed do:[:eachChangeArr|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1189
                        |eachChange eachClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1190
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1191
                        eachChange := eachChangeArr first.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1192
                        eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1193
                            eachClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1194
                            eachClass theNonMetaclass == eachChangedClass ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1195
                                eachClass basicRemoveSelector:eachChange selector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1196
                            ].
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  1197
                        ].
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  1198
                    ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1199
                ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1200
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1201
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1202
           "apply class definition changes (use the repository version)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1203
           changedClassDefinitions do:[:eachChangeArr |    
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1204
                |cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1205
                cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1206
                cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1207
            ].
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1208
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1209
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1210
        onlyInRep do:[:eachChange |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1211
            |changeClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1212
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1213
            "apply this change (method only present in rep-version)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1214
             eachChange apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1215
             eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1216
                 changeClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1217
                 changeClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1218
                     eachChange changeMethod setPackage:(changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1219
                     changedClasses add:changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1220
                 ]
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1221
             ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1222
        ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1223
    .
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1224
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1225
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1226
                 |cHere cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1227
                 cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1228
                 cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1229
                 cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1230
                 cRep isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1231
                     cRep changeMethod setPackage:(cRep changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1232
                     changedClasses add:cRep changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1233
                 ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1234
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1235
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1236
            versionMethodsRep size >= 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1237
                versionMethodsRep last apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1238
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1239
                self error:'missing version method in repository' mayProceed:true.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1240
            ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1241
            "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1242
            "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1243
            self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1244
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1245
    "/    ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1246
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1247
        answer == #load ifTrue:[
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  1248
            inChangeSet := aClass hasUnsavedChanges.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1249
            inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1250
                rev = newestRev ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1251
                    (wasInChangeSetBefore not
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1252
                     or:[ self confirm:(resources 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1253
                                    stringWithCRs:'%1 is now up-to-date.\\Remove entries for %1 from changeSet ?'
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1254
                                    with:aClass name)]) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1255
                    ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1256
                        ChangeSet current condenseChangesForClass:aClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1257
                    ].
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1258
                ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1259
            ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1260
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1261
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1262
        changedClasses do:[:eachClass |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1263
             eachClass changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1264
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1265
        Smalltalk changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1266
        self activityNotification:'... done'.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1267
    ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1268
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1269
    "Modified: / 07-02-2001 / 18:18:32 / ps"
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1270
    "Modified: / 15-10-2007 / 14:11:51 / cg"
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1271
!
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1272
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1273
checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge using:aSourceCodeManager
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1274
    "check-out a class from the source repository.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1275
     If askForRevision is false, check-out the newest version."
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1276
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1277
    |resources 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1278
     inChangeSet extensionMethods
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1279
     rev msg
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1280
     listHere listRep diffSet 
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1281
     changed onlyHere onlyInRep answer labels values singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1282
     changedClasses default |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1283
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1284
    listRep := self changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision using:aSourceCodeManager.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1285
    listRep isNil ifTrue:[ ^self ].
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1286
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1287
    resources := self classResources.
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1288
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1289
    self activityNotification:'generating diffSet...'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1290
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1291
    extensionMethods := OrderedCollection new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1292
    Smalltalk allClassesDo:[:aClass | |owner classPackage|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1293
        "/ individual methods ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1294
        aClass isMeta ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1295
            (aClass package ~= packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1296
                aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1297
                    "/ methods in this project ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1298
                    (mthd package = packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1299
                        "/ ... whose class is not in the ckechIn-set
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1300
                        extensionMethods add:mthd
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1301
                    ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1302
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1303
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1304
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1305
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1306
    listHere := ChangeSet forExistingMethods:extensionMethods.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1307
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1308
    inChangeSet := listRep contains:[:someChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1309
                            |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1310
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1311
                            someChange isMethodChange ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1312
                                cClass := someChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1313
                                cSel := someChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1314
                                ChangeSet current includesChangeForClass:cClass selector:cSel
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1315
                            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1316
                    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1317
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1318
    diffSet := listHere diffSetsAgainst:listRep.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1319
    changed := diffSet changed.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1320
    onlyHere := diffSet onlyInReceiver.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1321
    onlyInRep := diffSet onlyInArg.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1322
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1323
    labels := #('Cancel' 'Merge' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1324
    values := #(nil #merge #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1325
    default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1326
                    ifTrue:[3. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1327
                    ifFalse:[2. "i.e. merge"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1328
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1329
    msg := 'About to load extensions for ''%5''.\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1330
    onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1331
        msg := msg , 'The repositories version contains %1 extension method(s) which are not in your current image.\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1332
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1333
    onlyHere size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1334
        onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1335
            msg := msg , 'And there '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1336
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1337
            msg := msg , 'There '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1338
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1339
        msg := msg , 'are %2 extension methods in your current image, which are not in the repository.\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1340
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1341
    changed size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1342
        changed size == 1 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1343
            msg := msg , 'The ''%5''-method is different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1344
            singleChangeSelector := changed first first selector allBold
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1345
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1346
            msg := msg , '%3 methods are different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1347
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1348
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1349
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1350
    onlyHere isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1351
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1352
            (changed isEmpty) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1353
                listRep do:[:eachChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1354
                    eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1355
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1356
                ^ self
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1357
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1358
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1359
                msg := msg , '\Attention:\Load may undo any changes made to on of the extension methods (if any were made).'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1360
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1361
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1362
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1363
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1364
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1365
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1366
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1367
            changed isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1368
                msg := msg , '\Attention:\Load will load methods which are not present in the image.'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1369
                labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1370
                values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1371
                default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1372
                                ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1373
                                ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1374
            ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1375
                inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1376
                    msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1377
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1378
                msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1379
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1380
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1381
    ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1382
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1383
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1384
                msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made),'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1385
                msg := msg , '\and remove added methods which are not present in the repository version.'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1386
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1387
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1388
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1389
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1390
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1391
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1392
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1393
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1394
                msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1395
                msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1396
            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1397
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1398
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1399
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1400
    msg := msg bindWith:onlyInRep size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1401
               with:onlyHere size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1402
               with:changed size printString
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1403
               with:singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1404
               with:packageToCheckOut allBold.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1405
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1406
    answer := (Dialog confirmWithCancel:msg withCRs
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1407
           labels:(resources array:labels)
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1408
           values:values 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1409
           default:default).
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1410
    answer isNil ifTrue:[^ self].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1411
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1412
    self activityNotification:'updating...'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1413
    changedClasses := IdentitySet new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1414
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1415
"/    Class withoutUpdatingChangesDo:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1416
        onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1417
                                     Class withoutUpdatingChangeSetDo:[ eachChange apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1418
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1419
                                     eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1420
                                     changedClasses add:eachChange changeClass.   
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1421
                     ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1422
        answer == #load ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1423
            onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1424
                                         |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1425
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1426
                                         cClass := eachChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1427
                                         cSel := eachChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1428
                                         Class withoutUpdatingChangeSetDo:[ cClass removeSelector:cSel ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1429
                        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1430
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1431
                                         |cHere cRep| 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1432
                                         cHere := eachChangeArr at:1.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1433
                                         cRep := eachChangeArr at:2.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1434
                                         Class withoutUpdatingChangeSetDo:[ cRep apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1435
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1436
                                         cRep changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1437
                                         changedClasses add:cRep changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1438
                       ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1439
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1440
"/    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1441
    changedClasses do:[:eachClass |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1442
         eachClass changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1443
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1444
    Smalltalk changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1445
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1446
    "Modified: / 07-02-2001 / 18:18:32 / ps"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1447
    "Created: / 10-08-2006 / 18:57:30 / cg"
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1448
    "Modified: / 09-10-2006 / 13:06:43 / cg"
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1449
!
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1450
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1451
compareClassWithRepository:aClass
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1452
    "open a diff-textView comparing the current (in-image) version
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1453
     against its orgiginal version found in the repository."
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1454
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1455
    self compareClassWithRepository:aClass askForRevision:true
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1456
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1457
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1458
      self compareClassWithRepository:Array
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1459
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1460
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1461
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1462
compareClassWithRepository:aClass askForRevision:askForRevision
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1463
    "open a diff-textView comparing the current (in-image) version
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1464
     against its orgiginal version found in the repository."
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1465
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1466
    |classToCompare resources brwsr
1194
d60b2ed25f45 Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 1193
diff changeset
  1467
     aStream comparedSource currentSource rev revString thisRevString mgr
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1468
     nm msg revisionInClass newestRev versionsAreTheSame|
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1469
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1470
    resources := self classResources.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1471
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1472
    classToCompare := aClass theNonMetaclass.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1473
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1474
    nm := classToCompare name.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1475
    mgr := self sourceCodeManagerFor:classToCompare.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1476
    mgr isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1477
        ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1478
    ].
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1479
    rev := classToCompare binaryRevision.
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1480
    revisionInClass := classToCompare revision.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1481
    rev isNil ifTrue:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1482
        rev := revisionInClass
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1483
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1484
    rev isNil ifTrue:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1485
        (Dialog confirm:'Class seems to be not yet in the repository (or classes revision info is corrupted)\\Proceed ?' withCRs)
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1486
        ifFalse:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1487
            ^ self
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1488
        ]
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1489
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1490
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1491
    "/
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1492
    "/ class in repository - ask for revision
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1493
    "/
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1494
    newestRev := mgr newestRevisionOf:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1495
    askForRevision ifTrue:[
1466
82e4152d5e9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1462
diff changeset
  1496
        msg := resources string:'Compare to revision: (empty for newest)'.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1497
        rev notNil ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1498
            msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1499
                                           with:nm allBold with:rev).
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1500
            (revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1501
                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1502
                                               with:revisionInClass)
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1503
            ]
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1504
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1505
        newestRev notNil ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1506
            msg := msg , '\' , (resources string:'Newest in reporitory is %1.'
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1507
                                           with:newestRev)
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1508
        ].
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1509
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1510
        rev := SourceCodeManagerUtilities
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1511
                    askForExistingRevision:msg 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1512
                    title:'Compare with repository' 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1513
                    class:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1514
    ] ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1515
        rev := newestRev.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1516
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1517
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1518
    rev notNil ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1519
        rev withoutSpaces isEmpty ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1520
            msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1521
            "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1522
            aStream := mgr getSourceStreamFor:classToCompare revision:newestRev.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1523
            revString := '(newest: ' , (newestRev ? '???') , ')'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1524
        ] ifFalse:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1525
            msg := 'extracting previous %1'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1526
            aStream := mgr getSourceStreamFor:classToCompare revision:rev.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1527
            revString := rev
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1528
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1529
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1530
        aStream isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1531
            self warn:'could not extract source from repository'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1532
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1533
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1534
        aStream class readErrorSignal handle:[:ex |
1245
1c6076979aa7 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 1210
diff changeset
  1535
            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
  1536
            aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1537
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1538
        ] do:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1539
            comparedSource := aStream contents asString.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1540
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1541
        aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1542
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1543
        self activityNotification:'generating current source...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1544
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1545
        currentSource := self sourceCodeOfClass:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1546
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1547
        self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1548
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1549
        versionsAreTheSame := false.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1550
        comparedSource = currentSource ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1551
            versionsAreTheSame := true.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1552
        ] ifFalse:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1553
            thisRevString := revisionInClass ? 'no revision'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1554
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1555
            revString = '(newest)' ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1556
                (rev := mgr newestRevisionOf:classToCompare) notNil ifTrue:[
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1557
                    revString := '(newest is ' , rev , ')'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1558
                ]
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1559
            ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1560
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1561
            self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1562
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1563
            brwsr := (UserPreferences versionDiffViewerClass)
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1564
                  openOnClass:classToCompare
1877
fdd260c2e11a compare package
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
  1565
                  labelA:('Repository: ' , revString)
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1566
                  sourceA:comparedSource
1877
fdd260c2e11a compare package
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
  1567
                  labelB:('Current: (based on: ' , thisRevString , ')')
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1568
                  sourceB:currentSource
1877
fdd260c2e11a compare package
Claus Gittinger <cg@exept.de>
parents: 1875
diff changeset
  1569
                  title:('Comparing ' , classToCompare name)
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1570
                  ifSame:[versionsAreTheSame := true].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1571
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1572
            versionsAreTheSame ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1573
                brwsr classChangeSet 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1574
                    classBeingCompared:classToCompare;
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1575
                    versionA:rev;
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1576
                    versionB:rev , 'mod'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1577
            ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1578
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1579
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1580
        versionsAreTheSame ifTrue:[
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  1581
            (classToCompare hasUnsavedChanges) ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1582
                (self confirm:(resources 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1583
                                stringWithCRs:'Versions of %1 are identical.\\Remove entries from changeSet ?'
1864
0a1a62489122 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1841
diff changeset
  1584
                                with:classToCompare name allBold)) ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1585
                    ChangeSet current condenseChangesForClass:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1586
                ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1587
            ] ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1588
                self information:'Versions are identical.'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1589
                ChangeSet current unrememberChangedClasses.
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1590
            ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1591
            revisionInClass isNil ifTrue:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1592
                (Dialog confirm:'Update (Fix) the classes Revision Info ?' withCRs)
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1593
                ifTrue:[
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1594
                    |newString root|
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1595
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1596
                    newString := mgr updatedRevisionStringOf:aClass forRevision:rev with:aClass revisionString.
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1597
                    newString isNil ifTrue:[
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1598
                        root := mgr getCVSROOTForModule:(aClass package upTo:$:).
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1599
                        root := mgr repositoryTopDirectoryFromCVSRoot:root.
1500
70a48e2f5921 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1600
                        newString := '$', 'Header: ',(root copyReplaceAll: $: with:$/ ),'/'
1911
d4088b5ba0ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
  1601
                                     ,(Smalltalk fileNameForClass:aClass),'.st,v ',rev,' '
2006
11622f51f754 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
  1602
                                     ,(Date today printStringFormat:'%y-%m-%d'),' '
11622f51f754 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
  1603
                                     ,(Time now printStringFormat:'%h:%m:%s'),' '
11622f51f754 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
  1604
                                     ,'+0000 '
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1605
                                     ,(OperatingSystem getLoginName),' Exp $'.
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1606
                    ].
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1607
                    CVSSourceCodeManager updateVersionMethodOf:aClass for:newString.
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1608
                ]
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1609
            ].
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1610
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1611
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1612
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1613
    "
997
c55b39b6c7a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1614
      self compareClassWithRepository:Array
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1615
    "
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  1616
1911
d4088b5ba0ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
  1617
    "Modified: / 20-11-2006 / 22:26:54 / cg"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1618
!
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1619
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1620
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1621
    |diffSet|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1622
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1623
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest.
1875
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  1624
    VersionDiffBrowser 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  1625
        openOnDiffSet:diffSet 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  1626
        labelA:'Repository' 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  1627
        labelB:'Image' 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  1628
        title:('Differences of %1' bindWith:aProject).
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1629
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1630
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1631
compareProjectWithRepository:aProject
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1632
    ^ self compareProject:aProject withRepositoryVersionFrom:nil
1875
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  1633
!
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  1634
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1635
createSourceContainerForClass:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1636
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1637
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1638
    |resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1639
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1640
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1641
    ^ self 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1642
        defineSourceContainerForClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1643
        title:(resources string:'Repository information for %1' with:aClass name)
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1644
        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
  1645
        createDirectories:true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1646
        createContainer:true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1647
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1648
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1649
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
  1650
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1651
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1652
    | className
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  1653
     "oldModule oldPackage" oldFileName
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1654
     module directory fileName nameSpace nameSpacePrefix
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1655
     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
  1656
     answer doCheckinWithoutAsking forceCheckIn resources rslt note
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1657
     requiredPackage|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1658
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  1659
    resources := self classResources.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1660
    aClass isLoaded ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1661
        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
  1662
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1663
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1664
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1665
    className := aClass name.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1666
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1667
    aClass isProjectDefinition ifTrue:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1668
        "/ no way - their package is already known and fix.
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1669
        module := aClass module.
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1670
        directory := aClass moduleDirectory.
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1671
    ] ifFalse:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1672
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1673
        "/ defaults, if nothing at all is known
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1674
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1675
        (module := LastModule) isNil ifTrue:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1676
            module := (OperatingSystem getLoginName).
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1677
        ].
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1678
        (directory := LastPackage) isNil ifTrue:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1679
            directory := 'private'.
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1680
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1681
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1682
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1683
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1684
    "/ 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
  1685
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1686
    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1687
        directory isNil ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1688
            (nm := project repositoryDirectory) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1689
                nm := project name
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1690
            ].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1691
            directory := nm.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1692
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1693
        module isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1694
            (nm := project repositoryModule) notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1695
                module := nm
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1696
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1697
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1698
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1699
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1700
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1701
    "/ 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
  1702
    "/ if so, take that as a default.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1703
    "/
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1704
    mgr := self sourceCodeManagerFor:aClass.
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1705
    mgr isNil ifTrue:[
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1706
        ^  false
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1707
    ].
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1708
1368
20cde03a3cd6 defineSource - fixed package & module extraction
martin
parents: 1347
diff changeset
  1709
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1710
    info := mgr sourceInfoOfClass:aClass.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1711
    info notNil ifTrue:[
1368
20cde03a3cd6 defineSource - fixed package & module extraction
martin
parents: 1347
diff changeset
  1712
        true "module ~= LastModule" ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1713
            (info includesKey:#module) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1714
                module := (info at:#module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1715
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1716
        ].
1401
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1717
"/        true "package ~= LastPackage" ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1718
"/            (info includesKey:#directory) ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1719
"/                package := (info at:#directory).
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1720
"/            ].
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  1721
"/        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1722
        fileName := mgr containerFromSourceInfo:info.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1723
        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1724
            nameSpacePrefix := nameSpace name , '::'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1725
            (fileName startsWith:nameSpacePrefix) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1726
                fileName := fileName copyFrom:(nameSpacePrefix size + 1).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1727
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1728
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1729
"/        (info includesKey:#fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1730
"/            fileName := (info at:#fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1731
"/        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1732
"/            (info includesKey:#expectedFileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1733
"/                fileName := (info at:#expectedFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1734
"/            ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1735
"/                (info includesKey:#classFileNameBase) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1736
"/                    fileName := (info at:#classFileNameBase) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1737
"/                ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1738
"/            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1739
"/        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1740
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1741
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1742
    fileName isNil ifTrue:[
1338
bad5961fbff1 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 1323
diff changeset
  1743
        fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1744
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1745
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1746
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1747
        module replaceAll:$\ with:$/.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1748
        directory replaceAll:$\ with:$/.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1749
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1750
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1751
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1752
    "/ 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
  1753
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1754
    doCheckinWithoutAsking := false.
1831
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1755
"/false ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1756
"/    (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1757
"/        answer := Dialog confirmWithCancel:(resources 
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1758
"/                            string:'About to change the source container.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1759
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1760
"/Notice: there is a container for %1 in:
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1761
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1762
"/    %2 / %3 / %4
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1763
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1764
"/Do you want to change it or check right into that container ?'
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1765
"/                            with:className
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1766
"/                            with:module
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1767
"/                            with:directory
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1768
"/                            with:fileName)
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1769
"/                labels:(resources array:#('Cancel' 'Check in' 'Change')).
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1770
"/        answer isNil ifTrue:[AbortSignal raise].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1771
"/        answer ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1772
"/            doCheckinWithoutAsking := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1773
"/            oldModule := module.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1774
"/            oldPackage := directory.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1775
"/            oldFileName := fileName
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1776
"/        ] ifFalse:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1777
"/            doCheckinWithoutAsking := true.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1778
"/            creatingNew := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1779
"/        ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1780
"/    ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  1781
"/].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1782
    doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1783
        "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1784
        "/ open a dialog for this
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1785
        "/
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1786
        (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1787
            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
  1788
            creatingNew := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1789
        ] ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1790
            creatingNew := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1791
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1792
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1793
        rslt := self 
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1794
                askForContainer:boxText title:title note:note
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1795
                initialModule:module initialPackage:directory initialFileName:fileName
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1796
                forNewContainer:true.        
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1797
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1798
        rslt isNil ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1799
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1800
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1801
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1802
        module := rslt at:#module.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1803
        directory := rslt at:#package.
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1804
        fileName := rslt at:#fileName.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1805
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1806
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1807
    (fileName endsWith:',v') ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1808
        fileName := fileName copyWithoutLast:2
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1809
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1810
    (fileName endsWith:'.st') ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1811
        fileName := fileName , '.st'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1812
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1813
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1814
    "/ 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
  1815
    "/ check for this ...
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1816
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1817
    requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol.
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1818
    requiredPackage ~= aClass package ifTrue:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1819
"/        doCheckinWithoutAsking ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1820
"/            (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
  1821
"/            ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1822
"/                ^ false
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1823
"/            ]
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1824
"/        ].
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  1825
        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
  1826
        aClass package:requiredPackage.
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1827
    ].
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1828
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1829
    info := aClass revisionInfo.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1830
    info notNil ifTrue:[
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  1831
        (info repositoryPathName isNil) ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1832
            info := nil
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  1833
        ].
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  1834
"/        (info includesKey:#repositoryPathName) ifFalse:[
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  1835
"/            info := nil
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  1836
"/        ]
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1837
    ].
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1838
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1839
    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
  1840
        true "doCheckinWithoutAsking" ifFalse:[
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1841
            answer := Dialog 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1842
                 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
  1843
                 labels:(resources array:#( 'Cancel' 'No' 'Yes')).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1844
            answer isNil ifTrue:[^ false].
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1845
        ] ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1846
            answer := true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1847
        ].
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1848
        answer ifTrue:[
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1849
            CVSSourceCodeManager 
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1850
                        updateVersionMethodOf:aClass 
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1851
                        for:(mgr initialRevisionStringFor:aClass 
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1852
                                               inModule:module 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1853
                                               directory:directory 
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1854
                                               container:fileName).
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1855
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1856
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1857
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1858
    (self checkForExistingModule:module using:mgr allowCreate:(createDirs or:[creatingNew]))
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1859
    ifFalse:[^ false].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1860
    LastModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1861
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1862
    (self checkForExistingModule:module directory:directory using:mgr allowCreate:(createDirs or:[creatingNew]))
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1863
    ifFalse:[^ false].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1864
    LastPackage := directory.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1865
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1866
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1867
    "/ check for the container itself
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1868
    "/
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1869
    (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1870
        creatingNew ifTrue:[
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1871
            self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:directory) withCRs.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1872
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1873
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1874
"/            (oldModule notNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1875
"/            and:[(oldModule ~= module)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1876
"/                 or:[oldPackage ~= package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1877
"/                 or:[oldFileName ~= fileName]]])
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1878
"/            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1879
"/                self warn:(resources string:'no change').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1880
"/                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1881
"/            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1882
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1883
        doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1884
            (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1885
                confirm:(resources string:'check %1 into the existing container
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1886
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1887
    %2 / %3 / %4  ?'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1888
                                with:className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1889
                                with:module 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1890
                                with:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1891
                                with:fileName) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1892
                noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1893
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1894
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1895
            ].  
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1896
        ].  
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1897
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1898
        CVSSourceCodeManager 
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1899
                        updateVersionMethodOf:aClass 
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  1900
                        for:('$' , 'Header' , '$'). "/ concatenated to avoid RCS-expansion
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1901
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1902
        oldFileName notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1903
            msg := ('forced checkin / source container change from ' , oldFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1904
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1905
            msg := 'defined source container'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1906
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1907
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1908
        (forceCheckIn := doCheckinWithoutAsking) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1909
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1910
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1911
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1912
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1913
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1914
                logMessage:msg)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1915
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1916
                doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1917
                    (Dialog 
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1918
                        confirm:'No easy merge seems possible; force checkin (no merge) ?'
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1919
                        noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1920
                    ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1921
                        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1922
                    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1923
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1924
                forceCheckIn := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1925
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1926
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1927
        forceCheckIn ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1928
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1929
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1930
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1931
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1932
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1933
                logMessage:msg
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1934
                force:true)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1935
            ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1936
                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
  1937
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1938
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1939
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1940
        ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1941
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1942
        (createContainer or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1943
            (Dialog
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1944
                 confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1945
                                      with:fileName with:module with:directory) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1946
                 noLabel:'Cancel') ifFalse:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1947
                ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1948
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1949
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1950
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1951
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  1952
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage].
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  1953
    aClass package:requiredPackage.
1913
d87c1ed5bf1f oops - halt
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1954
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1955
    (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1956
            createContainerFor:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1957
            inModule:module
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1958
            package:directory
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1959
            container:fileName) ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1960
        self warn:(resources string:'Failed to create container.').
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1961
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1962
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1963
    ^ true
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  1964
1913
d87c1ed5bf1f oops - halt
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1965
    "Modified: / 21-11-2006 / 17:35:02 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1966
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1967
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1968
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1969
    |classesInImage filesInImage module directory perProjectInfo 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1970
     classesNotInRepository filesNotInImage classesDeletedInRepository
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1971
     classesModifiedInImage classesNotReallyModified classesReallyModified classesModifiedInRepository 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1972
     classesAddedInImage extensionMethods extensionsInImage extensionsInRepository extensionDiffs
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1973
     box doCleanup resources diffSet def autoloadedFilesNotInImage 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1974
     autoloadedClassesInImage autoloadedFilesInImage|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1975
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1976
    resources := self classResources.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1977
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1978
    module := aProject asPackageId module.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1979
    directory := aProject asPackageId directory.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1980
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1981
    perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilForNewest.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1982
    perProjectInfo := perProjectInfo ? #().
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1983
    perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1984
    perProjectInfo := Dictionary withAssociations:perProjectInfo.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1985
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1986
    classesInImage := Smalltalk allClassesInPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1987
    autoloadedClassesInImage := classesInImage reject:[:cls | cls isLoaded].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1988
    classesInImage := classesInImage select:[:cls | cls isLoaded].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1989
    classesInImage := classesInImage reject:[:cls | cls isPrivate].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1990
    filesInImage := (classesInImage collect:[:cls | cls classBaseFilename]) asSet.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1991
    autoloadedFilesInImage := (autoloadedClassesInImage collect:[:cls | cls classBaseFilename]) asSet.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1992
    "/ any differences ?
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1993
    classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1994
    classesDeletedInRepository := classesInImage select:[:cls | (perProjectInfo at:cls classBaseFilename ifAbsent:nil) == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1995
    perProjectInfo := perProjectInfo reject:[:v | v == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1996
    filesNotInImage := perProjectInfo keys reject:[:file | (filesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1997
    filesNotInImage := filesNotInImage reject:[:file | (autoloadedFilesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1998
    filesNotInImage remove:'extensions.st' ifAbsent:[].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1999
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2000
    "/ if comparing against the newest, only look for chaged stuff
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2001
    classesModifiedInImage := classesInImage select:[:cls | ChangeSet current includesChangeForClassOrMetaclass:cls].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2002
    classesModifiedInImage := classesModifiedInImage \ classesNotInRepository.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2003
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2004
    classesModifiedInRepository := classesInImage select:[:cls | |v|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2005
                                                    v := (perProjectInfo at:cls classBaseFilename ifAbsent:nil).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2006
                                                    v notNil and:[ cls isLoaded and:[ v > cls revision ]]].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2007
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2008
    "/ stupid: as we do not have any revision information for extensions (sigh);
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2009
    "/ we must checkout and look at the extension.st contents, to see if it has changed.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2010
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2011
    extensionMethods := Smalltalk allExtensionsForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2012
    extensionsInImage := ChangeSet forExistingMethods:extensionMethods.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2013
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2014
    [
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2015
        |s extensionsRevision|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2016
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2017
        extensionsRevision := perProjectInfo at:'extensions.st' ifAbsent:#newest.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2018
        s := SourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2019
                streamForClass:nil fileName:'extensions.st' revision:extensionsRevision 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2020
                directory:directory module:module cache:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2021
        s isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2022
            extensionsInRepository := ChangeSet new.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2023
        ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2024
            extensionsInRepository := ChangeSet fromStream:s.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2025
            s close.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2026
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2027
    ] value.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2028
    extensionDiffs := extensionsInRepository diffSetsAgainst:extensionsInImage.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2029
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2030
    diffSet := extensionDiffs copy.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2031
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2032
    aDateOrNilForNewest isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2033
        "/ we could do the same as above for each class.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2034
        "/ however - as we do have change-info and revision info, we can avoid checking out
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2035
        "/ for all classes which are not changed and which have the same version info.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2036
        classesModifiedInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2037
            classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2038
                classesModifiedInImage select:[:eachChangedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2039
                    |currentVersion repositoryVersion s stFile diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2040
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2041
                    stFile := eachChangedClass classBaseFilename.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2042
                    s := SourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2043
                        streamForClass:nil fileName:stFile revision:#newest 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2044
                        directory:directory module:module cache:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2045
                    repositoryVersion := ChangeSet fromStream:s.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2046
                    s close.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2047
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2048
                    currentVersion := ChangeSet forExistingClass:eachChangedClass.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2049
                    diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2050
                    diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2051
                    diffs notEmpty
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2052
                ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2053
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2054
            classesNotReallyModified := classesModifiedInImage \ classesReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2055
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2056
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2057
        classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2058
            classesInImage select:[:eachClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2059
                |currentVersion repositoryVersion s stFile stRevision diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2060
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2061
                stFile := eachClass classBaseFilename.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2062
                stRevision := perProjectInfo at:stFile ifAbsent:#newest.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2063
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2064
                s := SourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2065
                        streamForClass:nil fileName:stFile revision:stRevision 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2066
                        directory:directory module:module cache:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2067
                repositoryVersion := ChangeSet fromStream:s.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2068
                s close.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2069
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2070
                currentVersion := ChangeSet forExistingClass:eachClass.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2071
                diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2072
                diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2073
                diffs notEmpty
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2074
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2075
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2076
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2077
    filesNotInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2078
        "/ first, check if these are autoloaded classes which have NOT been installed
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2079
        "/ (for example, due to a --quick argument during startup)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2080
        autoloadedFilesNotInImage := OrderedCollection new.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2081
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2082
        def := ProjectDefinition definitionClassForPackage:aProject createIfAbsent:false projectType:nil.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2083
        def notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2084
            def classNamesAndAttributesDo:[:eachClassname :eachAttributes | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2085
                |cls eachFileName isAutoload|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2086
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2087
                cls := Smalltalk classNamed:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2088
                cls isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2089
                    isAutoload := eachAttributes includes:#autoload.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2090
                    isAutoload ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2091
                        eachFileName := Smalltalk fileNameForClass:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2092
                        autoloadedFilesNotInImage add:(eachFileName , '.st')
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2093
                    ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2094
                ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2095
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2096
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2097
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2098
        (filesNotInImage \ autoloadedFilesNotInImage) do:[:eachSTFile |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2099
            |s chgSet classDefinitions|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2100
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2101
            s := SourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2102
                streamForClass:nil fileName:eachSTFile revision:#newest directory:directory module:module cache:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2103
            chgSet := ChangeSet fromStream:s.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2104
            s close.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2105
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2106
            diffSet onlyInReceiver addAll:chgSet
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2107
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2108
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2109
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2110
    classesModifiedInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2111
        classesModifiedInRepository do:[:eachClass|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2112
            |s diffs repositoryVersion currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2113
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2114
            s := SourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2115
                streamForClass:eachClass fileName:nil revision:#newest directory:directory module:module cache:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2116
            repositoryVersion := ChangeSet fromStream:s.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2117
            s close.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2118
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2119
            currentVersion := ChangeSet forExistingClass:eachClass.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2120
            diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2121
            diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2122
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2123
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2124
    classesDeletedInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2125
"/ self halt.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2126
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2127
    classesNotInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2128
        "/ if there are no changeSet entries for those classes, they seem to be
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2129
        "/ no longer in the repository (possibly moved ?)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2130
        "/ If there are entries, these might have been added in the image and need a check-in
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2131
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2132
        classesAddedInImage := classesNotInRepository \ classesDeletedInRepository.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2133
        classesAddedInImage do:[:eachAddedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2134
            |currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2135
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2136
            currentVersion := ChangeSet forExistingClass:eachAddedClass.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2137
            diffSet onlyInArg addAll:currentVersion.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2138
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2139
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2140
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2141
    diffSet isEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2142
        "/ Dialog information:(resources string:'%1 is up-to-date.' with:eachProject allBold).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2143
        Transcript showCR:('%1 is up-to-date.' bindWith:aProject allBold).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2144
        (ChangeSet current includesChangeForPackage:aProject) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2145
            (Dialog confirm:('%1 is up-to-date.\\Cleanup ChangeSet ?' bindWith:aProject allBold) withCRs) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2146
                ChangeSet current condenseChangesForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2147
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2148
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2149
        ^ self.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2150
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2151
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2152
    "/ as a side-effect, if we find that some classes are modified but the same as in the repository,
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2153
    "/ give user a chance to cleanup the changeSet here.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2154
    aDateOrNilForNewest isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2155
        classesNotReallyModified notEmptyOrNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2156
            doCleanup := false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2157
            box := Dialog
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2158
                forRequestText:(resources 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2159
                                    stringWithCRs:'The following classes from %1 are equal to the repository version.\\Remove entries from the changeSet ?'
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2160
                                    with:aProject allBold) 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2161
                editViewClass:ListView
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2162
                lines:10 columns:20 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2163
                initialAnswer:nil model:nil
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2164
                setupWith:
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2165
                   [:v :d | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2166
                            |removeButton|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2167
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2168
                            v list:classesNotReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2169
                            removeButton := Button label:(resources string:'Cleanup ChangeSet').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2170
                            removeButton action:[ doCleanup := true. box okPressed. ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2171
                            d addButton:removeButton after:(d okButton).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2172
                            d okButton label:(resources string:'Continue').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2173
                            d okButton isReturnButton:false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2174
                            removeButton isReturnButton:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2175
                   ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2176
            box open.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2177
            box accepted ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2178
                ^ self
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2179
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2180
            doCleanup ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2181
                classesNotReallyModified do:[:class |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2182
                    ChangeSet current condenseChangesForClass:class.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2183
                ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2184
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2185
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2186
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2187
    ^ diffSet
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2188
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2189
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2190
removeSourceContainerForClass:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2191
    "show container & let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2192
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2193
    ^ self removeSourceContainerForClass:aClass confirm:true warn:true
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2194
!
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2195
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2196
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2197
    "show container & optionally let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2198
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2199
    |module directory fileName info mgr resources|
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2200
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2201
    resources := self classResources.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2202
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2203
    aClass isLoaded ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2204
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2205
            self warn:(resources string:'Please load the class first.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2206
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2207
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2208
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2209
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2210
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2211
    "/ 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
  2212
    "/ if so, take that as a default.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2213
    "/
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2214
    mgr := self sourceCodeManagerFor:aClass.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2215
    mgr isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2216
        ^ false
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2217
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2218
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2219
    info := mgr sourceInfoOfClass:aClass.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2220
    info notNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2221
        (info includesKey:#module) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2222
            module := (info at:#module).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2223
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2224
        (info includesKey:#directory) ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2225
            directory := (info at:#directory).
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2226
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2227
        fileName := mgr containerFromSourceInfo:info.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2228
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2229
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2230
    module isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2231
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2232
            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
  2233
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2234
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2235
    ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2236
    directory isNil ifTrue:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2237
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2238
            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
  2239
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2240
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2241
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2242
    fileName isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2243
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2244
            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
  2245
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2246
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2247
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2248
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2249
    OperatingSystem isMSDOSlike ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2250
        "cvs expects unix-filenames"
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2251
        module := module copy replaceAll:$\ with:$/.
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2252
        directory := directory copy replaceAll:$\ with:$/.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2253
    ].
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  2254
    (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2255
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2256
            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
  2257
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2258
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2259
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2260
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2261
    doConfirm ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2262
        (Dialog
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2263
            choose:(resources 
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2264
                        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
  2265
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2266
container:    %2 / %3 / %4
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2267
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2268
Really remove ?' 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2269
                        with:aClass name 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2270
                        with:module 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2271
                        with:directory 
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2272
                        with:fileName) 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2273
            labels:(Array 
1129
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  2274
                        with:(resources string:'No') 
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  2275
                        with:(resources string:'Remove'))
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2276
            values:#(false true)
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2277
            default:false) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2278
            ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2279
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2280
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2281
1921
ab2e300fbc9c oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  2282
    (mgr removeContainer:fileName
ab2e300fbc9c oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  2283
                inModule:module
ab2e300fbc9c oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  2284
               directory:directory) ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2285
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2286
            self warn:(resources string:'failed to remove container.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2287
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2288
        ^ true.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2289
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2290
    ^ false
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2291
1921
ab2e300fbc9c oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  2292
    "Modified: / 05-12-2006 / 18:40:16 / cg"
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2293
!
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2294
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2295
repositoryLogOf:aClass onto:aStream
2050
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2296
    self repositoryLogOf:aClass short:false onto:aStream
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2297
!
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2298
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2299
repositoryLogOf:aClass short:shortOrNot onto:aStream
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2300
    |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
  2301
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2302
    info := aClass revisionInfo.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2303
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2304
    rv := aClass binaryRevision.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2305
    rv notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2306
        aStream nextPutLine:'**** Loaded classes binary information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2307
        aStream nextPutLine:'  Binary based upon : ' , rv.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2308
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2309
    ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2310
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2311
    info notNil ifTrue:[
2041
fb85bf748dbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  2312
        (info revision notNil) ifFalse:[
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2313
            aStream nextPutLine:'WARNING:'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2314
            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
  2315
            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
  2316
            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
  2317
            aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2318
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2319
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2320
        aStream nextPutLine:'**** Classes source information ****'; cr.
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2321
        s := info repositoryPathName.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2322
        s notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2323
            aStream nextPutLine:'  Source repository : ' , s
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2324
        ].
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2325
        aStream nextPutLine:'  Filename ........ : ' , (info fileName ? '?').
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2326
        aStream nextPutLine:'  Revision ........ : ' , (info revision ? '?').
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2327
        aStream nextPutLine:'  Checkin date .... : ' , (info date  ? '?') , ' ' , 
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2328
                                                       (info time ? '?'), ' ', 
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2329
                                                       (info timezone ? '').
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2330
        aStream nextPutLine:'  Checkin user .... : ' , (info user ? '?').
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2331
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2332
        (info2 := aClass packageSourceCodeInfo) notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2333
            aStream nextPutLine:'  Repository: ..... : ' , (info2 at:#module ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2334
            aStream nextPutLine:'  Directory: ...... : ' , (info2 at:#directory ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2335
        ].
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2336
        aStream nextPutLine:'  Container ....... : ' , (info repositoryPathName ? '?').
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2337
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2338
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2339
        mgr := self sourceCodeManagerFor:aClass.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2340
        mgr notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2341
            aStream nextPutLine:'**** Repository information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2342
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2343
            module := info2 at:#module ifAbsent:nil.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2344
            module notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2345
                aStream nextPutLine:('  CVS Root ......: ' , 
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2346
                                    ((mgr repositoryNameForModule:module) ifNil:[mgr repositoryName , ' (default)'])).
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2347
            ].
2050
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2348
            mgr writeRevisionLogOf:aClass short:shortOrNot to:aStream.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2349
        ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2350
    ] ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2351
        aStream nextPutLine:'No revision info found'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2352
        aClass isLoaded ifFalse:[
1835
1aa531a386bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1831
diff changeset
  2353
            aStream cr; nextPutAll:'This is an autoloaded class - you may see more after it is loaded.'
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2354
        ] ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2355
            fn := aClass classFilename.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2356
            aClass wasAutoloaded ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2357
                msg := 'This class was autoloaded.'.
1514
35b125098412 *** empty log message ***
fm
parents: 1503
diff changeset
  2358
                msg := msg , ' (from ''' , fn , ''')'.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2359
            ] ifFalse:[
1514
35b125098412 *** empty log message ***
fm
parents: 1503
diff changeset
  2360
                msg := 'This class was loaded from ''' , fn , '''.'
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2361
            ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2362
            msg notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2363
                aStream cr; nextPutAll:msg.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2364
            ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2365
        ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2366
    ]
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2367
1835
1aa531a386bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1831
diff changeset
  2368
    "Modified: / 06-10-2006 / 13:25:22 / cg"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2369
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2370
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2371
tagClass:aClass as:tag
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2372
    |mgr|
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2373
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2374
    mgr := self sourceCodeManagerFor:aClass.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2375
    mgr
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2376
        setSymbolicName:tag 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2377
        revision:nil 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2378
        overWrite:true 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2379
        class:aClass.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2380
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2381
    "Modified: / 12-09-2006 / 13:03:59 / cg"
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2382
!
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2383
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2384
tagClasses:aCollectionOfClasses as:tag
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2385
    |classesPerManager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2386
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2387
    classesPerManager := Dictionary new.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2388
    aCollectionOfClasses 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2389
        do:[:eachClass | 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2390
            |manager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2391
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2392
            manager := self sourceCodeManagerFor:eachClass.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2393
            (classesPerManager at:manager ifAbsentPut:[Set new]) add:eachClass
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2394
        ].
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2395
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2396
    classesPerManager keysAndValuesDo:[:manager :classesPerManager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2397
        manager
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2398
            setSymbolicName:tag 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2399
            revision:nil 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2400
            overWrite:true 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2401
            classes:classesPerManager.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2402
    ].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2403
    ^ true
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2404
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2405
    "Created: / 12-09-2006 / 13:04:29 / cg"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2406
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2407
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2408
tagPath:aPath as:tag using:aManager
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2409
    aManager 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2410
        setSymbolicName:tag 
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2411
        revision:nil 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2412
        overWrite:true 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  2413
        path:aPath.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2414
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2415
    "Modified: / 12-09-2006 / 12:04:44 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2416
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2417
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2418
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-helpers'!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2419
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2420
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2421
    "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
  2422
     Return a dictionary associating revision with a changeList entries for that method.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2423
     Unfinished - need a GUI for that."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2424
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2425
    |mgr theClass revisionLog revisions items s entriesPerRevision previousVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2426
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2427
    theClass := aClass theNonMetaclass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2428
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2429
    mgr := self sourceCodeManagerFor:theClass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2430
    mgr isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2431
        self error:'no sourceCodeManager'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2432
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2433
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2434
    revisionLog := mgr
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2435
                        revisionLogOf:theClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2436
                        numberOfRevisions:numberOfRevisionsOrNil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2437
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2438
    revisions := revisionLog at:#revisions.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2439
    items := revisions collect:[:each | |rev date who|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2440
                                    rev := each at:#revision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2441
                                    date := each at:#date.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2442
                                    who := each at:#author.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2443
                                    rev allBold , ' [' , date , ' by ' , who , ']'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2444
                               ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2445
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2446
    revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2447
    revisions addFirst:#current.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2448
    entriesPerRevision := Dictionary new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2449
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2450
    previousVersion := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2451
    revisions reverseDo:[:eachRevision |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2452
        |srcStream entries thisVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2453
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2454
        eachRevision == #current ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2455
            s := '' writeStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2456
            theClass fileOutOn:s withTimeStamp:false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2457
            srcStream := s contents readStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2458
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2459
            self activityNotification:('checking out revision ' , eachRevision , '...').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2460
            srcStream := mgr getSourceStreamFor:theClass revision:eachRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2461
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2462
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2463
        entries := ChangeSet fromStream:srcStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2464
        srcStream close.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2465
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2466
        "/ remove all definitions       
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2467
        entries := entries select:[:each | each isMethodChange].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2468
        "/ remove all methods which are for other selectors      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2469
        entries := entries select:[:each | each selector == selector].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2470
        "/ remove all methods which are for private subclasses      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2471
        entries := entries select:[:each | each className = aClass name].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2472
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2473
        entries size == 1 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2474
            "/ the method is there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2475
            thisVersion := entries first.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2476
            (previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2477
                "/ no change
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2478
            ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2479
                entriesPerRevision at:eachRevision put:thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2480
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2481
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2482
            "/ the method is not there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2483
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2484
        previousVersion := thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2485
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2486
    self error:'unfinished code'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2487
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2488
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2489
     self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2490
     self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2491
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2492
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2493
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2494
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-user interaction'!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2495
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2496
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2497
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2498
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2499
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2500
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2501
    ^ self
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2502
        askForContainer:boxText title:title note:notice 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2503
        initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2504
        forNewContainer:true
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2505
!
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2506
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2507
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
  2508
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2509
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2510
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2511
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2512
    |box y component resources answer
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2513
     moduleHolder packageHolder fileNameHolder
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2514
     module package fileName 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2515
     knownContainers knownPackages packageUpdater
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2516
     packageBoxComponent fileNameBoxComponent fileNameUpdater|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2517
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2518
    knownContainers := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2519
    Smalltalk allClassesDo:[:cls | |pckg|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2520
        pckg := cls package.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2521
        pckg size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2522
            knownContainers add:(pckg upTo:$:)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2523
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2524
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2525
    knownContainers := knownContainers asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2526
    knownContainers := knownContainers select:[:module | module isBlank not].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2527
    knownContainers sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2528
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2529
    packageUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2530
        |theModulePrefix|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2531
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2532
        theModulePrefix := moduleHolder value , ':'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2533
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2534
        Cursor wait showWhile:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2535
            knownPackages := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2536
            Smalltalk allClassesDo:[:cls | |pckg idx|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2537
                pckg := cls package.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2538
                pckg size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2539
                    (pckg startsWith:theModulePrefix) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2540
                        idx := pckg indexOf:$:.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2541
                        knownPackages add:(pckg copyFrom:idx + 1)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2542
                    ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2543
                ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2544
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2545
            knownPackages := knownPackages asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2546
            knownPackages := knownPackages select:[:package | package isBlank not].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2547
            knownPackages sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2548
            packageBoxComponent list:knownPackages.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2549
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2550
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2551
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2552
    fileNameUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2553
        |module package files|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2554
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2555
        Cursor read showWhile:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  2556
            module := moduleHolder value ? (PackageId noProjectID).
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  2557
            package := packageHolder value ? (PackageId noProjectID).
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2558
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2559
            files := SourceCodeManager getExistingContainersInModule:module directory:package.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2560
            files := files asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2561
            files := files select:[:eachFile | eachFile asFilename hasSuffix:'st'].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2562
            files sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2563
            fileNameBoxComponent list:files.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2564
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2565
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2566
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2567
    moduleHolder := initialModule asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2568
    packageHolder := initialPackage asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2569
    fileNameHolder := initialFileName asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2570
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2571
    resources := self classResources.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2572
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2573
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2574
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2575
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2576
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2577
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2578
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2579
    component := box addTextLabel:boxText withCRs.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2580
    component adjust:#left; borderWidth:0.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2581
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2582
    box addVerticalSpace.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2583
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2584
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2585
    component := box addTextLabel:(resources string:'Module:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2586
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2587
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2588
    component := box addComboBoxOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2589
    component list:knownContainers.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2590
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2591
"/    component := box addInputFieldOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2592
    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
  2593
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2594
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2595
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2596
    component := box addTextLabel:(resources string:'Package:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2597
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2598
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2599
    packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2600
"/    component := box addInputFieldOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2601
    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
  2602
    packageUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2603
    moduleHolder onChangeEvaluate:packageUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2604
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2605
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2606
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2607
    component := box addTextLabel:(resources string:'Filename:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2608
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2609
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2610
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2611
    forNewContainer ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2612
        component := box addInputFieldOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2613
        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
  2614
    ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2615
        fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2616
        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
  2617
        fileNameUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2618
        packageHolder onChangeEvaluate:fileNameUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2619
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2620
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2621
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2622
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2623
    notice notNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2624
        component := box addTextLabel:notice.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2625
        component adjust:#left; borderWidth:0.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2626
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2627
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2628
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2629
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2630
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2631
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2632
        component := Button label:'Yes to all'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2633
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2634
                            YesToAllNotification queryWith:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2635
                            box doAccept.
2253
7d7b0d2d1fe7 changed: #askForContainer:title:note:initialModule:initialPackage:initialFileName:forNewContainer:
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  2636
                            box okPressed.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2637
                         ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2638
        (DialogBox defaultOKButtonAtLeft) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2639
            box addButton:component after:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2640
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2641
            box addButton:component before:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2642
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2643
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2644
    (AbortAllSignal isHandled) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2645
        component := Button label:'Cancel all'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2646
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2647
                            box hide.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2648
                            AbortAllSignal raiseSignal.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2649
                         ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2650
        (DialogBox defaultOKButtonAtLeft) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2651
            box addButton:component before:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2652
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2653
            box addButton:component after:nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2654
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2655
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2656
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2657
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2658
        answer := YesToAllQuery query.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2659
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2660
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2661
    answer isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2662
        box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2663
        answer := box accepted
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2664
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2665
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2666
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2667
    answer ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2668
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2669
    ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2670
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2671
    module := moduleHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2672
    package := packageHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2673
    fileName := fileNameHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2674
    ^ Dictionary new
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2675
        at:#module put:module;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2676
        at:#package put:package;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2677
        at:#fileName put:fileName;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2678
        yourself
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2679
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2680
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2681
     self 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2682
        askForContainer:'enter container' title:'container' note:'some note'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2683
        initialModule:'foo' initialPackage:'bar' initialFileName:'baz'        
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2684
    "
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2685
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2686
    "Modified: / 23-08-2006 / 14:13:04 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2687
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2688
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2689
askForExistingRevision:boxText title:title class:aClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2690
    "open a dialog asking for a containers revision;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2691
     return a revision number, or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2692
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2693
    |mgr sourceInfo module package fileName|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2694
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2695
    mgr := self sourceCodeManagerFor:aClass.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2696
    sourceInfo := mgr sourceInfoOfClass:aClass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2697
    sourceInfo isNil ifTrue:[^ nil].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2698
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2699
    package := mgr directoryFromSourceInfo:sourceInfo.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2700
    module := mgr moduleFromSourceInfo:sourceInfo.  
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2701
    fileName := mgr containerFromSourceInfo:sourceInfo.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2702
    ^ self
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2703
        askForExistingRevision:boxText 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2704
        title:title 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2705
        class:aClass 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2706
        manager:mgr 
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  2707
        module:module package:package 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  2708
        fileName:fileName
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2709
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2710
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2711
     SourceCodeManagerUtilities
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2712
        askForRevisionToCompare:'enter revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2713
        title:'revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2714
        class:Array
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2715
    "
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2716
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2717
    "Modified: / 12-09-2006 / 14:17:04 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2718
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2719
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2720
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:directory fileName:fileName
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2721
    "open a dialog asking for a containers revision;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2722
     return a revision number, or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2723
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2724
    |partialLog revisions items newestRev
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2725
     box y component resources 
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2726
     revisionHolder symbolicNames stableRevision releasedRevision|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2727
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2728
    partialLog := aSourceCodeManager
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2729
        revisionLogOf:clsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2730
        numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2731
        fileName:fileName
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2732
        directory:directory 
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2733
        module:module.
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2734
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2735
    partialLog notNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2736
        newestRev := partialLog at:#newestRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2737
        revisions := partialLog at:#revisions.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2738
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2739
        symbolicNames notNil ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2740
            stableRevision := symbolicNames at:'stable' ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2741
            releasedRevision := symbolicNames at:'released' ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2742
        ].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2743
            
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2744
        items := revisions collect:[:each | |rev date who flag|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2745
                                        rev := each at:#revision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2746
                                        date := each at:#date.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2747
                                        who := each at:#author.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2748
                                        rev = stableRevision ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2749
                                            flag := ' Stable' allBold.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2750
                                        ] ifFalse:[rev = releasedRevision ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2751
                                            flag := ' Released' allBold.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2752
                                        ] ifFalse:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2753
                                            flag := ' '
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2754
                                        ]].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2755
                                        rev allBold , flag, ' [' , date , ' by ' , who , ']'
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2756
                                   ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2757
        revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2758
    ] ifFalse:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2759
        newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2760
        revisions := items := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2761
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2762
        newestRev isNil ifTrue:[
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  2763
            (aSourceCodeManager checkForExistingContainer:fileName inModule:module directory:directory)
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2764
            ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2765
                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
  2766
This could be due to:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2767
    - invalid/wrong CVS-Root setting
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2768
    - missing CVS access rights
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2769
        (no access / not logged in)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2770
    - changed CVSRoot after compilation
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2771
        (i.e. wrong CVS-path in classes version method)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2772
'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2773
                ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2774
            ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2775
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2776
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2777
    revisionHolder  := newestRev asValue.
1377
0fd99dd003f6 classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2778
    resources := self classResources.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2779
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2780
    revisionHolder onChangeEvaluate:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2781
        "/ cut off everything after revision
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2782
        |s first words|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2783
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2784
        s := revisionHolder value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2785
        words := s asCollectionOfWords.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2786
        words size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2787
            first := words first string.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2788
            first ~= s ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2789
                revisionHolder value:first
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2790
            ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2791
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2792
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2793
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2794
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2795
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2796
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2797
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2798
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2799
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2800
    component := box addTextLabel:boxText withCRs.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2801
    component adjust:#left; borderWidth:0.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2802
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2803
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2804
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2805
    y := box yPosition.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2806
    component := box addTextLabel:(resources string:'Revision:').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2807
    component width:0.4; adjust:#right.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2808
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2809
    component := box addComboBoxOn:revisionHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2810
    component list:items.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2811
    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
  2812
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2813
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2814
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2815
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2816
1964
8137bfb6a7ea AbortSignal->AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 1955
diff changeset
  2817
    AbortAllOperationRequest isHandled ifTrue:[
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2818
        (box addAbortButtonLabelled:'Cancel all') action:[AbortAllSignal raise].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2819
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2820
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2821
    box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2822
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2823
    box accepted ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2824
        box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2825
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2826
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2827
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2828
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2829
    ^ revisionHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2830
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2831
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2832
     SourceCodeManagerUtilities
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2833
        askForRevisionToCompare:'enter revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2834
        title:'revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2835
        class:nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2836
        manager:SourceCodeManager 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2837
        module:'stx'
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2838
        directory:'libbasic'
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2839
        fileName:'Array.st'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2840
    "
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2841
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  2842
    "Modified: / 13-09-2006 / 18:24:46 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2843
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2844
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2845
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2846
    "check if a class contains message-sends to:
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2847
        #halt , #halt:
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2848
        #error
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2849
        #todo , #todo:
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2850
        (and maybe more in the future)
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2851
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2852
     Only checks in non-extension methods - as this is only called when checking "
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2853
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2854
    |badStuff whatIsBad msg answer labels values defaultAnswer dontShowAgain
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2855
     methodsWithBadStuff resources|
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2856
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2857
    resources := Dialog classResources.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2858
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2859
    badStuff := #(
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2860
        ( halt         'send of #halt (use for debugging only) - better use #error:''some message'' or #breakPoint:')
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2861
        ( halt:        'send of #halt: (use for debugging only) - better use #error: or #breakPoint:')
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2862
        ( error        'send of #error without descriptive message - better use #error:''some message''' )
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2863
        ( todo         'send of #todo - unfinished code present?' )
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2864
        ( todo:        'send of #todo:- unfinished code present?' )
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2865
    ).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2866
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2867
    methodsWithBadStuff := Set new.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2868
    whatIsBad := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2869
    aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2870
        |setOfLiterals setOfSentMessages|
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2871
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2872
        mthd package = aClass package ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2873
            setOfLiterals := mthd literals.  "/ try without parsing first.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2874
            (badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2875
                setOfSentMessages := mthd messagesSent.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2876
                badStuff do:[:eachEntry | 
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2877
                    (setOfSentMessages includes:eachEntry first) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2878
                        whatIsBad add:eachEntry second.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2879
                        methodsWithBadStuff add:mthd.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2880
                    ]
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  2881
                ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2882
            ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2883
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2884
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2885
    whatIsBad isEmpty ifTrue:[^ true].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2886
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2887
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2888
        answer := YesToAllQuery query.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2889
        answer notNil ifTrue:[ ^ answer ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2890
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2891
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2892
    msg := resources string:'%1 contains the following (considered bad style) message sends:' with:aClass name.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2893
    msg := msg , '\\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2894
    whatIsBad do:[:each |
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2895
        msg := msg , '   ' , each , '\'
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2896
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2897
    msg := msg , '\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2898
    methodsWithBadStuff size == 1 ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2899
        msg := msg , (resources string:'In %1.' 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2900
                        with:methodsWithBadStuff anElement whoString allBold).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2901
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2902
        msg := msg , (resources string:'In %1 and %2 other methods.' 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2903
                        with:methodsWithBadStuff anElement whoString allBold 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2904
                        with:methodsWithBadStuff size-1).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2905
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2906
    msg := msg , '\\' , (resources string:'Do you really want to checkIn the %1 class ?' with:aClass name).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2907
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2908
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2909
        labels := #('Cancel All' 'Cancel' 'No to All' 'No' 'No, Browse' 'Yes to All' 'Yes') "#('Yes' 'Yes to All' 'No' 'No to All' 'Cancel')".
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2910
        values := #(#cancelAll nil #noToAll #noBrowse false #yesToAll true) "#(true #yesToAll false #noToAll nil)".
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2911
        defaultAnswer := #yesToAll.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2912
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2913
        labels := #('No' 'No, Browse' 'Yes').
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2914
        values := #(false #noBrowse true).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2915
        defaultAnswer := true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2916
    ].
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2917
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  2918
"/        AbortAllOperationRequest isHandled ifTrue:[
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2919
"/            labels := #('Cancel All') , labels.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2920
"/            values := #(#cancelAll) , values.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2921
"/        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2922
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2923
    DialogBox aboutToOpenBoxNotificationSignal handle:[:ex |
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2924
        |box|
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2925
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2926
        checkAgainHolder isValueModel ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2927
            dontShowAgain := checkAgainHolder value not asValue.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2928
            box := ex parameter.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  2929
            box addCheckBox:(resources string:'Do not show this Dialog again (reenable in Launcher).')
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  2930
                on:dontShowAgain.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  2931
        ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2932
        ex proceed.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2933
    ] do:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2934
        answer := OptionBox 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2935
                      request:msg withCRs
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2936
                      label:(resources string:'Really CheckIn ?')
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2937
                      image:(InfoBox iconBitmap)
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2938
                      buttonLabels:(resources array:labels)
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2939
                      values:values
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2940
                      default:defaultAnswer
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2941
                      onCancel:nil.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2942
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2943
    answer isNil ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2944
        AbortSignal raise.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2945
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2946
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2947
    dontShowAgain notNil ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2948
        checkAgainHolder value:dontShowAgain value not 
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2949
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2950
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2951
    answer == #noBrowse ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2952
        UserPreferences browserClass browseMethods:methodsWithBadStuff title:'Methods with Bad Stuff'.
1995
f832f7ec6ccf Don't use possibly uninitialized class variable
Stefan Vogel <sv@exept.de>
parents: 1994
diff changeset
  2953
        self yesToAllNotification queryWith:false.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2954
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2955
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2956
    answer == #cancelAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2957
        AbortAllSignal raise.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2958
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2959
    answer == #yesToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2960
        YesToAllNotification queryWith:true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2961
        ^ true
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2962
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2963
    answer == #noToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2964
        YesToAllNotification queryWith:false.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2965
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2966
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2967
    ^ answer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2968
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2969
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2970
     self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities)  
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  2971
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2972
!
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2973
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  2974
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2975
    "get a log message for checking in a class.
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2976
     Return the message or nil if aborted."
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2977
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2978
    ^ self
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  2979
        getCheckinInfoFor:aClassNameOrPackageNameString 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2980
        initialAnswer:initialAnswerOrNil
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2981
        withQuickOption:false
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2982
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2983
    "
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2984
     SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2985
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  2986
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2987
    "Modified: / 22-06-2006 / 12:49:30 / cg"
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2988
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2989
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  2990
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  2991
    "get a log message for checking in a class (plus checkinQuick state info).
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  2992
     Return the info-object (actually: the dialog) or nil if aborted."
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  2993
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  2994
    |logMsg infoDialog|
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  2995
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  2996
    infoDialog := Tools::CheckinInfoDialog 
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  2997
                getCheckinInfoFor:aClassNameOrPackageNameString 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2998
                initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage)
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2999
                withQuickOption:withQuickOption.
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3000
    infoDialog notNil ifTrue:[
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3001
        logMsg := infoDialog logMessage.
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3002
        logMsg notNil ifTrue:[
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3003
            LastSourceLogMessage := logMsg
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3004
        ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3005
    ].
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3006
    ^ infoDialog
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3007
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3008
    "
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3009
     SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla'
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3010
    "
1501
6bb154127b0f CheckInDialog class moved
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
  3011
6bb154127b0f CheckInDialog class moved
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
  3012
    "Modified: / 22-06-2006 / 12:49:30 / cg"
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3013
!
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3014
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3015
goodInitialLogMessageForCheckinClassOfClass:aClass
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3016
    "figure out, if there were any non-comment changes. 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3017
     Provide a reasonable initial log message (I am tired of typing in 'comment only')"
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3018
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3019
    |selectorsInChangeSet newSelectors modifiedSelectors
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3020
     classChanges changesForThisClass definitionChangesForThisClass methodChangesForThisClass 
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3021
     allMethodChangesForThisClass modifiedMethodsForThisClass newMethodsForThisClass removedMethodsForThisClass
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3022
     initialLogStream printSelectors selectorsWithCommentOrFormattingChangeOnly
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3023
     selectorsWithVariableChangeOnly 
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3024
     removedSelectors categoryChanges categoryChangeSelectors|
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3025
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3026
    "/ a helper function
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3027
    printSelectors := 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3028
        [:what :selectors |
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3029
            initialLogStream 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3030
                nextPutAll:(what,':').
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3031
            selectors size < 5 ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3032
                selectors size == 1 ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3033
                    initialLogStream 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3034
                        print: ' #';
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3035
                        print: (selectors first);
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3036
                        cr.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3037
                ] ifFalse:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3038
                    initialLogStream cr.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3039
                    selectors asSortedCollection do:[:sel | initialLogStream tab; nextPutAll:'#'; nextPutLine:sel].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3040
                ]
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3041
            ] ifFalse:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3042
                initialLogStream 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3043
                    print: (selectors size);
2142
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3044
                    print: ' methods';
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3045
                    cr.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3046
            ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3047
        ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3048
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3049
    classChanges := ChangeSet current 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3050
                                select:[:aChange | aChange isClassChange].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3051
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3052
    changesForThisClass := classChanges 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3053
                                select:[:aChange | aChange className = aClass theNonMetaclass name
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3054
                                                   or:[aChange className = aClass theMetaclass name] ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3055
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3056
    definitionChangesForThisClass := changesForThisClass 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3057
                                select:[:aChange | aChange isMethodChange not].
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3058
    categoryChanges := changesForThisClass 
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3059
                                select:[:aChange | aChange isMethodCategoryChange]. 
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3060
    categoryChangeSelectors := categoryChanges collect:[:aChange | aChange changeSelector] as:Set.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3061
    allMethodChangesForThisClass := changesForThisClass 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3062
                                select:[:aChange | aChange isMethodCodeChange].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3063
    selectorsInChangeSet := allMethodChangesForThisClass collect:[:aChange | aChange changeSelector] as:Set.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3064
    methodChangesForThisClass := selectorsInChangeSet collect:[:eachSelector |
2161
c1d39e2f7115 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
  3065
                                        allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector]] as:OrderedCollection.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3066
                                            
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3067
    modifiedMethodsForThisClass := methodChangesForThisClass 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3068
                                select:[:aChange | aChange previousVersion notNil].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3069
    modifiedSelectors := modifiedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3070
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3071
    newMethodsForThisClass := allMethodChangesForThisClass 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3072
                                select:[:aChange | aChange previousVersion isNil].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3073
    newSelectors := newMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3074
    
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3075
    removedMethodsForThisClass := allMethodChangesForThisClass 
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3076
                                select:[:aChange | aChange isMethodRemoveChange].
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3077
    removedSelectors := removedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3078
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3079
    initialLogStream := '' writeStream.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3080
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3081
    definitionChangesForThisClass isEmpty ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3082
        "/ only method changes
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3083
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3084
        newSelectors notEmpty ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3085
            printSelectors value:'added' value:newSelectors.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3086
        ].
2137
959f73592bc7 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  3087
        modifiedSelectors removeAllFoundIn:newSelectors.
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3088
        categoryChangeSelectors removeAllFoundIn:newSelectors.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3089
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3090
        modifiedSelectors notEmpty ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3091
            selectorsWithCommentOrFormattingChangeOnly := Set new.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3092
            selectorsWithVariableChangeOnly := Set new.
2142
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3093
            RBParser notNil ifTrue:[
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3094
                modifiedSelectors do:[:eachSelector |
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3095
                    |oldest newest oldMethod newMethod oldTree newTree variableMapping|
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3096
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3097
                    (newSelectors includes:eachSelector) ifFalse:[
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3098
                        oldest := allMethodChangesForThisClass detect:[:change | change changeSelector = eachSelector].
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3099
                        newest := allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector].
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3100
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3101
                        oldest := oldest previousVersion notNil ifTrue:[oldest previousVersion] ifFalse:[oldest].
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3102
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3103
                        oldTree := RBParser parseMethod:oldest source onError:[:aString :pos | nil].
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3104
                        newTree := RBParser parseMethod:newest source onError:[:aString :pos | nil].
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3105
                        (oldTree notNil and:[newTree notNil]) ifTrue:[
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3106
                            variableMapping := Dictionary new.
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3107
                            (oldTree equalTo:newTree withMapping: variableMapping) ifTrue:[
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3108
                                (variableMapping at:'self' ifAbsent:nil) = 'self' ifTrue:[
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3109
                                    ((variableMapping associations count:[:assoc | assoc key ~= assoc value]) == 0) ifTrue:[
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3110
                                        selectorsWithCommentOrFormattingChangeOnly add:eachSelector.
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3111
                                    ] ifFalse:[
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3112
                                        selectorsWithVariableChangeOnly add:eachSelector.
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3113
                                    ].
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3114
                                ].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3115
                            ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3116
                        ].
2142
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3117
                    ]
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3118
                ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3119
            ].
2137
959f73592bc7 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  3120
            modifiedSelectors removeAllFoundIn:selectorsWithCommentOrFormattingChangeOnly.
959f73592bc7 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  3121
            modifiedSelectors removeAllFoundIn:selectorsWithVariableChangeOnly.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3122
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3123
            (selectorsWithCommentOrFormattingChangeOnly notEmpty) ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3124
                printSelectors value:'comment/format in' value:selectorsWithCommentOrFormattingChangeOnly.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3125
            ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3126
            (selectorsWithVariableChangeOnly notEmpty) ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3127
                printSelectors value:'variable renamed in' value:selectorsWithVariableChangeOnly.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3128
            ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3129
            (modifiedSelectors notEmpty) ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3130
                printSelectors value:'changed' value:modifiedSelectors.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3131
            ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3132
        ].
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3133
        categoryChanges notEmpty ifTrue:[
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3134
            printSelectors value:'category of' value:categoryChangeSelectors.
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3135
        ].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3136
    ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3137
    ^ initialLogStream contents
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3138
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3139
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3140
!SourceCodeManagerUtilities class methodsFor:'utilities-encoding'!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3141
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3142
guessEncodingOfBuffer:buffer
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3143
    "look for a string of the form
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3144
            encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3145
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3146
            encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3147
     within the given buffer 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3148
     (which is usually the first few bytes of a textFile)."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3149
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3150
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3151
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3152
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3153
    ^ CharacterEncoder guessEncodingOfBuffer:buffer
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  3154
!
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  3155
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3156
guessEncodingOfFile:aFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3157
    "look for a string
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3158
        encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3159
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3160
        encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3161
     within the given buffer 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3162
     (which is usually the first few bytes of a textFile).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3163
     If thats not found, use heuristics (in CharacterArray) to guess."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3164
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3165
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3166
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3167
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3168
    ^ CharacterEncoder guessEncodingOfFile:aFilename
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3169
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3170
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3171
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3172
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3173
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3174
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3175
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3176
guessEncodingOfStream:aStream
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3177
    "look for a string of the form
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3178
            encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3179
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3180
            encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3181
     in the first few bytes of aStream."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3182
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3183
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3184
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3185
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3186
    ^ CharacterEncoder guessEncodingOfStream:aStream
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3187
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3188
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3189
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3190
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3191
version
2253
7d7b0d2d1fe7 changed: #askForContainer:title:note:initialModule:initialPackage:initialFileName:forNewContainer:
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  3192
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.200 2010-03-19 12:12:43 cg Exp $'
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  3193
!
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  3194
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  3195
version_CVS
2253
7d7b0d2d1fe7 changed: #askForContainer:title:note:initialModule:initialPackage:initialFileName:forNewContainer:
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  3196
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.200 2010-03-19 12:12:43 cg Exp $'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3197
! !