SourceCodeManagerUtilitiesForContainerBasedManagers.st
author Claus Gittinger <cg@exept.de>
Tue, 03 Jun 2014 11:04:25 +0200
changeset 3573 af8f051e0a8b
parent 3537 ee6b24d5f0f8
child 3603 ef654acb24f8
permissions -rw-r--r--
class: SourceCodeManagerUtilitiesForContainerBasedManagers changed: #checkinBuildSupportFilesForPackage:withInfo:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2012 eXept Software AG
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
SourceCodeManagerUtilities subclass:#SourceCodeManagerUtilitiesForContainerBasedManagers
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-SourceCodeManagement'
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2012 eXept Software AG
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
! !
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!SourceCodeManagerUtilitiesForContainerBasedManagers methodsFor:'utilities-cvs'!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
    39
checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo
3573
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    40
    |anyFailure module directory mgr defClass|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    mgr := self sourceCodeManagerFor: packageID. 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    defClass := ProjectDefinition definitionClassForPackage: packageID.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
    45
    "/ already done elsewhere now
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
    46
    "/ defClass validateDescription.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    anyFailure := false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    module := packageID asPackageId module.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    directory := packageID asPackageId directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    self activityNotification:(resources string:'checking in build-support files...').
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    (mgr checkForExistingModule:module directory:directory) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        mgr createModule:module directory:directory
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    defClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        |realFileName realDirectory|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
        "/ care for subdirectories
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
        (fileName includes:$/) ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
            realDirectory := (directory asFilename construct:(fileName asFilename directoryName)) name.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
            realFileName := fileName asFilename baseName.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
        ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
            realDirectory := directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
            realFileName := fileName.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
        realDirectory := realDirectory replaceAll:$\ with:$/.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
        self activityNotification:(resources string:'checking in %1...' with:realFileName).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
        UserInformation
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
            handle:[:ex | Transcript showCR:ex description ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
            do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
                (mgr isContainerBased
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
    77
                 and:[(mgr checkForExistingContainer:realFileName inModule:module directory:realDirectory) not]
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
    78
                ) ifTrue:[
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
                    realDirectory ~= directory ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
                        (mgr checkForExistingModule:module directory:realDirectory) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
                            mgr createModule:module directory:realDirectory
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
                        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
                    ].
3573
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    84
                    [:exit |
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    85
                        |answer|
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    86
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    87
                        (mgr
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    88
                            createContainerForText:fileContents
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    89
                            inModule:module
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    90
                            package:realDirectory
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    91
                            container:realFileName) ifTrue:[ exit value:nil ].
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    92
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    93
                        answer := Dialog 
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    94
                            confirmWithCancel:(resources
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    95
                                    stringWithCRs:'Cannot create new container: ''%3'' (in %1:%2).\\Retry?'
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    96
                                    with:module
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    97
                                    with:realDirectory
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    98
                                    with:realFileName).
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
    99
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   100
                         answer == nil ifTrue:[
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   101
                            AbortOperationRequest raise
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   102
                        ].
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   103
                        answer == false ifTrue:[ exit value:nil ].
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   104
                    ] loopWithExit.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
                    (mgr
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
                        checkin:realFileName
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
                        text:fileContents
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
                        directory:realDirectory
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
                        module:module
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   111
                        logMessage:checkinInfo logMessage
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   112
                        force:false
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   113
                    ) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   114
                        checkinInfo isStable ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   115
                            self tagPath:(module, '/', realDirectory, '/', realFileName) as:#stable usingManager:mgr.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   116
                        ].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   117
                        checkinInfo tagIt ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   118
                            self tagPath:(module, '/', realDirectory, '/', realFileName) as:checkinInfo tag usingManager:mgr.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   119
                        ].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   120
                    ] ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   121
                        Transcript showCR:'checkin of ' , realFileName , ' failed'.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   122
                        anyFailure := true.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   123
                    ].
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    defClass instAndClassMethodsDo:[:m | m package:defClass package].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
        checkinClasses:(Array with:defClass)
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   132
        withInfo:checkinInfo
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
        withCheck:false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    self activityNotification:nil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    anyFailure ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
        self warn:'Checkin failed - see Transcript.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        self activityNotification:'Checkin of build-support files failed - see Transcript.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
        self activityNotification:'Build-support files checked into the repository.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    "Created: / 09-08-2006 / 18:59:42 / fm"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    "Modified: / 12-10-2011 / 11:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    "Modified: / 25-07-2012 / 14:27:30 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    "Modified (format): / 25-07-2012 / 22:25:48 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
