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