SourceCodeManagerUtilitiesForContainerBasedManagers.st
author Claus Gittinger <cg@exept.de>
Fri, 28 Nov 2014 17:09:01 +0100
changeset 3651 d58c178282c0
parent 3603 ef654acb24f8
child 3772 399ff1b46d41
permissions -rw-r--r--
class: SourceCodeManagerUtilitiesForContainerBasedManagers changed: #checkinPackage:classes:extensions:buildSupport:askForMethodsInOtherPackages: just a message string change
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2012 eXept Software AG
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
SourceCodeManagerUtilities subclass:#SourceCodeManagerUtilitiesForContainerBasedManagers
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-SourceCodeManagement'
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2012 eXept Software AG
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
! !
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!SourceCodeManagerUtilitiesForContainerBasedManagers methodsFor:'utilities-cvs'!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
    39
checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo
3573
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    40
    |anyFailure module directory mgr defClass|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    mgr := self sourceCodeManagerFor: packageID. 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    defClass := ProjectDefinition definitionClassForPackage: packageID.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
    45
    "/ already done elsewhere now
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
    46
    "/ defClass validateDescription.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    anyFailure := false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    module := packageID asPackageId module.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    directory := packageID asPackageId directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    self activityNotification:(resources string:'checking in build-support files...').
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    (mgr checkForExistingModule:module directory:directory) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        mgr createModule:module directory:directory
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    defClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        |realFileName realDirectory|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
        "/ care for subdirectories
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
        (fileName includes:$/) ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
            realDirectory := (directory asFilename construct:(fileName asFilename directoryName)) name.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
            realFileName := fileName asFilename baseName.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
        ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
            realDirectory := directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
            realFileName := fileName.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
        realDirectory := realDirectory replaceAll:$\ with:$/.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
        self activityNotification:(resources string:'checking in %1...' with:realFileName).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
        UserInformation
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
            handle:[:ex | Transcript showCR:ex description ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
            do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
                (mgr isContainerBased
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
    77
                 and:[(mgr checkForExistingContainer:realFileName inModule:module directory:realDirectory) not]
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
    78
                ) ifTrue:[
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
                    realDirectory ~= directory ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
                        (mgr checkForExistingModule:module directory:realDirectory) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
                            mgr createModule:module directory:realDirectory
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
                        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
                    ].
3573
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    84
                    [:exit |
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    85
                        |answer|
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    86
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    87
                        (mgr
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    88
                            createContainerForText:fileContents
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    89
                            inModule:module
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    90
                            package:realDirectory
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    91
                            container:realFileName) ifTrue:[ exit value:nil ].
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    92
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    93
                        answer := Dialog 
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    94
                            confirmWithCancel:(resources
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    95
                                    stringWithCRs:'Cannot create new container: ''%3'' (in %1:%2).\\Retry?'
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    96
                                    with:module
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    97
                                    with:realDirectory
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    98
                                    with:realFileName).
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    99
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   100
                         answer == nil ifTrue:[
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   101
                            AbortOperationRequest raise
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   102
                        ].
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   103
                        answer == false ifTrue:[ exit value:nil ].
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   104
                    ] loopWithExit.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
                    (mgr
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
                        checkin:realFileName
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
                        text:fileContents
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
                        directory:realDirectory
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
                        module:module
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   111
                        logMessage:checkinInfo logMessage
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   112
                        force:false
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   113
                    ) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   114
                        checkinInfo isStable ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   115
                            self tagPath:(module, '/', realDirectory, '/', realFileName) as:#stable usingManager:mgr.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   116
                        ].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   117
                        checkinInfo tagIt ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   118
                            self tagPath:(module, '/', realDirectory, '/', realFileName) as:checkinInfo tag usingManager:mgr.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   119
                        ].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   120
                    ] ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   121
                        Transcript showCR:'checkin of ' , realFileName , ' failed'.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   122
                        anyFailure := true.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   123
                    ].
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    defClass instAndClassMethodsDo:[:m | m package:defClass package].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
        checkinClasses:(Array with:defClass)
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   132
        withInfo:checkinInfo
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
        withCheck:false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    self activityNotification:nil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    anyFailure ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
        self warn:'Checkin failed - see Transcript.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        self activityNotification:'Checkin of build-support files failed - see Transcript.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
        self activityNotification:'Build-support files checked into the repository.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    "Created: / 09-08-2006 / 18:59:42 / fm"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    "Modified: / 12-10-2011 / 11:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    "Modified: / 25-07-2012 / 14:27:30 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    "Modified (format): / 25-07-2012 / 22:25:48 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    "checkin a projects extensions into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   155
    |logMessage checkinInfo mgr pri module directory containerFileName extensionsSource|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    "/ the following is wrong - must ask the projectDefinition !!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    aPackageID asPackageId projectDefinitionClass notNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
        mgr := self sourceCodeManagerFor:aPackageID asPackageId projectDefinitionClass.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
        mgr := self sourceCodeManagerFor:aCollectionOfMethods first mclass.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
    mgr isNil ifTrue:[ ^ false ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    module := aPackageID asPackageId module.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    directory := aPackageID asPackageId directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    containerFileName := self nameOfExtensionsContainer.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    aLogInfoOrStringOrNil isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
        checkinInfo := self getCheckinInfoFor:containerFileName allBold initialAnswer:nil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
        checkinInfo isNil ifTrue:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
        logMessage := checkinInfo logMessage.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
        aLogInfoOrStringOrNil isString ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
            logMessage := aLogInfoOrStringOrNil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
        ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
            checkinInfo := aLogInfoOrStringOrNil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
            logMessage := checkinInfo logMessage.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    (mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
        (self checkForExistingModule:module usingManager:mgr allowCreate:true) ifFalse:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
        LastModule := module.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
        (self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:true) ifFalse:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
        LastPackage := directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
        (self checkForExistingModule:module directory:directory container:containerFileName usingManager:mgr allowCreate:true) ifFalse:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    self activityNotification:(resources string:'Checking in %1' with:containerFileName).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    pri := Processor activePriority.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    Processor activeProcess 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
        withPriority:pri-1 to:pri
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
        do:[
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   197
            extensionsSource := self sourceCodeForExtensions:aCollectionOfMethods package:aPackageID forManager:mgr.
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   198
            "Care for non-ASCII/non-ISO-8859 characters in extension methods"
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   199
            extensionsSource isWideString ifTrue:[
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   200
                extensionsSource := '"{ Encoding: utf8 }"' , Character cr asString , Character cr asString , extensionsSource.                
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   201
                extensionsSource := extensionsSource utf8Encoded.
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   202
            ].
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
            UserInformation handle:[:ex |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
                Transcript showCR:ex description.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
                ex proceed.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
            ] do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
                Transcript showCR:('checking in ',containerFileName,' ...').
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
                (mgr 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
                    checkin:containerFileName
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   211
                    text:extensionsSource
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
                    directory:directory 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
                    module:module
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
                    logMessage:logMessage
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
                    force:false) 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
                ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
                    Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
                    self warn:'Checkin of ''' , containerFileName allBold , ''' failed'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
                    ^ false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
                checkinInfo notNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
                    |path|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
                    path := (module, '/', directory, '/', containerFileName).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
                    checkinInfo isStable ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
                        "set stable tag for class that has been checked in"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
                        self tagPath:path as:#stable usingManager:mgr.    
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
                    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
                    checkinInfo tagIt ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
                        "set an additional tag for class that has been checked in"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
                        self tagPath:path as:(checkinInfo tag) usingManager:mgr.    
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
                    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
                mgr postCheckInExtensionsForPackage:aPackageID    
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    ^ true
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
    "Modified: / 25-07-2012 / 18:38:40 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   243
    |mgr classesToCheckIn methodsToCheckIn methodsInPrjDef
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
     methodsInOtherPackages looseMethods otherPackages
3507
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   245
     msg classesInChangeSet newClasses checkinInfo originalCheckinInfo classesToTag
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   246
     answer|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
    mgr := self sourceCodeManagerFor: packageToCheckIn.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
    classesToCheckIn := IdentitySet new.
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   251
    classesInChangeSet := IdentitySet new.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
    methodsToCheckIn := IdentitySet new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
    methodsInOtherPackages := IdentitySet new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    looseMethods := IdentitySet new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   256
    "/ collect classes and individual methods...
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   257
    (doClasses or:[doExtensions]) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   258
        Smalltalk allClassesDo:[:aClass | 
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   259
            |owner classPackage|
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   260
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   261
            (owner := aClass owningClass) notNil ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   262
                classPackage := aClass topOwningClass package
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   263
            ] ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   264
                classPackage := aClass package
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   265
            ].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   266
            (classPackage = packageToCheckIn) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   267
                classesToCheckIn add:aClass.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   268
            ].
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   269
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   270
            doExtensions ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   271
                aClass isMeta ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   272
                    "/ ... whose class is not in the checkIn-set
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   273
                    (classesToCheckIn includes:aClass) ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   274
                        aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   275
                            "/ methods in this project ...
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   276
                            (mthd package = packageToCheckIn) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   277
                                methodsToCheckIn add:mthd
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   278
                            ]
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   279
                        ]
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   280
                    ].
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   281
                ].
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   282
            ].
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   283
        ].
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   284
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   285
        "/ cg: O(n^2) algorithm
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   286
        "/  classesInChangeSet := classesToCheckIn select:[:cls | cls hasUnsavedChanges].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   287
        "/ replaced by: O(n) algorithm
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   288
        classesInChangeSet := ChangeSet current selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:classesToCheckIn. 
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
    doExtensions ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
        methodsToCheckIn notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
            doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
                msg := '%1 classes (%4 changed) '.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
            ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
                msg := ''.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
            doExtensions ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
                doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
                    msg := msg , 'and '.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
                msg := msg , '%2 extensions '.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
            msg := msg , 'of project "%3"'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
            checkinInfo := self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
                        getCheckinInfoFor:(msg
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
                                                    bindWith:classesToCheckIn size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
                                                    with:methodsToCheckIn size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
                                                    with:packageToCheckIn allBold
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
                                                    with:classesInChangeSet size)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
                        initialAnswer:nil
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   313
                        withQuickOption:(classesToCheckIn size > 0)
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   314
                        withValidateConsistencyOption:true.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
            checkinInfo isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
                ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
            ].
3145
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   318
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   319
            checkinInfo validateConsistency ifTrue:[
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   320
                self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions.
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   321
                "/ could have changed/recompiled methods...
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   322
                "/ mhmh - should we checkin what is specified in the prj-def,
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   323
                "/ or what is actually present in the image (in case user did not repair)???
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   324
                
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   325
                methodsInPrjDef  := packageToCheckIn asPackageId projectDefinitionClass extensionMethods.
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   326
                methodsInPrjDef := methodsInPrjDef reject:[:m | m isNil].
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   327
                methodsInPrjDef asSet ~= methodsToCheckIn asSet ifTrue:[
3507
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   328
                    answer:= Dialog 
3651
d58c178282c0 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3603
diff changeset
   329
                        confirmWithCancel:('The set of methods in image is different from what is specified in the project definition.\You should probably make sure that all extension methods are all associated to the correct package.\\Check in image methods (%1) or definition methods (%2)?'
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   330
                                        bindWith: methodsToCheckIn size
3651
d58c178282c0 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3603
diff changeset
   331
                                        with: methodsInPrjDef size) withCRs
3507
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   332
                        labels:#('Image Methods' 'Definition Methods' 'Cancel') 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   333
                        values:#(true false nil) 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   334
                        default:nil.
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   335
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   336
"/                    answer := Dialog 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   337
"/                        confirm:('Set of methods in image is different from what is specified in the project definition.\Check in image methods (%1) or definition methods (%2)?'
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   338
"/                                        bindWith: methodsToCheckIn size
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   339
"/                                        with: methodsInPrjDef size)
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   340
"/                        yesLabel:'Image Methods' 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   341
"/                        noLabel:'Definition Methods'.
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   342
                    answer isNil ifTrue:[AbortOperationRequest raise].
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   343
                    answer ifFalse:[
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   344
                        methodsToCheckIn := methodsInPrjDef.
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   345
                    ].
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   346
                ].
3145
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   347
            ].
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   348
3250
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   349
            "/ also need the extensionVersion methods in the projectDefinition class,
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   350
            "/ which are kept in the extensions container. (the reason is that we need the proper
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   351
            "/ CVS id for the extensions container, not for the projDefinition container.
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   352
            packageToCheckIn asPackageId projectDefinitionClass theMetaclass selectorsAndMethodsDo:[:sel :mthd |
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   353
                (AbstractSourceCodeManager isExtensionsVersionMethodSelector:sel) ifTrue:[
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   354
                    methodsToCheckIn add:mthd
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   355
                ].
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   356
            ].
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   357
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
            (self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
                checkinExtensionMethods:methodsToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
                forPackage:packageToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
                withInfo:checkinInfo)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
            ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
                Dialog warn:(resources string:'Could not check in extensions for project %1' with:packageToCheckIn).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
                ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
        ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
            "/ there may have been extension-methods previously - if so, remove them
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
            (mgr
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
                checkForExistingContainer:'extensions.st' inPackage:packageToCheckIn)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
            ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
"/ self halt.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
                (self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
                    checkinExtensionMethods:#()
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
                    forPackage:packageToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
                    withInfo:'No extensions any more')
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
                ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
                    Dialog warn:(resources string:'Could not check in extensions for project %1' with:packageToCheckIn).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
                    ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
                ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
    checkinInfo isNil ifTrue:[
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   385
        |infoString|
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   386
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   387
        doExtensions ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   388
            infoString := '%1 classes (%4 changed) and %2 extensions for project "%3"'.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   389
        ] ifFalse:[doClasses ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   390
            infoString := '%1 classes (%4 changed) for project "%3"'.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   391
        ] ifFalse:[doBuild ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   392
            infoString := 'Build support files for project "%3"'.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   393
        ] ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   394
            infoString := 'I don''t know what I am doing'.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   395
        ]]].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   396
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   397
        infoString := infoString
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   398
                        bindWith:classesToCheckIn size
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   399
                        with:methodsToCheckIn size
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   400
                        with:packageToCheckIn allBold
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   401
                        with:classesInChangeSet size.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   402
    
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
        checkinInfo := self
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   404
                    getCheckinInfoFor:infoString
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
                    initialAnswer:nil
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   406
                    withQuickOption:(classesToCheckIn size > 0)
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   407
                    withValidateConsistencyOption:true.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
        checkinInfo isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
            ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
        ].
3145
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   411
        checkinInfo validateConsistency ifTrue:[
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   412
            self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions.
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   413
        ].
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   414
    ].
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   415
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
    checkinInfo quickCheckIn ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
        (checkinInfo isStable or:[checkinInfo tagIt]) ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
            classesToTag := classesToCheckIn.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
            originalCheckinInfo := checkinInfo.
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   420
            checkinInfo := checkinInfo deepCopy.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
            checkinInfo isStable:false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
            checkinInfo tag:nil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
        ].
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   424
        "/ not only the one's in the changeSet;
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   425
        "/ also those which have not been checked in before.
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   426
        newClasses := classesToCheckIn select:[:class | (class revisionOfManager:mgr) isNil ].
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   427
        classesToCheckIn := Set new 
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   428
                                addAll:classesInChangeSet; 
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   429
                                addAll:newClasses; 
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   430
                                yourself.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
    "/ check if any of the classes contains methods for other packages ...
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
    classesToCheckIn do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
        eachClass instAndClassMethodsDo:[:eachMethod |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
            |mPgk|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
            mPgk := eachMethod package.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
            (mPgk = packageToCheckIn) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
                mPgk == PackageId noProjectID ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
                    looseMethods add:eachMethod
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
                    methodsInOtherPackages add:eachMethod
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
                ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
    askForMethodsInOtherPackages ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
        methodsInOtherPackages notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
            otherPackages := Set new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
            methodsInOtherPackages do:[:eachMethod | otherPackages add:eachMethod package].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
            methodsInOtherPackages size == 1 ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
                msg := 'The ''%4'' method in ''%5'' is contained in the ''%2'' package.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
                msg := msg , '\\This method will remain in its package.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
            ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
                otherPackages size == 1 ifTrue:[
3651
d58c178282c0 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3603
diff changeset
   459
                    msg := 'The %1 methods from the %2 package will remain in their package.'
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
                    msg := 'The %1 methods from %3 other packages will remain in their packages.'
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
                msg := msg , '\\Hint: if these are meant to belong to this package,'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
                msg := msg , '\move them first, then repeat the checkin operation.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
            msg := msg withCRs.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
            msg := msg bindWith:methodsInOtherPackages size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
                           with:otherPackages first allBold
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
                           with:otherPackages size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
                           with:methodsInOtherPackages first selector allBold
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
                           with:methodsInOtherPackages first mclass name allBold.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
            (Dialog confirm:msg noLabel:(resources string:'Cancel')) ifFalse:[^ self].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
    doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
        classesToCheckIn notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
            looseMethods notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
                looseMethods size == 1 ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
                    msg := 'The ''%2'' method in ''%3'' is unassigned (loose).'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
                    msg := msg , '\\If you proceed, this method will be moved to the ''%4'' package'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
                    msg := msg , '\\Hint: if this is meant to be an extension of another package,'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
                    msg := msg , '\cancel and move it to the appropriate package first.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
                    msg := 'There are %1 unassigned (loose) methods in classes from this project.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   486
                    msg := msg , '\\If you proceed, those will be moved to the ''%4'' package ?'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   487
                    msg := msg , '\\Hint: if these are meant to be extensions of another package,'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
                    msg := msg , '\cancel and move them to the appropriate package first.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   489
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
                doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
                    msg := msg , '\\If you answer with "No" here, you will be asked for each class individually.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
                msg := msg withCRs.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
                msg := msg bindWith:looseMethods size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
                               with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first selector allBold])
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
                               with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first mclass name allBold])
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
                               with:packageToCheckIn allBold.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
                (Dialog confirm:msg noLabel:(resources string:'Cancel')) ifFalse:[^ self].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
                looseMethods do:[:mthd |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
                    mthd package:packageToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
            self checkinClasses:classesToCheckIn withInfo:checkinInfo.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
        originalCheckinInfo notNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
            originalCheckinInfo isStable ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
                classesToTag do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
                    self tagClass:eachClass as:#stable
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
            originalCheckinInfo tagIt ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
                classesToTag do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
                    self tagClass:eachClass as:(originalCheckinInfo tag)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
    doBuild ifTrue:[
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   522
        self checkinBuildSupportFilesForPackage:packageToCheckIn withInfo:(originalCheckinInfo ? checkinInfo).
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
    "Created: / 13-10-2011 / 11:15:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2906
b4c09eb4e63a method renamed for clarity
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   526
    "Modified: / 04-09-2012 / 14:05:36 / cg"
3537
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   527
!
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   528
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   529
comparePackages:packages askForRevision:askForRevision
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   530
    "Compares code of given packages (loaded in the image) against a specific revision
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   531
     and opens a diff browser on differences.
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   532
     
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   533
     If `askForRevision` is true, then user is asked to specify to which revision to
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   534
     update. If `askForRevision` is false, then packages are updated to a 'newest'
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   535
     revision.
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   536
     
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   537
     NOTE: Definition of `newest` revision may vary. For SCMs which allows for multiple
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   538
     heads, it is not clear which one it is. In that case, even if `askForRevision` is
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   539
     false, this method may result in user interation, asking user to select which of the
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   540
     newest she wants."
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   541
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   542
    |dateFormat string dateOrNil symbolicName|
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   543
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   544
    dateFormat := UserPreferences current dateInputFormat.
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   545
    string := Dialog
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   546
                request:(resources
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   547
                        string:'Compare with version from date (%1) or tag (any other format):'
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   548
                        with:dateFormat)
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   549
                initialAnswer:(Date today printStringFormat:dateFormat).
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   550
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   551
    string isEmptyOrNil ifTrue:[^ self].
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   552
    dateOrNil := Date readFrom:string printFormat:dateFormat onError:nil.
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   553
    dateOrNil isNil ifTrue:[
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   554
        symbolicName := string
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   555
    ].
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   556
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   557
    packages value do:[:eachProject |
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   558
        dateOrNil notNil ifTrue:[
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   559
            self compareProject:eachProject withRepositoryVersionFrom:dateOrNil
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   560
        ] ifFalse:[
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   561
            self compareProject:eachProject withRepositoryVersionTaggedAs:symbolicName
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   562
        ]
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   563
    ].
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   564
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   565
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   566
    "Created: / 04-04-2014 / 15:29:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
! !
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
version
3651
d58c178282c0 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3603
diff changeset
   572
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.23 2014-11-28 16:09:01 cg Exp $'
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
version_CVS
3651
d58c178282c0 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3603
diff changeset
   576
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.23 2014-11-28 16:09:01 cg Exp $'
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
! !
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   578