checkinClass:aClass
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    "check a class into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
     Asks interactively for a log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
    ^ self checkinClass:aClass withInfo:nil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
checkinClass:aClass withInfo:aLogInfoOrNil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    "check a class into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
     If the argument, aLogInfoOrNil isNil, ask interactively for a log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    ^ self checkinClass:aClass withInfo:aLogInfoOrNil withCheck:true
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    "check a class into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
     If doCheckClass is true, the class is checked for send of halts etc."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    ^ self 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
        checkinClass:aClass 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
        withInfo:aLogInfoOrNil 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
        withCheck:doCheckClass 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
        usingManager:(self sourceCodeManagerFor:aClass)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
    "Modified: / 21-12-2011 / 18:19:55 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   179
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClassHolder usingManager:managerOrNil
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    "check a class into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
     If doCheckClass is true, the class is checked for send of halts etc."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
2946
03a728bf5b2a changed:
Claus Gittinger <cg@exept.de>
parents: 2906
diff changeset
   184
    |logMessage checkinInfo mgr pri|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
    aClass isLoaded ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
        self information:(resources string:'Cannot checkin unloaded classes (%1)' with:aClass name).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
        ^ false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    mgr := managerOrNil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    mgr isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
        mgr := self sourceCodeManagerFor:aClass.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
        mgr isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
            ^ false
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
        ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    self ensureCorrectVersionMethodsInClass:aClass usingManager:mgr.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    mgr supportsCheckinLogMessages ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
        (self 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
            getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
            forClass:aClass
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
            valuesInto:[:logMessageRet :checkinInfoRet |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
                logMessage := logMessageRet.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
                checkinInfo := checkinInfoRet.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
        ) ifFalse:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    (self classIsNotYetInRepository:aClass withManager:mgr) ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
        (self createSourceContainerForClass:aClass usingManager:mgr) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
"/            self warn:'did not create a container for ''' , aClass name , ''''.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
            ^ false
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
        ^ true.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    self activityNotification:(resources string:'checking in %1' with:aClass name).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    pri := Processor activePriority.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
    Processor activeProcess withPriority:pri-1 to:pri
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
        |revision aborted freshCreated|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
        freshCreated := false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
        revision := aClass revision.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
        revision isNil ifTrue:[ 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
            mgr isContainerBased ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
                "/ mhmh - check if it has a container.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
                (mgr checkForExistingContainerForClass:aClass) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
                    (self createSourceContainerForClass:aClass usingManager:mgr) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
                        self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
                        ^ false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
                    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
                    freshCreated := true.
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
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   240
        doCheckClassHolder value ifTrue:[
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
            "/ check if the class contains halts, error-sends etc.
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   242
            (self checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:doCheckClassHolder) ifFalse:[
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
                ^ false
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
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
        freshCreated ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
            aborted := false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
            AbortOperationRequest handle:[:ex |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
                aborted := true.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
                ex return.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
            ] do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
                |checkinState cause|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
                checkinState := false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
                cause := ''.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
                [
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
                    checkinState := mgr checkinClass:aClass logMessage:logMessage
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
                ] on:SourceCodeManagerError do:[:ex| 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
                    cause := ex description.
3362
0ede9d87d347 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
   260
                    "/ ex proceed.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
                checkinState ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
                    Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
                    self warn:(resources stringWithCRs:'Checkin of "%1" failed\\' with:aClass name allBold),cause.
3362
0ede9d87d347 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
   266
                    AbortOperationRequest raise.
0ede9d87d347 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
   267
                    "/ ^ false.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
                checkinInfo notNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
                    checkinInfo isStable ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
                        "set stable tag for class that has been checked in"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
                        self tagClass:aClass as:#stable.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
                    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
                    checkinInfo tagIt ifTrue:[
3293
ef3fc480b979 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3262
diff changeset
   275
                        "set any additional tags for the class that has been checked in"
ef3fc480b979 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3262
diff changeset
   276
                        (checkinInfo tag asCollectionOfSubstringsSeparatedByAny:',;') do:[:eachTag |
ef3fc480b979 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3262
diff changeset
   277
                            self tagClass:aClass as:eachTag withoutSeparators.
3297
cfde0f21aecc class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3293
diff changeset
   278
                        ].
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
                    ].
3298
0d1ea2b38777 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3297
diff changeset
   280
                    CVSSourceCodeManager recentTag:checkinInfo tag.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
            aborted ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
                Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
                AbortAllOperationWantedQuery query ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
                    (Dialog 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
                        confirm:(resources stringWithCRs:'Checkin of "%1" aborted.\\Cancel all ?' with:aClass name)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
                        default:false)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
                    ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
                        AbortAllOperationRequest raise.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
                    ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
                ^ false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    ^ true
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    "Created: / 21-12-2011 / 18:19:14 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
checkinClasses:aCollectionOfClass
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
    "check a collection of classes into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
     Asks interactively for log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    ^ self checkinClasses:aCollectionOfClass withInfo:nil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
    "check a bunch of classes into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   314
    |checkClassWhenCheckingInHolder|
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   315
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   316
    checkClassWhenCheckingInHolder := ValueHolder with:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true).
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   317
    checkClassWhenCheckingInHolder 
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   318
        onChangeEvaluate:[ UserPreferences current at:#checkClassesWhenCheckingIn put:checkClassWhenCheckingInHolder value ].
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   319
2848
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
        checkinClasses:aCollectionOfClasses 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
        withInfo:aLogInfoOrNil 
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   323
        withCheck:checkClassWhenCheckingInHolder
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   326
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    "check a bunch of classes into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
     If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   330
    self checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder usingManager:nil
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
    "Modified: / 21-12-2011 / 18:24:47 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   335
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder usingManager:aManagerOrNil
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
    "check a bunch of classes into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
     If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
2946
03a728bf5b2a changed:
Claus Gittinger <cg@exept.de>
parents: 2906
diff changeset
   339
    |classes allClasses checkinInfoOrString yesOrNoToAll unchangedClasses|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
    "/ ignore private classes
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
    classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
    classes isEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
        self information:'Only private classes given - nothing checked in.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
        ^ self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
    classes := classes select:[:aClass | aClass isLoaded].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    classes isEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
        self information:'Only unloaded classes given - nothing checked in.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
        ^ self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
    classes size == 1 ifTrue:[
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   354
        ^ self checkinClass:classes first withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder usingManager:aManagerOrNil.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
    "ask once, for all classes"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
    aLogInfoOrStringNil isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
        checkinInfoOrString := self 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
                        getCheckinInfoFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
                        initialAnswer:nil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
                        withQuickOption:true.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
        checkinInfoOrString isNil ifTrue:[^ self].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
    ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
        checkinInfoOrString := aLogInfoOrStringNil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
    allClasses := classes.    
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
    checkinInfoOrString quickCheckIn ifTrue:[
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   370
        "/ not only the one's in the changeSet;
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   371
        "/ also those which have not been checked in before.
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   372
        classes := classes select:[:each | each hasUnsavedChanges or:[ (each revisionOfManager:aManagerOrNil) isNil ]].
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
        classes isEmpty ifTrue:[ Dialog information:'no changes to checkin (quickCheckIn)' ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
    "abortAll is handled, and also asked for here!!"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
    AbortAllOperationRequest handleAndAnswerQueryIn:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
        classes notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
            self yesToAllNotification handle:[:ex |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
                yesOrNoToAll := ex parameter.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
                ex proceed
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
            ] do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
                self yesToAllQuery handle:[:ex |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
                    ex proceedWith:yesOrNoToAll
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
                ] do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
                    classes do:[:aClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
                        self activityNotification:(resources string:'checking in %1' with:aClass name).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
                        "/ ca does not want boxes to pop up all over ...
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
                        UserInformation handle:[:ex |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
                            Transcript showCR:ex description.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
                            ex proceed.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
                        ] do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
                            AbortOperationRequest catch:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
                                self 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
                                    checkinClass:aClass 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
                                    withInfo:checkinInfoOrString 
3400
97f0b44adc03 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3367
diff changeset
   397
                                    withCheck:doCheckClassesHolder
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
                                    usingManager:aManagerOrNil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
                            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
                        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
                    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
                ]
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
        (checkinInfoOrString isStable or:[checkinInfoOrString tagIt])
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
        ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
            "/mhmh - but tag should be set on all (even unchanged ones)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
            "/ the other onces have already been tagged
3293
ef3fc480b979 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3262
diff changeset
   410
            unchangedClasses := allClasses reject:[:eachClass | (classes includes:eachClass)].
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
            "mhmh - could still have to tag them"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
            checkinInfoOrString isStable ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
                unchangedClasses do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
                    self tagClass:eachClass as:#stable.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
            checkinInfoOrString tagIt ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
                unchangedClasses do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
                    self tagClass:eachClass as:(checkinInfoOrString tag).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
    "Created: / 21-12-2011 / 18:24:25 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
    "checkin a projects extensions into the source repository.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   433
    |logMessage checkinInfo mgr pri module directory containerFileName extensionsSource|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
    "/ the following is wrong - must ask the projectDefinition !!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
    aPackageID asPackageId projectDefinitionClass notNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
        mgr := self sourceCodeManagerFor:aPackageID asPackageId projectDefinitionClass.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
    ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
        mgr := self sourceCodeManagerFor:aCollectionOfMethods first mclass.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
    mgr isNil ifTrue:[ ^ false ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
    module := aPackageID asPackageId module.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
    directory := aPackageID asPackageId directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
    containerFileName := self nameOfExtensionsContainer.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
    aLogInfoOrStringOrNil isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
        checkinInfo := self getCheckinInfoFor:containerFileName allBold initialAnswer:nil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
        checkinInfo isNil ifTrue:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
        logMessage := checkinInfo logMessage.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
    ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
        aLogInfoOrStringOrNil isString ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
            logMessage := aLogInfoOrStringOrNil
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
        ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
            checkinInfo := aLogInfoOrStringOrNil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
            logMessage := checkinInfo logMessage.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
    (mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
        (self checkForExistingModule:module usingManager:mgr allowCreate:true) ifFalse:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
        LastModule := module.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
        (self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:true) ifFalse:[^ false].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
        LastPackage := directory.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
        (self checkForExistingModule:module directory:directory container:containerFileName usingManager:mgr allowCreate:true) ifFalse:[^ false].
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
    self activityNotification:(resources string:'Checking in %1' with:containerFileName).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
    pri := Processor activePriority.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
    Processor activeProcess 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
        withPriority:pri-1 to:pri
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
        do:[
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   475
            extensionsSource := self sourceCodeForExtensions:aCollectionOfMethods package:aPackageID forManager:mgr.
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   476
            "Care for non-ASCII/non-ISO-8859 characters in extension methods"
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   477
            extensionsSource isWideString ifTrue:[
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   478
                extensionsSource := '"{ Encoding: utf8 }"' , Character cr asString , Character cr asString , extensionsSource.                
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   479
                extensionsSource := extensionsSource utf8Encoded.
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   480
            ].
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
            UserInformation handle:[:ex |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
                Transcript showCR:ex description.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
                ex proceed.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
            ] do:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   486
                Transcript showCR:('checking in ',containerFileName,' ...').
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   487
                (mgr 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
                    checkin:containerFileName
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   489
                    text:extensionsSource
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
                    directory:directory 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
                    module:module
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
                    logMessage:logMessage
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
                    force:false) 
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
                ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
                    Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
                    self warn:'Checkin of ''' , containerFileName allBold , ''' failed'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
                    ^ false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
                checkinInfo notNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
                    |path|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
                    path := (module, '/', directory, '/', containerFileName).
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
                    checkinInfo isStable ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
                        "set stable tag for class that has been checked in"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
                        self tagPath:path as:#stable usingManager:mgr.    
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
                    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
                    checkinInfo tagIt ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
                        "set an additional tag for class that has been checked in"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
                        self tagPath:path as:(checkinInfo tag) usingManager:mgr.    
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
                    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
                mgr postCheckInExtensionsForPackage:aPackageID    
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
    ^ true
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
    "Modified: / 25-07-2012 / 18:38:40 / cg"
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   521
    |mgr classesToCheckIn methodsToCheckIn methodsInPrjDef
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
     methodsInOtherPackages looseMethods otherPackages
3507
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   523
     msg classesInChangeSet newClasses checkinInfo originalCheckinInfo classesToTag
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   524
     answer|
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
    mgr := self sourceCodeManagerFor: packageToCheckIn.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    classesToCheckIn := IdentitySet new.
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   529
    classesInChangeSet := IdentitySet new.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
    methodsToCheckIn := IdentitySet new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
    methodsInOtherPackages := IdentitySet new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
    looseMethods := IdentitySet new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   534
    "/ 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
   535
    (doClasses or:[doExtensions]) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   536
        Smalltalk allClassesDo:[:aClass | 
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   537
            |owner classPackage|
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   538
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   539
            (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
   540
                classPackage := aClass topOwningClass package
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   541
            ] ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   542
                classPackage := aClass package
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   543
            ].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   544
            (classPackage = packageToCheckIn) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   545
                classesToCheckIn add:aClass.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   546
            ].
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   547
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   548
            doExtensions ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   549
                aClass isMeta ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   550
                    "/ ... 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
   551
                    (classesToCheckIn includes:aClass) ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   552
                        aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   553
                            "/ methods in this project ...
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   554
                            (mthd package = packageToCheckIn) ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   555
                                methodsToCheckIn add:mthd
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   556
                            ]
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   557
                        ]
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   558
                    ].
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   559
                ].
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   560
            ].
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   561
        ].
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   562
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   563
        "/ 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
   564
        "/  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
   565
        "/ 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
   566
        classesInChangeSet := ChangeSet current selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:classesToCheckIn. 
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
    doExtensions ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
        methodsToCheckIn notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
            doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
                msg := '%1 classes (%4 changed) '.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
            ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
                msg := ''.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
            doExtensions ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
                doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   578
                    msg := msg , 'and '.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
                msg := msg , '%2 extensions '.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
            msg := msg , 'of project "%3"'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
            checkinInfo := self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
                        getCheckinInfoFor:(msg
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
                                                    bindWith:classesToCheckIn size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
                                                    with:methodsToCheckIn size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
                                                    with:packageToCheckIn allBold
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
                                                    with:classesInChangeSet size)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
                        initialAnswer:nil
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   591
                        withQuickOption:(classesToCheckIn size > 0)
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   592
                        withValidateConsistencyOption:true.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
            checkinInfo isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
                ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
            ].
3145
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   596
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   597
            checkinInfo validateConsistency ifTrue:[
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   598
                self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions.
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   599
                "/ could have changed/recompiled methods...
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   600
                "/ mhmh - should we checkin what is specified in the prj-def,
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   601
                "/ 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
   602
                
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   603
                methodsInPrjDef  := packageToCheckIn asPackageId projectDefinitionClass extensionMethods.
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   604
                methodsInPrjDef := methodsInPrjDef reject:[:m | m isNil].
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   605
                methodsInPrjDef asSet ~= methodsToCheckIn asSet ifTrue:[
3507
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   606
                    answer:= Dialog 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   607
                        confirmWithCancel:('Set of methods in image is different from what is specified in the project definition.\Check in image methods (%1) or definition methods (%2)?'
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   608
                                        bindWith: methodsToCheckIn size
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   609
                                        with: methodsInPrjDef size)
3507
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   610
                        labels:#('Image Methods' 'Definition Methods' 'Cancel') 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   611
                        values:#(true false nil) 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   612
                        default:nil.
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   613
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   614
"/                    answer := Dialog 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   615
"/                        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
   616
"/                                        bindWith: methodsToCheckIn size
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   617
"/                                        with: methodsInPrjDef size)
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   618
"/                        yesLabel:'Image Methods' 
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   619
"/                        noLabel:'Definition Methods'.
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   620
                    answer isNil ifTrue:[AbortOperationRequest raise].
ef4dad1a2b32 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
   621
                    answer ifFalse:[
3196
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   622
                        methodsToCheckIn := methodsInPrjDef.
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   623
                    ].
d91dbd26f40c class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   624
                ].
3145
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   625
            ].
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   626
3250
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   627
            "/ also need the extensionVersion methods in the projectDefinition class,
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   628
            "/ 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
   629
            "/ CVS id for the extensions container, not for the projDefinition container.
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   630
            packageToCheckIn asPackageId projectDefinitionClass theMetaclass selectorsAndMethodsDo:[:sel :mthd |
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   631
                (AbstractSourceCodeManager isExtensionsVersionMethodSelector:sel) ifTrue:[
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   632
                    methodsToCheckIn add:mthd
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   633
                ].
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   634
            ].
fe3f6d8ead83 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   635
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
            (self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
                checkinExtensionMethods:methodsToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
                forPackage:packageToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   639
                withInfo:checkinInfo)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
            ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
                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
   642
                ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
        ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
            "/ there may have been extension-methods previously - if so, remove them
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
            (mgr
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
                checkForExistingContainer:'extensions.st' inPackage:packageToCheckIn)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
            ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
"/ self halt.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
                (self
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
                    checkinExtensionMethods:#()
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
                    forPackage:packageToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
                    withInfo:'No extensions any more')
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
                ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
                    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
   656
                    ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
                ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   659
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
    checkinInfo isNil ifTrue:[
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   663
        |infoString|
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   664
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   665
        doExtensions ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   666
            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
   667
        ] ifFalse:[doClasses ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   668
            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
   669
        ] ifFalse:[doBuild ifTrue:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   670
            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
   671
        ] ifFalse:[
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   672
            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
   673
        ]]].
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   674
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   675
        infoString := infoString
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   676
                        bindWith:classesToCheckIn size
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   677
                        with:methodsToCheckIn size
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   678
                        with:packageToCheckIn allBold
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   679
                        with:classesInChangeSet size.
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   680
    
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   681
        checkinInfo := self
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   682
                    getCheckinInfoFor:infoString
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
                    initialAnswer:nil
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   684
                    withQuickOption:(classesToCheckIn size > 0)
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   685
                    withValidateConsistencyOption:true.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
        checkinInfo isNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
            ^ self.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
        ].
3145
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   689
        checkinInfo validateConsistency ifTrue:[
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   690
            self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions.
e59d8d1ab71a class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   691
        ].
3141
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   692
    ].
25cd1cd26450 class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3133
diff changeset
   693
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   694
    checkinInfo quickCheckIn ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
        (checkinInfo isStable or:[checkinInfo tagIt]) ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   696
            classesToTag := classesToCheckIn.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   697
            originalCheckinInfo := checkinInfo.
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   698
            checkinInfo := checkinInfo deepCopy.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   699
            checkinInfo isStable:false.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   700
            checkinInfo tag:nil.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   701
        ].
3164
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   702
        "/ not only the one's in the changeSet;
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   703
        "/ also those which have not been checked in before.
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   704
        newClasses := classesToCheckIn select:[:class | (class revisionOfManager:mgr) isNil ].
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   705
        classesToCheckIn := Set new 
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   706
                                addAll:classesInChangeSet; 
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   707
                                addAll:newClasses; 
e54571b3021f class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3145
diff changeset
   708
                                yourself.
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   710
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   711
    "/ check if any of the classes contains methods for other packages ...
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   712
    classesToCheckIn do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   713
        eachClass instAndClassMethodsDo:[:eachMethod |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   714
            |mPgk|
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   715
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   716
            mPgk := eachMethod package.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   717
            (mPgk = packageToCheckIn) ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   718
                mPgk == PackageId noProjectID ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   719
                    looseMethods add:eachMethod
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   720
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   721
                    methodsInOtherPackages add:eachMethod
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   722
                ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   723
            ]
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   724
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   725
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
    askForMethodsInOtherPackages ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
        methodsInOtherPackages notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
            otherPackages := Set new.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
            methodsInOtherPackages do:[:eachMethod | otherPackages add:eachMethod package].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
            methodsInOtherPackages size == 1 ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   733
                msg := 'The ''%4'' method in ''%5'' is contained in the ''%2'' package.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   734
                msg := msg , '\\This method will remain in its package.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   735
            ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
                otherPackages size == 1 ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   737
                    msg := 'The %1 methods from the %2 package will remain in its package.'
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   738
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
                    msg := 'The %1 methods from %3 other packages will remain in their packages.'
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   740
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   741
                msg := msg , '\\Hint: if these are meant to belong to this package,'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   742
                msg := msg , '\move them first, then repeat the checkin operation.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   743
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   744
            msg := msg withCRs.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
            msg := msg bindWith:methodsInOtherPackages size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   746
                           with:otherPackages first allBold
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
                           with:otherPackages size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   748
                           with:methodsInOtherPackages first selector allBold
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   749
                           with:methodsInOtherPackages first mclass name allBold.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   750
            (Dialog confirm:msg noLabel:(resources string:'Cancel')) ifFalse:[^ self].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   751
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
    doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
        classesToCheckIn notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
            looseMethods notEmpty ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   757
                looseMethods size == 1 ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   758
                    msg := 'The ''%2'' method in ''%3'' is unassigned (loose).'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   759
                    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
   760
                    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
   761
                    msg := msg , '\cancel and move it to the appropriate package first.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   762
                ] ifFalse:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   763
                    msg := 'There are %1 unassigned (loose) methods in classes from this project.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   764
                    msg := msg , '\\If you proceed, those will be moved to the ''%4'' package ?'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   765
                    msg := msg , '\\Hint: if these are meant to be extensions of another package,'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   766
                    msg := msg , '\cancel and move them to the appropriate package first.'.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   767
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
                doClasses ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
                    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
   770
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   771
                msg := msg withCRs.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
                msg := msg bindWith:looseMethods size
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
                               with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first selector allBold])
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
                               with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first mclass name allBold])
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
                               with:packageToCheckIn allBold.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   776
                (Dialog confirm:msg noLabel:(resources string:'Cancel')) ifFalse:[^ self].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   777
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   778
                looseMethods do:[:mthd |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
                    mthd package:packageToCheckIn
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
            self checkinClasses:classesToCheckIn withInfo:checkinInfo.
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   784
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
        originalCheckinInfo notNil ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
            originalCheckinInfo isStable ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
                classesToTag do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
                    self tagClass:eachClass as:#stable
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   790
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
            originalCheckinInfo tagIt ifTrue:[
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   792
                classesToTag do:[:eachClass |
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   793
                    self tagClass:eachClass as:(originalCheckinInfo tag)
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   794
                ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
            ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
        ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   797
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   798
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   799
    doBuild ifTrue:[
3367
dc9d785a4ca7 Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents: 3362
diff changeset
   800
        self checkinBuildSupportFilesForPackage:packageToCheckIn withInfo:(originalCheckinInfo ? checkinInfo).
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   801
    ].
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   802
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   803
    "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
   804
    "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
   805
!
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   806
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   807
comparePackages:packages askForRevision:askForRevision
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   808
    "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
   809
     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
   810
     
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   811
     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
   812
     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
   813
     revision.
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   814
     
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   815
     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
   816
     heads, it is not clear which one it is. In that case, even if `askForRevision` is
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   817
     false, this method may result in user interation, asking user to select which of the
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   818
     newest she wants."
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   819
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   820
    |dateFormat string dateOrNil symbolicName|
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   821
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   822
    dateFormat := UserPreferences current dateInputFormat.
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   823
    string := Dialog
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   824
                request:(resources
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   825
                        string:'Compare with version from date (%1) or tag (any other format):'
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   826
                        with:dateFormat)
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   827
                initialAnswer:(Date today printStringFormat:dateFormat).
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   828
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   829
    string isEmptyOrNil ifTrue:[^ self].
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   830
    dateOrNil := Date readFrom:string printFormat:dateFormat onError:nil.
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   831
    dateOrNil isNil ifTrue:[
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   832
        symbolicName := string
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   833
    ].
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   834
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   835
    packages value do:[:eachProject |
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   836
        dateOrNil notNil ifTrue:[
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   837
            self compareProject:eachProject withRepositoryVersionFrom:dateOrNil
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   838
        ] ifFalse:[
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   839
            self compareProject:eachProject withRepositoryVersionTaggedAs:symbolicName
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   840
        ]
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   841
    ].
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   842
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   843
ee6b24d5f0f8 Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3507
diff changeset
   844
    "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
   845
! !
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   846
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   849
version
3573
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   850
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.21 2014-06-03 09:04:25 cg Exp $'
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   851
!
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   852
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   853
version_CVS
3573
af8f051e0a8b class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents: 3537
diff changeset
   854
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.21 2014-06-03 09:04:25 cg Exp $'
2848
f182780810d6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   855
! !
3133
14d574b2f82e extensions with utf8
Claus Gittinger <cg@exept.de>
parents: 2946
diff changeset
   856