SourceCodeManagerUtilities.st
author Claus Gittinger <cg@exept.de>
Thu, 04 Oct 2001 19:26:38 +0200
changeset 1076 4adaffbd7ab0
parent 1070 3f87ae65a554
child 1077 6b1bcfd27521
permissions -rw-r--r--
upper-case
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     1
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     2
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     3
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     4
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     5
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     6
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     8
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
     9
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    10
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    11
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    12
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    13
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    14
"{ Package: 'stx:libbasic3' }"
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    15
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
Object subclass:#SourceCodeManagerUtilities
1053
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    17
	instanceVariableNames:''
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    18
	classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    19
		YesToAllNotification'
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    20
	poolDictionaries:''
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
    21
	category:'System-SourceCodeManagement'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    26
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    27
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    28
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    29
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    30
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    31
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    32
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    34
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    35
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    36
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    37
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    38
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    39
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    40
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    utility code which is useful at more than one place
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    (extracted from the browser)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [author:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        Claus Gittinger (cg@exept)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [see also:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [instance variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    [class variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    57
!SourceCodeManagerUtilities class methodsFor:'Signal constants'!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    58
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    59
yesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    60
    YesToAllNotification isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    61
        YesToAllNotification := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    62
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    63
    ^ YesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    64
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    65
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    66
yesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    67
    YesToAllQuery isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    68
        YesToAllQuery := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    69
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    70
    ^ YesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    71
! !
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    72
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
!SourceCodeManagerUtilities class methodsFor:'utilities'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
    75
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
    76
    "open a dialog asking for a source container;
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
    77
     return a dictionary containing module, package and filename,
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
    78
     or nil if canceled."
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
    79
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    80
    ^ self
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    81
        askForContainer:boxText title:title note:notice 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    82
        initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    83
        forNewContainer:true
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    84
!
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    85
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    86
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    87
    "open a dialog asking for a source container;
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    88
     return a dictionary containing module, package and filename,
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    89
     or nil if canceled."
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    90
1065
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    91
    |box y component resources answer
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
    92
     moduleHolder packageHolder fileNameHolder
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    93
     module package fileName 
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    94
     knownContainers knownPackages packageUpdater
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
    95
     packageBoxComponent fileNameBoxComponent fileNameUpdater|
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    96
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    97
    knownContainers := Set new.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    98
    Smalltalk allClassesDo:[:cls | |pckg|
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    99
        pckg := cls package.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   100
        pckg size > 0 ifTrue:[
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   101
            knownContainers add:(pckg upTo:$:)
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   102
        ]
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   103
    ].
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   104
    knownContainers := knownContainers asOrderedCollection.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   105
    knownContainers := knownContainers select:[:module | module isBlank not].
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   106
    knownContainers sort.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   107
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   108
    packageUpdater := [
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   109
        |theModulePrefix|
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   110
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   111
        theModulePrefix := moduleHolder value , ':'.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   112
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   113
        Cursor wait showWhile:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   114
            knownPackages := Set new.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   115
            Smalltalk allClassesDo:[:cls | |pckg idx|
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   116
                pckg := cls package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   117
                pckg size > 0 ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   118
                    (pckg startsWith:theModulePrefix) ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   119
                        idx := pckg indexOf:$:.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   120
                        knownPackages add:(pckg copyFrom:idx + 1)
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   121
                    ]
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   122
                ]
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   123
            ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   124
            knownPackages := knownPackages asOrderedCollection.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   125
            knownPackages := knownPackages select:[:package | package isBlank not].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   126
            knownPackages sort.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   127
            packageBoxComponent list:knownPackages.
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   128
        ].
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   129
    ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   130
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   131
    fileNameUpdater := [
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   132
        |module package files|
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   133
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   134
        Cursor read showWhile:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   135
            module := moduleHolder value ? '__NoProject__'.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   136
            package := packageHolder value ? '__NoProject__'.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   137
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   138
            files := SourceCodeManager getExistingContainersInModule:module package:package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   139
            files := files asOrderedCollection.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   140
            files := files select:[:eachFile | eachFile asFilename hasSuffix:'st'].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   141
            files sort.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   142
            fileNameBoxComponent list:files.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   143
        ].
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   144
    ].
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   145
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   146
    moduleHolder := initialModule asValue.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   147
    packageHolder := initialPackage asValue.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   148
    fileNameHolder := initialFileName asValue.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   149
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   150
    resources := ResourcePack for:self.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   151
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   152
    "/
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   153
    "/ open a dialog for this
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   154
    "/
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   155
    box := DialogBox new.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   156
    box label:title.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   157
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   158
    component := box addTextLabel:boxText withCRs.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   159
    component adjust:#left; borderWidth:0.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   160
    box addVerticalSpace.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   161
    box addVerticalSpace.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   162
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   163
    y := box yPosition.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   164
    component := box addTextLabel:(resources string:'Module:').
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   165
    component width:0.4; adjust:#right.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   166
    box yPosition:y.
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   167
    component := box addComboBoxOn:moduleHolder tabable:true.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   168
    component list:knownContainers.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   169
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   170
"/    component := box addInputFieldOn:moduleHolder tabable:true.
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   171
    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   172
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   173
    box addVerticalSpace.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   174
    y := box yPosition.
982
52118290c6d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 981
diff changeset
   175
    component := box addTextLabel:(resources string:'Package:').
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   176
    component width:0.4; adjust:#right.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   177
    box yPosition:y.
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   178
    packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   179
"/    component := box addInputFieldOn:packageHolder tabable:true.
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   180
    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   181
    packageUpdater value.
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   182
    moduleHolder onChangeEvaluate:packageUpdater.
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   183
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   184
    box addVerticalSpace.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   185
    y := box yPosition.
982
52118290c6d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 981
diff changeset
   186
    component := box addTextLabel:(resources string:'Filename:').
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   187
    component width:0.4; adjust:#right.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   188
    box yPosition:y.
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   189
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   190
    forNewContainer ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   191
        component := box addInputFieldOn:fileNameHolder tabable:true.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   192
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   193
    ] ifFalse:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   194
        fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   195
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   196
        fileNameUpdater value.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   197
        packageHolder onChangeEvaluate:fileNameUpdater.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   198
    ].
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   199
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   200
    box addVerticalSpace.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   201
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   202
    notice notNil ifTrue:[
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   203
        component := box addTextLabel:notice.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   204
        component adjust:#left; borderWidth:0.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   205
    ].
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   206
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   207
    box addVerticalSpace.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   208
    box addAbortAndOkButtons.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   209
1065
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   210
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   211
        component := Button label:'Yes to all'.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   212
        component action:[
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   213
                            YesToAllNotification queryWith:true.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   214
                            box doAccept.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   215
                         ].
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   216
        (DialogBox styleSheet at:'dialogBox.okAtLeft') ifTrue:[
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   217
            box addButton:component after:nil.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   218
        ] ifFalse:[
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   219
            box addButton:component before:nil.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   220
        ].
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   221
    ].
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   222
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   223
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   224
        answer := YesToAllQuery query.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   225
    ].
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   226
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   227
    answer isNil ifTrue:[
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   228
        box showAtPointer.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   229
        answer := box accepted
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   230
    ].
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   231
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   232
    box destroy.
68dbb6841e29 added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   233
    answer ifFalse:[
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   234
        ^ nil
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   235
    ].
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   236
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   237
    module := moduleHolder value withoutSpaces.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   238
    package := packageHolder value withoutSpaces.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   239
    fileName := fileNameHolder value withoutSpaces.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   240
    ^ Dictionary new
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   241
        at:#module put:module;
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   242
        at:#package put:package;
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   243
        at:#fileName put:fileName;
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   244
        yourself
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   245
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   246
    "
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   247
     self 
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   248
        askForContainer:'enter container' title:'container' note:'some note'
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   249
        initialModule:'foo' initialPackage:'bar' initialFileName:'baz'        
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   250
    "
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   251
!
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   252
936
def2b1c81bcf renamed askForExistingRevision
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   253
askForExistingRevision:boxText title:title class:aClass
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   254
    "open a dialog asking for a containers revision;
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   255
     return a revision number, or nil if canceled."
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   256
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   257
    |mgr sourceInfo module package fileName|
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   258
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   259
    mgr := aClass sourceCodeManager.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   260
    sourceInfo := mgr sourceInfoOfClass:aClass.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   261
    sourceInfo isNil ifTrue:[^ nil].
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   262
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   263
    package := mgr packageFromSourceInfo:sourceInfo.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   264
    module := mgr moduleFromSourceInfo:sourceInfo.  
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   265
    fileName := mgr containerFromSourceInfo:sourceInfo.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   266
    ^ self
936
def2b1c81bcf renamed askForExistingRevision
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   267
        askForExistingRevision:boxText 
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   268
        title:title 
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   269
        class:aClass 
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   270
        manager:mgr 
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   271
        module:module package:package fileName:fileName
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   272
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   273
    "
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   274
     SourceCodeManagerUtilities
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   275
        askForRevisionToCompare:'enter revision'
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   276
        title:'revision'
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   277
        class:Array
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   278
    "
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   279
!
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   280
936
def2b1c81bcf renamed askForExistingRevision
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   281
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:package fileName:fileName
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   282
    "open a dialog asking for a containers revision;
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   283
     return a revision number, or nil if canceled."
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   284
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   285
    |partialLog revisions items newestRev
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   286
     box y component resources 
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   287
     revisionHolder|
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   288
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   289
    partialLog := aSourceCodeManager
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   290
        revisionLogOf:clsOrNil
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   291
        numberOfRevisions:20
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   292
        fileName:fileName
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   293
        directory:package 
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   294
        module:module.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   295
    partialLog notNil ifTrue:[
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   296
        newestRev := partialLog at:#newestRevision.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   297
        revisions := partialLog at:#revisions.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   298
        items := revisions collect:[:each | |rev date who|
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   299
                                        rev := each at:#revision.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   300
                                        date := each at:#date.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   301
                                        who := each at:#author.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   302
                                        rev allBold , ' [' , date , ' by ' , who , ']'
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   303
                                   ].
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   304
        revisions := revisions collect:[:each | each at:#revision].
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   305
    ] ifFalse:[
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   306
        newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:package module:module.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   307
        revisions := items := nil.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   308
    ].
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   309
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   310
    revisionHolder  := newestRev asValue.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   311
    resources := ResourcePack for:self.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   312
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   313
    revisionHolder onChangeEvaluate:[
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   314
        "/ cut off everything after revision
937
12b3dca6ff1a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 936
diff changeset
   315
        |s first words|
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   316
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   317
        s := revisionHolder value.
937
12b3dca6ff1a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 936
diff changeset
   318
        words := s asCollectionOfWords.
12b3dca6ff1a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 936
diff changeset
   319
        words size > 0 ifTrue:[
12b3dca6ff1a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 936
diff changeset
   320
            first := words first string.
12b3dca6ff1a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 936
diff changeset
   321
            first ~= s ifTrue:[
12b3dca6ff1a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 936
diff changeset
   322
                revisionHolder value:first
12b3dca6ff1a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 936
diff changeset
   323
            ]
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   324
        ]
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   325
    ].
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   326
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   327
    "/
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   328
    "/ open a dialog for this
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   329
    "/
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   330
    box := DialogBox new.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   331
    box label:title.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   332
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   333
    component := box addTextLabel:boxText withCRs.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   334
    component adjust:#left; borderWidth:0.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   335
    box addVerticalSpace.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   336
    box addVerticalSpace.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   337
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   338
    y := box yPosition.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   339
    component := box addTextLabel:(resources string:'Revision:').
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   340
    component width:0.4; adjust:#right.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   341
    box yPosition:y.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   342
    component := box addComboBoxOn:revisionHolder tabable:true.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   343
    component list:items.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   344
    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   345
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   346
    box addVerticalSpace.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   347
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   348
    box addAbortAndOkButtons.
990
edf1dd382621 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
   349
edf1dd382621 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
   350
    Object abortAllSignal isHandled ifTrue:[
edf1dd382621 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
   351
        (box addAbortButtonLabelled:'cancel all') action:[AbortAllSignal raise].
edf1dd382621 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
   352
    ].
edf1dd382621 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
   353
934
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   354
    box showAtPointer.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   355
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   356
    box accepted ifFalse:[
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   357
        box destroy.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   358
        ^ nil
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   359
    ].
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   360
    box destroy.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   361
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   362
    ^ revisionHolder value withoutSpaces.
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   363
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   364
    "
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   365
     SourceCodeManagerUtilities
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   366
        askForRevisionToCompare:'enter revision'
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   367
        title:'revision'
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   368
        class:nil
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   369
        manager:SourceCodeManager 
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   370
        module:'stx'
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   371
        package:'libbasic'
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   372
        fileName:'Array.st'
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   373
    "
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   374
!
4f06b1db2ca1 better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   375
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   376
checkAndWarnAboutBadMessagesInClass:aClass
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   377
    "check if a class contains message-sends to:
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   378
        #halt
1053
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
   379
        #halt:
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   380
        #error
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   381
        (and maybe more in the future)"
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   382
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   383
    |badStuff whatIsBad msg answer|
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   384
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   385
    badStuff := #(
1053
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
   386
        ( #halt         'sent of #halt (use for debugging only) - better use #error:''some message''' )
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
   387
        ( #halt:        'sent of #halt: (use for debugging only) - better use #error:' )
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
   388
        ( #error        'sent of #error without descriptive message - better use #error:''some message''' )
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   389
    ).
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   390
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   391
    whatIsBad := Set new.
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   392
    aClass theNonMetaclass allSelectorsAndMethodsDo:[:sel :mthd |
1012
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   393
        |setOfLiterals setOfSentMessages|
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   394
1012
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   395
        setOfLiterals := mthd literals.  "/ try without parsing first.
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   396
        (badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   397
            setOfSentMessages := mthd messagesSent.
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   398
            badStuff do:[:eachEntry |
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   399
                (setOfSentMessages includes:eachEntry first) ifTrue:[
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   400
                    whatIsBad add:eachEntry second
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   401
                ]
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   402
            ].
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   403
        ].
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   404
    ].
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   405
    whatIsBad notEmpty ifTrue:[
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   406
        (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   407
            answer := YesToAllQuery query.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   408
            answer notNil ifTrue:[ ^ answer ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   409
        ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   410
1012
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   411
        msg := '%1 contains the following  (considered bad style) message sends:\\'.
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   412
        whatIsBad do:[:each |
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   413
            msg := msg , '   ' , each , '\'
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   414
        ].
1012
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   415
        msg := msg , '\\' , 'Do you really want to checkIn the %1 class ?'.
92c4719178de faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   416
        msg := msg bindWith:aClass name.
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   417
        (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   418
            answer := OptionBox 
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   419
                          request:msg withCRs
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   420
                          label:'Really checkIn ?'
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   421
                          form:(InfoBox iconBitmap)
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
   422
                          buttonLabels:#('Yes' 'Yes to all' 'No' 'No to all')
1056
c9cc2b5d065e optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
   423
                          values:#(true #yesToAll false #noToAll)
c9cc2b5d065e optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
   424
                          default:#yesToAll
c9cc2b5d065e optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
   425
                          onCancel:false.
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   426
            answer == #yesToAll ifTrue:[
1053
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
   427
                YesToAllNotification queryWith:true.
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   428
                ^ true
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   429
            ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   430
            answer == #noToAll ifTrue:[
1053
bbf6a1d5d3f7 Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents: 1051
diff changeset
   431
                YesToAllNotification queryWith:false.
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   432
                ^ false
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   433
            ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   434
            ^ answer
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   435
        ] ifFalse:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   436
            ^ self confirm:msg withCRs
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   437
        ]
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   438
    ].
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   439
    ^ true.
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   440
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   441
    "
983
100c6d1f8ef6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   442
     self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities)  
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   443
    "
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   444
!
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   445
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   446
checkinClass:aClass
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   447
    "check a class into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   448
     Asks interactively for log-message."
882
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   449
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   450
    ^ self checkinClass:aClass withLog:nil
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   451
!
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   452
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   453
checkinClass:aClass withLog:aLogMessageOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   454
    "check a class into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   455
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   456
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   457
    ^ self checkinClass:aClass withLog:aLogMessageOrNil withCheck:true
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   458
!
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   459
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   460
checkinClass:aClass withLog:aLogMessageOrNil withCheck:doCheckClass
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   461
    "check a class into the source repository.
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   462
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   463
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   464
    |logMessage info mgr pri resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   465
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   466
    aClass isLoaded ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   467
        self information:'cannot checkin unloaded classes (' , aClass name , ').'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   468
        ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   469
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   470
954
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   471
    mgr := (aClass sourceCodeManager).
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   472
    mgr isNil ifTrue:[
1048
b2e77b16f464 Fix typo
Stefan Vogel <sv@exept.de>
parents: 1044
diff changeset
   473
        (self confirm:'Class does not seem to provide a valid sourceCodeManager.\\Assume CVS ?' withCRs) ifFalse:[
954
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   474
            ^ false
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   475
        ].
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   476
        mgr := CVSSourceCodeManager.
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   477
    ].
3446cc28ec1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 952
diff changeset
   478
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   479
    aLogMessageOrNil isNil ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   480
        logMessage := SourceCodeManagerUtilities getLogMessageFor:aClass name allBold.
1048
b2e77b16f464 Fix typo
Stefan Vogel <sv@exept.de>
parents: 1044
diff changeset
   481
        logMessage isNil ifTrue:[^ false].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   482
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   483
        logMessage := aLogMessageOrNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   484
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   485
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   486
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   487
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   488
    info := mgr sourceInfoOfClass:aClass.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   489
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   490
    (info isNil 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   491
    or:[(info at:#fileName ifAbsent:nil) isNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   492
    or:[(info at:#module ifAbsent:nil) isNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   493
    or:[(info at:#directory ifAbsent:nil) isNil]]]) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   494
        (self createSourceContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   495
"/            self warn:'did not create a container for ''' , aClass name , ''''.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   496
            ^ false
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   497
        ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   498
        ^ true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   499
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   500
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   501
    self activityNotification:(resources string:'checking in %1' with:aClass name).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   502
    pri := Processor activePriority.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   503
    Processor activeProcess withPriority:pri-1 to:pri
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   504
    do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   505
        |revision aborted freshCreated|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   506
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   507
        freshCreated := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   508
        revision := aClass revision.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   509
        revision isNil ifTrue:[ 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   510
            "/ mhmh - check if it has a container.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   511
            (mgr checkForExistingContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   512
                (self createSourceContainerForClass:aClass) ifFalse:[
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   513
                    self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   514
                    ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   515
                ] ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   516
                    freshCreated := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   517
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   518
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   519
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   520
977
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   521
        doCheckClass ifTrue:[
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   522
            "/ check if the class contains halts, error-sends etc.
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   523
            (self checkAndWarnAboutBadMessagesInClass:aClass) ifFalse:[
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   524
                ^ false
ac63f52bccfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   525
            ].
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   526
        ].
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   527
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   528
        freshCreated ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   529
            aborted := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   530
            Object abortSignal handle:[:ex |
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   531
                aborted := true.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   532
                ex return.
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   533
                ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   534
            ] do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   535
                (mgr checkinClass:aClass logMessage:logMessage) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   536
                    Transcript showCR:'checkin of ''' , aClass name , ''' failed'.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   537
                    self warn:'checkin of ''' , aClass name allBold , ''' failed'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   538
                    ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   539
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   540
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   541
            aborted ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   542
                Transcript showCR:'checkin of ''' , aClass name , ''' aborted'.
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   543
                AbortAllSignal isHandled ifTrue:[
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   544
                    (Dialog 
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   545
                        confirm:('checkin of ''' , aClass name , ''' aborted.\\Cancel all ?')withCRs
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   546
                        default:false)
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   547
                    ifTrue:[
1022
139e278b0f03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1019
diff changeset
   548
                        AbortAllSignal raise.
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   549
                    ]
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   550
                ].
1032
24faa0f05f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   551
                AbortSignal raise.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   552
                ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   553
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   554
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   555
    ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   556
    ^ true
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   557
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   558
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   559
checkinClasses:aCollectionOfClass
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   560
    "check a collection of classes into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   561
     Asks interactively for log-message."
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   562
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   563
    ^ self checkinClasses:aCollectionOfClass withLog:nil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   564
!
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   565
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   566
checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   567
    "check a bunch of classes into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   568
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   569
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   570
    ^ self
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   571
        checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil withCheck:true
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   572
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   573
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   574
checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil withCheck:doCheckClasses
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   575
    "check a bunch of classes into the source repository.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   576
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   577
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   578
    |classes logMessage resources yesOrNoToAll|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   579
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   580
    "/ ignore private classes
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   581
    classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   582
    classes isEmpty ifTrue:[
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   583
        self information:'Only private classes given - nothing checked in.'.
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   584
        ^ self
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   585
    ].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   586
    classes := classes select:[:aClass | aClass isLoaded].
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   587
    classes isEmpty ifTrue:[
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   588
        self information:'Only unloaded classes given - nothing checked in.'.
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   589
        ^ self
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   590
    ].
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   591
    classes size == 1 ifTrue:[
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   592
        ^ self checkinClass:classes first withLog:aLogMessageOrNil withCheck:doCheckClasses.
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   593
    ].
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   594
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   595
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   596
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   597
    (logMessage := aLogMessageOrNil) isNil ifTrue:[
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   598
        logMessage := SourceCodeManagerUtilities getLogMessageFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size).
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   599
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   600
        logMessage isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   601
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   602
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   603
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   604
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   605
    AbortAllSignal handle:[:ex |
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   606
        ex return
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   607
    ] do:[
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   608
        self yesToAllNotification handle:[:ex |
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   609
            yesOrNoToAll := ex parameter.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   610
            ex proceed
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   611
        ] do:[
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   612
            self yesToAllQuery handle:[:ex |
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   613
                ex proceedWith:yesOrNoToAll
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   614
            ] do:[
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   615
                classes do:[:aClass |
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   616
                    (self checkAndWarnAboutBadMessagesInClass:aClass) ifTrue:[
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   617
                        self activityNotification:(resources string:'checking in %1' with:aClass name).
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   618
                        "/ ca does not want boxes to pop up all over ...
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   619
                        InformationSignal handle:[:ex |
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   620
                            Transcript showCR:ex errorString
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   621
                        ] do:[
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   622
                            self checkinClass:aClass withLog:logMessage withCheck:doCheckClasses
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   623
                        ].
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   624
                    ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   625
                ]
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   626
            ]
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   627
        ].
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   628
    ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1015
diff changeset
   629
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   630
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   631
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   632
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withLog:aLogMessageOrNil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   633
    "checkin a projects extensions into the source repository.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   634
     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   635
1015
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   636
    |logMessage info mgr pri resources module package i containerFileName s 
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   637
     methodSource methodsSortedByName|
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   638
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   639
    resources := ResourcePack for:self.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   640
958
6bc25cd82843 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   641
    mgr := aCollectionOfMethods first mclass theNonMetaclass sourceCodeManager.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   642
    mgr isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   643
        self warn:'No sourceCode manager defined - cannot checkin.'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   644
"/        self error:'No sourceCode manager defined' mayProceed:true.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   645
        ^  false.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   646
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   647
    i := aPackageID indexOf:$:.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   648
    i == 0 ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   649
        self warn:'Cannot extract module/package from the packageID (invalid format)\\Please change the packageID to be of the form <module>:<subdirectory>,\and try again.\Or, alternatively, move the extensions to their classes project and checkIn the class(es).' withCRs.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   650
"/        self error:'cannot extract module/package from packageID' mayProceed:true.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   651
        ^  false.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   652
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   653
    module := aPackageID copyTo:i-1.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   654
    package := aPackageID copyFrom:i+1.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   655
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   656
    containerFileName := 'extensions.st'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   657
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   658
    aLogMessageOrNil isNil ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   659
        logMessage := SourceCodeManagerUtilities getLogMessageFor:containerFileName allBold.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   660
        logMessage isNil ifTrue:[^ self].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   661
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   662
        logMessage := aLogMessageOrNil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   663
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   664
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   665
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   666
    "/ check for the module
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   667
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   668
    (mgr checkForExistingModule:module) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   669
        (Dialog 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   670
            confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   671
            noLabel:'cancel') 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   672
        ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   673
            ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   674
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   675
        (mgr createModule:module) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   676
            self warn:(resources string:'cannot create new module: %1' with:module).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   677
            ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   678
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   679
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   680
    LastModule := module.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   681
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   682
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   683
    "/ check for the package
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   684
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   685
    (mgr checkForExistingModule:module package:package) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   686
        (Dialog 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   687
            confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   688
            noLabel:'cancel') 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   689
        ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   690
            ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   691
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   692
        (mgr createModule:module package:package) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   693
            self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   694
            ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   695
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   696
    ].
1015
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   697
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   698
    "/
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   699
    "/ check for the container
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   700
    "/
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   701
    (mgr checkForExistingContainerInModule:module package:package container:containerFileName) ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   702
        (Dialog 
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   703
            confirm:(resources string:'%1 is a new container (in %2:%3).\\create it ?' 
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   704
                                 with:containerFileName with:module with:package) withCRs
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   705
            noLabel:'cancel') 
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   706
        ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   707
            ^ false.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   708
        ].
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   709
        (mgr createContainerForText:'' inModule:module package:package container:containerFileName) ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   710
            self warn:(resources string:'cannot create new container: %1 (in %2:%3)' 
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   711
                                 with:containerFileName with:module with:package).
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   712
            ^ false.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   713
        ]
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   714
    ].
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   715
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   716
    LastPackage := package.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   717
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   718
    self activityNotification:(resources string:'checking in %1' with:containerFileName).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   719
    pri := Processor activePriority.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   720
    Processor activeProcess withPriority:pri-1 to:pri
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   721
    do:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   722
        s := '' writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   723
        
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   724
        s nextPutAll:'"{ Package: '''.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   725
        s nextPutAll:aPackageID asString.
923
0a6c95fe85ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   726
        s nextPutAll:''' }"'; cr; nextPutChunkSeparator; cr; cr.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   727
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   728
"/        s nextPutAll:(Smalltalk timeStamp).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   729
"/        s nextPutChunkSeparator. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   730
"/        s cr; cr.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   731
1015
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   732
        "/ sort them by name (to avoid conflict due to CVS merge)
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   733
        methodsSortedByName := aCollectionOfMethods asOrderedCollection.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   734
        methodsSortedByName sort:[:a :b |
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   735
                                        |clsA clsB|
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   736
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   737
                                        clsA := a mclass name.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   738
                                        clsB := b mclass name.
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   739
                                        clsA < clsB ifTrue:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   740
                                            true
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   741
                                        ] ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   742
                                            clsA > clsB ifTrue:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   743
                                                false
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   744
                                            ] ifFalse:[
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   745
                                                a selector < b selector
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   746
                                            ]
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   747
                                        ]
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   748
                                  ].
89f96d45303e extension checkIn
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   749
        methodsSortedByName do:[:aMethod |
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   750
            aMethod mclass fileOutMethod:aMethod on:s.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   751
            s cr.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   752
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   753
        methodSource := s contents.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   754
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   755
        InformationSignal handle:[:ex |
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   756
            Transcript showCR:ex errorString
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   757
        ] do:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   758
            (mgr 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   759
                checkin:containerFileName
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   760
                text:methodSource
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   761
                directory:package 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   762
                module:module
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   763
                logMessage:aLogMessageOrNil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   764
                force:false) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   765
                    Transcript showCR:'checkin of ''' , containerFileName , ''' failed'.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   766
                    self warn:'checkin of ''' , containerFileName allBold , ''' failed'.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   767
                    ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   768
            ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   769
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   770
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   771
    ^ true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   772
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
   773
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   774
checkoutClass:aClass askForMerge:askForMerge
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   775
    "check-out a class from the source repository."
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   776
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   777
    self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   778
        checkoutClass:aClass 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   779
        askForRevision:true
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   780
        askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   781
!
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   782
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   783
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   784
    "check-out a class from the source repository.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   785
     If askForRevision is false, check-out the newest version."
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   786
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   787
    |mgr resources
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   788
     currentClass 
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   789
     aStream sourceToLoad currentSource rev revString
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   790
     nm msg rev2 newestRev
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   791
     containerModule containerPackage containerFile rslt
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   792
     pkg listHere listRep diffSet 
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   793
     changed onlyHere onlyInRep answer labels values singleChangeSelector
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   794
     changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions|
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   795
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   796
    resources := ResourcePack for:self.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   797
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   798
    currentClass := aClass theNonMetaclass.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   799
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   800
    nm := currentClass name.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   801
    mgr := currentClass sourceCodeManager.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   802
    mgr isNil ifTrue:[
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   803
        self warn:'No sourceCode manager - check settings'.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   804
        ^ self
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   805
    ].
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   806
    currentClass isLoaded ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   807
        rev := currentClass binaryRevision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   808
        rev2 := currentClass revision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   809
        rev isNil ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   810
            rev := rev2
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   811
        ].
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   812
        rev isNil ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   813
            pkg := aClass package.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   814
            pkg notNil ifTrue:[
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   815
                containerModule := pkg upTo:$:.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   816
                containerPackage := pkg copyFrom:(containerModule size + 2).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   817
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   818
            containerModule size == 0 ifTrue:[
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   819
                containerModule := Project current repositoryModule.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   820
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   821
            containerPackage size == 0 ifTrue:[
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   822
                containerPackage := Project current package.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   823
            ].
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   824
            answer := self confirmWithCancel:(resources 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   825
                                                string:'The class %3 seems to have no (valid) repository information.\\I assume you want to check it out from: %1/%2.' 
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   826
                                                with:containerModule allBold 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   827
                                                with:containerPackage allBold
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   828
                                                with:aClass name allBold) withCRs.
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   829
            answer isNil ifTrue:[^ self "cancelled"].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   830
            answer ifFalse:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   831
                rslt := SourceCodeManagerUtilities
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   832
                    askForContainer:(resources string:'The class seems to have no repository information.\\Do you want to checkOut from an existing containers contents ?')
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   833
                    title:'Container to load from' note:nil 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   834
                    initialModule:containerModule 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   835
                    initialPackage:containerPackage 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   836
                    initialFileName:(currentClass name , '.st')
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   837
                    forNewContainer:false.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   838
                rslt isNil ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   839
                    "/ canel
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   840
                    ^ self
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   841
                ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   842
                containerModule := "lastModule :=" rslt at:#module.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   843
                containerPackage := "lastPackage :=" rslt at:#package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   844
                containerFile := rslt at:#fileName.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   845
            ].
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   846
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   847
"/            rslt := SourceCodeManagerUtilities
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   848
"/                askForContainer:(resources string:'The class seems to have no (valid) repository information.\\Do you want to check it out from an existing container ?')
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   849
"/                title:'Container to checkOut' note:nil 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   850
"/                initialModule:containerModule 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   851
"/                initialPackage:containerPackage
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   852
"/                initialFileName:(currentClass name , '.st').
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
   853
"/                forNewContainer:false.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   854
"/            rslt isNil ifTrue:[^ self].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   855
            "/ self warn:(resources string:'Class %1 seems to be not yet in the repository' with:currentClass name allBold).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   856
            "/ ^ self
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   857
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   858
    ].
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   859
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   860
    "/
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   861
    "/ class in repository - ask for revision
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   862
    "/
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   863
    newestRev := mgr newestRevisionOf:currentClass.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   864
    askForRevision ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   865
        rev := newestRev ? ''
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   866
    ] ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   867
        msg := resources string:'CheckOut which revision of ''%1'': (empty for newest)' with:nm allBold.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   868
        rev notNil ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   869
            msg := msg , '\\' , (resources string:'Current ''%1'' is based upon rev %2.'
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
   870
                                           with:nm allBold with:rev).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   871
            (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   872
                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   873
                                               with:rev2)
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   874
            ]
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   875
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   876
        newestRev notNil ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   877
            msg := msg , '\' , (resources string:'Newest in reporitory is %1.'
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   878
                                           with:newestRev)
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   879
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   880
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   881
        rev := SourceCodeManagerUtilities
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   882
                    askForExistingRevision:msg 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   883
                    title:'CheckOut from repository' 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   884
                    class:currentClass.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   885
        rev isNil ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   886
            "/ cancelled
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   887
            ^ self
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   888
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   889
    ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   890
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   891
    rev withoutSpaces isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   892
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   893
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   894
        aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   895
        revString := '(newest: ' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   896
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   897
        msg := 'extracting previous %1'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   898
        aStream := mgr getSourceStreamFor:currentClass revision:rev.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   899
        revString := rev
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   900
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   901
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   902
    aStream isNil ifTrue:[
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   903
        self warn:(resources string:'could not extract source of %1 from repository' with:aClass name allBold).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   904
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   905
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   906
    aStream class readErrorSignal handle:[:ex |
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   907
        self warn:('read error while reading extracted source\\' , ex errorString) withCRs.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   908
        aStream close.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   909
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   910
    ] do:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   911
        sourceToLoad := aStream contents asString.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   912
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   913
    aStream close.
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
   914
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   915
    currentClass isLoaded ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   916
        rev = newestRev ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   917
            currentClass autoload.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   918
        ] ifFalse:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   919
            sourceToLoad readStream fileIn.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   920
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   921
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   922
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   923
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   924
    self activityNotification:'generating current source...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   925
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   926
    aStream := '' writeStream.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   927
    Method flushSourceStreamCache.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   928
    currentClass fileOutOn:aStream withTimeStamp:false.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   929
    currentSource := aStream contents asString.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   930
    aStream close.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   931
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   932
    self activityNotification:'comparing...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   933
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   934
    sourceToLoad = currentSource ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   935
        "/ make all methods belong to the classes project
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   936
        self setPackageOfAllMethodsIn:aClass to:aClass package.
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   937
        self information:(resources string:'Versions are identical: %1' with:aClass name).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   938
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   939
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   940
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   941
    self activityNotification:'generating diffSet...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   942
    listHere := ChangeSet fromStream:(currentSource readStream).
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   943
    listRep := ChangeSet fromStream:(sourceToLoad readStream).
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   944
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   945
    versionMethodsHere := listHere select:[:change | (change isMethodChange 
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   946
                                           and:[change selector == #version
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   947
                                           and:[change changeClass isMeta]])].
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   948
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   949
    versionMethodsRep := listRep select:[:change | (change isMethodChange 
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   950
                                           and:[change selector == #version
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   951
                                           and:[change changeClass isMeta]])].
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
   952
1044
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   953
    "/ compare all but the version methods
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   954
    listHere := listHere select:[:change | (change isMethodChange 
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   955
                                           and:[change selector == #version
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   956
                                           and:[change changeClass isMeta]]) not].
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   957
    listRep := listRep select:[:change | (change isMethodChange 
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   958
                                           and:[change selector == #version
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   959
                                           and:[change changeClass isMeta]]) not].
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
   960
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   961
    diffSet := listHere diffSetsAgainst:listRep.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   962
    changed := diffSet at:#changed.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   963
    onlyHere := diffSet at:#onlyInReceiver.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   964
    onlyInRep := diffSet at:#onlyInArg.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   965
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   966
    changedClassDefinitions := changed select:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   967
    changed := changed reject:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   968
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   969
    labels := #('cancel' 'merge' 'load'). 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   970
    values := #(nil #merge #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   971
    default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   972
                    ifTrue:[3. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   973
                    ifFalse:[2. "i.e. merge"].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   974
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   975
    msg := 'About to change ''%4''.\\'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   976
    onlyInRep size > 0 ifTrue:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
   977
        msg := msg , 'The repositories version contains %1 method(s) which are not in your current class.\'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   978
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   979
    onlyHere size > 0 ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   980
        onlyInRep size > 0 ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   981
            msg := msg , 'And there '.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   982
        ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   983
            msg := msg , 'There '.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   984
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   985
        msg := msg , 'are %2 methods in your current class, which are not in the repository.\'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   986
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   987
    changed size > 0 ifTrue:[
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   988
        changed size == 1 ifTrue:[
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   989
            msg := msg , 'the ''%6''-method is different (present in both).\\'.
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   990
            singleChangeSelector := changed first first selector asText allBold
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   991
        ] ifFalse:[
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   992
            msg := msg , '%3 methods are different (present in both).\\'.
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   993
        ]
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
   994
    ].
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   995
    changedClassDefinitions size > 0 ifTrue:[
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   996
        changedClassDefinitions size == 1 ifTrue:[
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   997
            msg := msg , 'the class definition is different.\\'.
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   998
        ] ifFalse:[
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
   999
            msg := msg , '%5 class definitions are different.\\'.
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
  1000
        ]
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
  1001
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  1002
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1003
    onlyHere isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1004
        onlyInRep isEmpty ifTrue:[
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
  1005
            (changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1006
                "/ make all methods belong to the classes project
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1007
                versionMethodsRep size == 1 ifTrue:[
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1008
"/                    (self confirm:(resources string:'Versions are identical: %1\\Update the version-ID ?' with:aClass name) withCRs) ifTrue:[
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1009
                        versionMethodsRep first apply.
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1010
"/                    ]
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1011
                ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1012
                self setPackageOfAllMethodsIn:aClass to:aClass package.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1013
                ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1014
            ].
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1015
            msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made).'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1016
            labels := #('cancel' 'load'). 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1017
            values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1018
            default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1019
                            ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1020
                            ifFalse:[1. "i.e. cancel"].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1021
        ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1022
            changed isEmpty ifTrue:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1023
                msg := msg , '\Attention:\Load will load methods which are not present in ''%4''.'.
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1024
                labels := #('cancel' 'load'). 
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1025
                values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1026
                default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1027
                                ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1028
                                ifFalse:[1. "i.e. cancel"].
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1029
            ] ifFalse:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1030
                msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1031
                msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1032
            ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1033
        ]
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1034
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1035
        onlyInRep isEmpty ifTrue:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1036
            msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made),'.
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1037
            msg := msg , '\and remove added methods which are not present in the repository version.'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1038
            labels := #('cancel' 'load'). 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1039
            values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1040
            default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1041
                            ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1042
                            ifFalse:[1. "i.e. cancel"].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1043
        ] ifFalse:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1044
            msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1045
            msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1046
        ]
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1047
    ].
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
  1048
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1049
    msg := msg bindWith:onlyInRep size printString 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1050
               with:onlyHere size printString 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1051
               with:changed size printString
1050
8f17906acefd *** empty log message ***
penk
parents: 1048
diff changeset
  1052
               with:aClass name allBold
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  1053
               with:changedClassDefinitions size printString
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  1054
               with:singleChangeSelector.
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1055
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1056
    answer := (Dialog confirmWithCancel:msg withCRs
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1057
           labels:(resources array:labels)
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1058
           values:values 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1059
           default:default).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1060
    answer isNil ifTrue:[^ self].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1061
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1062
    self activityNotification:'updating...'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1063
    changedClasses := IdentitySet new.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1064
1058
90807c795eb5 do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1057
diff changeset
  1065
"/    Class withoutUpdatingChangesDo:[
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1066
        answer == #load ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1067
            changedClassDefinitions do:[:eachChangeArr | "apply this change (go to rep-version)"
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1068
                                         |cHere cRep| 
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1069
                                         cHere := eachChangeArr at:1.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1070
                                         cRep := eachChangeArr at:2.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1071
                                         cRep apply.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1072
                                         cRep isMethodChange ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1073
                                             cRep changeMethod setPackage:(cRep changeClass package).
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1074
                                             changedClasses add:cRep changeClass.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1075
                                         ]
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1076
                       ].
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1077
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1078
        onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1079
                                     eachChange apply.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1080
                                     eachChange isMethodChange ifTrue:[
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1081
                                         eachChange changeMethod setPackage:(eachChange changeClass package).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1082
                                         changedClasses add:eachChange changeClass.   
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1083
                                     ]
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1084
                     ].
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1085
        answer == #load ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1086
            onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1087
                                         |cClass cSel|
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1088
                                         eachChange isMethodChange ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1089
                                             cClass := eachChange changeClass.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1090
                                             cSel := eachChange selector.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1091
                                             cClass removeSelector:cSel.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1092
                                         ]
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1093
                        ].
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1094
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1095
                                         |cHere cRep| 
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1096
                                         cHere := eachChangeArr at:1.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1097
                                         cRep := eachChangeArr at:2.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1098
                                         cRep apply.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1099
                                         cRep isMethodChange ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1100
                                             cRep changeMethod setPackage:(cRep changeClass package).
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1101
                                             changedClasses add:cRep changeClass.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1102
                                         ]
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1103
                       ].
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1104
            "/ make all methods belong to the classes project
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1105
            self setPackageOfAllMethodsIn:aClass to:aClass package.
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1106
            versionMethodsRep size == 1 ifTrue:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1107
                versionMethodsRep first apply.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1108
                self setPackageOfAllMethodsIn:aClass to:aClass package.
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1109
            ] ifFalse:[
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1110
                self halt
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1111
            ].
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1112
        ].
1058
90807c795eb5 do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1057
diff changeset
  1113
"/    ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1114
    changedClasses do:[:eachClass |
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1115
         eachClass changed:#projectOrganization.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1116
    ].
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1117
    Smalltalk changed:#projectOrganization.
1044
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
  1118
369634bb26de *** empty log message ***
ps
parents: 1035
diff changeset
  1119
    "Modified: / 7.2.2001 / 18:18:32 / ps"
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1120
!
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1121
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1122
compareClassWithRepository:aClass
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1123
    "open a diff-textView comparing the current (in-image) version
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1124
     against its orgiginal version found in the repository."
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1125
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1126
    |currentClass resources
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1127
     aStream comparedSource currentSource v rev revString thisRevString mgr
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1128
     nm msg rev2 newestRev
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1129
     containerModule containerPackage containerFile rslt
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1130
     lastModule lastPackage pkg|
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1131
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1132
    resources := ResourcePack for:self.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1133
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1134
    currentClass := aClass theNonMetaclass.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1135
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1136
    nm := currentClass name.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1137
    mgr := currentClass sourceCodeManager.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1138
    mgr isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1139
        self warn:'No sourceCode manager - check settings'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1140
        ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1141
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1142
    rev := currentClass binaryRevision.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1143
    rev2 := currentClass revision.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1144
    rev isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1145
        rev := rev2
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1146
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1147
    rev isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1148
        self warn:'Class seems to be not yet in the repository'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1149
        ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1150
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1151
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1152
    "/
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1153
    "/ class in repository - ask for revision
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1154
    "/
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1155
    newestRev := mgr newestRevisionOf:currentClass.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1156
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1157
    msg := resources string:'compare to revision: (empty for newest)'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1158
    rev notNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1159
        msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1160
                                       with:nm allBold with:rev).
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1161
        (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1162
            msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1163
                                           with:rev2)
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1164
        ]
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1165
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1166
    newestRev notNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1167
        msg := msg , '\' , (resources string:'Newest in reporitory is %1.'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1168
                                       with:newestRev)
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1169
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1170
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1171
    rev := SourceCodeManagerUtilities
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1172
                askForExistingRevision:msg 
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1173
                title:'Compare with repository' 
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1174
                class:currentClass.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1175
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1176
    (rev notNil or:[containerFile notNil]) ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1177
        rev notNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1178
            rev withoutSpaces isEmpty ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1179
                msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1180
                "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1181
                aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1182
                revString := '(newest: ' , (newestRev ? '???') , ')'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1183
            ] ifFalse:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1184
                msg := 'extracting previous %1'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1185
                aStream := mgr getSourceStreamFor:currentClass revision:rev.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1186
                revString := rev
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1187
            ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1188
        ] ifFalse:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1189
            msg := 'extracting newest version from ' , containerModule , '/' , containerPackage, '/' , containerFile.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1190
            aStream := mgr streamForClass:nil fileName:containerFile revision:#newest directory:containerPackage module:containerModule cache:false.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1191
            revString := '???'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1192
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1193
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1194
        aStream isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1195
            self warn:'could not extract source from repository'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1196
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1197
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1198
        aStream class readErrorSignal handle:[:ex |
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1199
            self warn:('read error while reading extracted source\\' , ex errorString) withCRs.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1200
            aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1201
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1202
        ] do:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1203
            comparedSource := aStream contents asString.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1204
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1205
        aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1206
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1207
        self activityNotification:'generating current source ...'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1208
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1209
        aStream := '' writeStream.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1210
        Method flushSourceStreamCache.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1211
        currentClass fileOutOn:aStream withTimeStamp:false.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1212
        currentSource := aStream contents asString.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1213
        aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1214
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1215
        self activityNotification:'comparing  ...'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1216
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1217
        comparedSource = currentSource ifTrue:[
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1218
            self information:(resources string:'Versions are identical: %1' with:currentClass name).
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1219
        ] ifFalse:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1220
            thisRevString := currentClass revision.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1221
            thisRevString isNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1222
                thisRevString := 'no revision'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1223
            ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1224
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1225
            revString = '(newest)' ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1226
                (rev := mgr newestRevisionOf:currentClass) notNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1227
                    revString := '(newest is ' , rev , ')'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1228
                ]
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1229
            ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1230
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1231
            self activityNotification:'comparing  ...'.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1232
1070
3f87ae65a554 UserPreference access
Claus Gittinger <cg@exept.de>
parents: 1068
diff changeset
  1233
            (UserPreferences versionDiffViewerClass)
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1234
                  openOnClass:currentClass
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1235
                  labelA:('repository: ' , revString)
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1236
                  sourceA:comparedSource
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1237
                  labelB:('current: (based on: ' , thisRevString , ')')
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1238
                  sourceB:currentSource
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1239
                  title:('comparing ' , currentClass name).
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1240
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1241
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1242
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1243
    "
997
c55b39b6c7a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1244
      self compareClassWithRepository:Array
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1245
    "
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1246
!
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1247
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1248
createSourceContainerForClass:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1249
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1250
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1251
    |resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1252
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1253
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1254
    ^ self 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1255
        defineSourceContainerForClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1256
        title:(resources string:'Repository information for %1' with:aClass name)
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1257
        text:(resources string:'Create new repository container for ''%1''' with:aClass name allBold)
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1258
        createDirectories:true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1259
        createContainer:true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1260
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1261
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1262
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1263
defineSourceContainerForClass:aClass title:title text:boxText createDirectories:createDirs createContainer:createContainer
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1264
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1265
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1266
    |box className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1267
     oldModule oldPackage oldFileName
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1268
     module package fileName nameSpace nameSpacePrefix
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1269
     y component info project nm mgr creatingNew msg 
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1270
     answer doCheckinWithoutAsking forceCheckIn resources rslt note
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1271
     requiredPackage|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1272
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1273
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1274
    aClass isLoaded ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1275
        self warn:(resources string:'Please load the %1-class first' with:aClass name).
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1276
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1277
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1278
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1279
    className := aClass name.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1280
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1281
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1282
    "/ defaults, if nothing at all is known
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1283
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1284
    (module := LastModule) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1285
        module := (OperatingSystem getLoginName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1286
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1287
    (package := LastPackage) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1288
        package := 'private'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1289
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1290
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1291
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1292
    "/ try to extract some useful defaults from the current project
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1293
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1294
    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1295
        package isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1296
            (nm := project repositoryDirectory) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1297
                nm := project name
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1298
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1299
            package := nm.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1300
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1301
        module isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1302
            (nm := project repositoryModule) notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1303
                module := nm
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1304
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1305
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1306
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1307
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1308
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1309
    "/ ask the sourceCodeManager if it knows anything about that class
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1310
    "/ if so, take that as a default.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1311
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1312
    info := (mgr := aClass sourceCodeManager) sourceInfoOfClass:aClass.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1313
    info notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1314
        module ~= LastModule ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1315
            (info includesKey:#module) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1316
                module := (info at:#module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1317
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1318
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1319
        package ~= LastPackage ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1320
            (info includesKey:#directory) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1321
                package := (info at:#directory).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1322
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1323
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1324
        fileName := mgr containerFromSourceInfo:info.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1325
        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1326
            nameSpacePrefix := nameSpace name , '::'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1327
            (fileName startsWith:nameSpacePrefix) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1328
                fileName := fileName copyFrom:(nameSpacePrefix size + 1).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1329
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1330
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1331
"/        (info includesKey:#fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1332
"/            fileName := (info at:#fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1333
"/        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1334
"/            (info includesKey:#expectedFileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1335
"/                fileName := (info at:#expectedFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1336
"/            ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1337
"/                (info includesKey:#classFileNameBase) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1338
"/                    fileName := (info at:#classFileNameBase) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1339
"/                ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1340
"/            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1341
"/        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1342
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1343
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1344
    fileName isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1345
        aClass nameSpace ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1346
             fileName := aClass nameWithoutPrefix , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1347
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1348
             fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1349
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1350
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1351
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1352
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1353
        module replaceAll:$\ with:$/.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1354
        package replaceAll:$\ with:$/.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1355
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1356
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1357
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1358
    "/ check for conflicts (i.e. if such a container already exists) ...
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1359
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1360
    doCheckinWithoutAsking := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1361
    (mgr checkForExistingContainerInModule:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1362
                                   package:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1363
                                 container:fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1364
        answer := Dialog confirmWithCancel:(resources 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1365
                            string:'About to change the source container.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1366
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1367
Notice: there is a container for %1 in:
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1368
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1369
    %2 / %3 / %4
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1370
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1371
Do you want to change it or check right into that container ?'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1372
                            with:className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1373
                            with:module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1374
                            with:package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1375
                            with:fileName)
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1376
                labels:(resources array:#('Cancel' 'Check in' 'Change')).
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1377
        answer isNil ifTrue:[AbortSignal raise].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1378
        answer ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1379
            doCheckinWithoutAsking := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1380
            oldModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1381
            oldPackage := package.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1382
            oldFileName := fileName
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1383
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1384
            doCheckinWithoutAsking := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1385
            creatingNew := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1386
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1387
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1388
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1389
    doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1390
        "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1391
        "/ open a dialog for this
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1392
        "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1393
        (mgr checkForExistingContainerInModule:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1394
                                       package:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1395
                                     container:fileName) ifFalse:[
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1396
            note := 'Notice: class seems to have no container yet.'.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1397
            creatingNew := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1398
        ] ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1399
            creatingNew := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1400
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1401
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1402
        rslt := self 
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1403
                askForContainer:boxText title:title note:note
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1404
                initialModule:module initialPackage:package initialFileName:fileName
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1405
                forNewContainer:true.        
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1406
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1407
        rslt isNil ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1408
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1409
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1410
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1411
        module := rslt at:#module.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1412
        package := rslt at:#package.
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1413
        fileName := rslt at:#fileName.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1414
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1415
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1416
    (fileName endsWith:',v') ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1417
        fileName := fileName copyWithoutLast:2
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1418
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1419
    (fileName endsWith:'.st') ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1420
        fileName := fileName , '.st'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1421
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1422
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1423
    "/ we require the packageID to be <module>:<container-dir>
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1424
    "/ check for this ...
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1425
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1426
    requiredPackage := ((module ? '') , ':' , (package ? '')) asSymbol.
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1427
    requiredPackage ~= aClass package ifTrue:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1428
"/        doCheckinWithoutAsking ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1429
"/            (self confirm:'Change the classes packageID to: ''', requiredPackage , ''' ?')
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1430
"/            ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1431
"/                ^ false
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1432
"/            ]
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1433
"/        ].
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1434
        aClass allSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage].
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1435
        aClass package:requiredPackage.
981
91e69bd0352a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
  1436
        aClass changed:#projectOrganization.
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1437
        Smalltalk changed:#projectOrganization with:(Array with:aClass).
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1438
    ].
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  1439
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1440
    info := aClass revisionInfo.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1441
    info notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1442
        (info includesKey:#repositoryPathName) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1443
            info := nil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1444
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1445
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1446
    info isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1447
        creatingNew ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1448
            doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1449
                (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1450
                    confirm:(resources string:'The repository already contains a container named "%3" in "%1/%2" !!\\Checkin %4 anyway ? (DANGER - be careful)'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1451
                         withArgs:(Array with:module with:package with:fileName with:className)) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1452
                    noLabel:'Cancel')
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1453
                ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1454
                    ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1455
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1456
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1457
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1458
1004
1bd564960810 dont ask if a version method should be created - just do it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
  1459
        true "doCheckinWithoutAsking" ifFalse:[
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1460
            answer := Dialog 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1461
                 confirmWithCancel:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1462
                 labels:(resources array:#( 'Cancel' 'No' 'Yes')).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1463
            answer isNil ifTrue:[^ false].
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1464
        ] ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1465
            answer := true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1466
        ].
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1467
        answer ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1468
            aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1469
                                               inModule:module 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1470
                                               package:package 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1471
                                               container:fileName).
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  1472
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1473
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1474
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1475
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1476
    "/ check for the module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1477
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1478
    (mgr checkForExistingModule:module) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1479
        (createDirs or:[creatingNew]) ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1480
            self warn:(resources string:'A module named %1 does not exist in the source code management' with:module).
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1481
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1482
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1483
        (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1484
            confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1485
            noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1486
        ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1487
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1488
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1489
        (mgr createModule:module) ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1490
            self warn:(resources string:'Cannot create new module: %1' with:module).
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1491
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1492
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1493
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1494
    LastModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1495
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1496
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1497
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1498
    "/ check for the package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1499
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1500
    (mgr checkForExistingModule:module package:package) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1501
        (createDirs or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1502
            self warn:(resources string:'a package named %1 does not exist module %2' with:module with:package).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1503
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1504
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1505
        (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1506
            confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1507
            noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1508
        ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1509
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1510
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1511
        (mgr createModule:module package:package) ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1512
            self warn:(resources string:'Cannot create new package: %1 (in module %2)' with:package with:module).
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1513
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1514
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1515
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1516
    LastPackage := package.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1517
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1518
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1519
    "/ check for the container itself
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1520
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1521
    (mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1522
        creatingNew ifTrue:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1523
            self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1524
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1525
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1526
"/            (oldModule notNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1527
"/            and:[(oldModule ~= module)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1528
"/                 or:[oldPackage ~= package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1529
"/                 or:[oldFileName ~= fileName]]])
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1530
"/            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1531
"/                self warn:(resources string:'no change').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1532
"/                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1533
"/            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1534
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1535
        doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1536
            (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1537
                confirm:(resources string:'check %1 into the existing container
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1538
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1539
    %2 / %3 / %4  ?'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1540
                                with:className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1541
                                with:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1542
                                with:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1543
                                with:fileName) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1544
                noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1545
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1546
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1547
            ].  
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1548
        ].  
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1549
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1550
        aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1551
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1552
        oldFileName notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1553
            msg := ('forced checkin / source container change from ' , oldFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1554
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1555
            msg := 'defined source container'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1556
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1557
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1558
        (forceCheckIn := doCheckinWithoutAsking) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1559
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1560
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1561
                fileName:fileName 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1562
                directory:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1563
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1564
                logMessage:msg)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1565
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1566
                doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1567
                    (Dialog 
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1568
                        confirm:'No easy merge seems possible; force checkin (no merge) ?'
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1569
                        noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1570
                    ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1571
                        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1572
                    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1573
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1574
                forceCheckIn := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1575
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1576
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1577
        forceCheckIn ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1578
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1579
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1580
                fileName:fileName 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1581
                directory:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1582
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1583
                logMessage:msg
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1584
                force:true)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1585
            ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1586
                self warn:(resources string:'Failed to check into existing container.').
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1587
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1588
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1589
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1590
        ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1591
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1592
        (createContainer or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1593
            (Dialog
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1594
                 confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1595
                                      with:fileName with:module with:package) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1596
                 noLabel:'Cancel') ifFalse:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1597
                ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1598
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1599
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1600
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1601
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1602
    (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1603
            createContainerFor:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1604
            inModule:module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1605
            package:package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1606
            container:fileName) ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1607
        self warn:(resources string:'Failed to create container.').
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1608
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1609
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1610
    ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1611
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  1612
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1613
getLogMessageFor:aString
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1614
    "get a log message for checking in a class.
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1615
     Return the message or nil if aborted."
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1616
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1617
    |resources logMsg|
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1618
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1619
    resources := ResourcePack for:self.
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1620
    logMsg := Dialog
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1621
        requestText:(resources string:'enter log message for: %1' with:aString)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1622
        lines:10
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1623
        columns:70
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1624
        initialAnswer:LastSourceLogMessage.
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1625
    logMsg notNil ifTrue:[
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1626
        LastSourceLogMessage := logMsg
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1627
    ].
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1628
    ^ logMsg
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1629
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1630
    "
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
  1631
     SourceCodeManagerUtilities getLogMessageFor:'hello'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1632
    "
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1633
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1634
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1635
!
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1636
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1637
getLogMessageFor:aString withButton:additionalButton
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1638
    "get a log message for checking in a class.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1639
     Return the message or nil if aborted."
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1640
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1641
    |resources logMsg dialog textHolder|
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1642
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1643
    resources := ResourcePack for:self.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1644
    textHolder := '' asValue.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1645
    dialog := Dialog 
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1646
                forRequestText:(resources string:'enter log message for: %1' with:aString)
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1647
                lines:10
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1648
                columns:70
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1649
                initialAnswer:LastSourceLogMessage
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1650
                model:textHolder.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1651
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1652
    additionalButton notNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1653
        dialog addButton:additionalButton before:(dialog okButton).
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1654
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1655
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1656
    dialog open.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1657
    dialog accepted ifFalse:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1658
        ^ nil.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1659
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1660
    logMsg := textHolder value.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1661
"/    logMsg := Dialog
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1662
"/        requestText:(resources string:'enter log message for: %1' with:aString)
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1663
"/        lines:10
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1664
"/        columns:70
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1665
"/        initialAnswer:LastSourceLogMessage.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1666
    logMsg notNil ifTrue:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1667
        LastSourceLogMessage := logMsg
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1668
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1669
    ^ logMsg
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1670
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1671
    "
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1672
     SourceCodeManagerUtilities getLogMessageFor:'hello'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1673
     SourceCodeManagerUtilities getLogMessageFor:'hello' withButton:(Button label:'foo')
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1674
    "
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1675
!
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1676
1068
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1677
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1678
    "check-out all previous versions of aClass and retrieve the history of selector.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1679
     Return a dictionary associating revision with a changeList entries for that method.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1680
     Unfinished - need a GUI for that."
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1681
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1682
    |mgr theClass revisionLog revisions items s entriesPerRevision previousVersion|
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1683
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1684
    mgr := aClass theNonMetaclass sourceCodeManager.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1685
    theClass := aClass theNonMetaclass.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1686
    revisionLog := mgr
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1687
                        revisionLogOf:theClass
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1688
                        numberOfRevisions:numberOfRevisionsOrNil.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1689
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1690
    revisions := revisionLog at:#revisions.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1691
    items := revisions collect:[:each | |rev date who|
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1692
                                    rev := each at:#revision.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1693
                                    date := each at:#date.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1694
                                    who := each at:#author.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1695
                                    rev allBold , ' [' , date , ' by ' , who , ']'
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1696
                               ].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1697
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1698
    revisions := revisions collect:[:each | each at:#revision].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1699
    revisions addFirst:#current.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1700
    entriesPerRevision := Dictionary new.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1701
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1702
    previousVersion := nil.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1703
    revisions reverseDo:[:eachRevision |
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1704
        |srcStream entries thisVersion|
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1705
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1706
        eachRevision == #current ifTrue:[
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1707
            s := '' writeStream.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1708
            theClass fileOutOn:s withTimeStamp:false.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1709
            srcStream := s contents readStream.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1710
        ] ifFalse:[
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1711
            self activityNotification:('checking out revision ' , eachRevision , '...').
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1712
            srcStream := mgr getSourceStreamFor:theClass revision:eachRevision.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1713
        ].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1714
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1715
        entries := ChangeSet fromStream:srcStream.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1716
        srcStream close.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1717
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1718
        "/ remove all definitions       
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1719
        entries := entries select:[:each | each isMethodChange].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1720
        "/ remove all methods which are for other selectors      
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1721
        entries := entries select:[:each | each selector == selector].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1722
        "/ remove all methods which are for private subclasses      
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1723
        entries := entries select:[:each | each className = aClass name].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1724
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1725
        entries size == 1 ifTrue:[
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1726
            "/ the method is there
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1727
            thisVersion := entries first.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1728
            (previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1729
                "/ no change
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1730
            ] ifFalse:[
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1731
                entriesPerRevision at:eachRevision put:thisVersion.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1732
            ].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1733
        ] ifFalse:[
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1734
            "/ the method is not there
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1735
        ].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1736
        previousVersion := thisVersion.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1737
    ].
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1738
    self halt:'unfinished code'.
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1739
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1740
    "
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1741
     self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1742
     self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1743
    "
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1744
!
200fbe3c8bf3 prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1745
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1746
removeSourceContainerForClass:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1747
    "show container & let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1748
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1749
    ^ self removeSourceContainerForClass:aClass confirm:true warn:true
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1750
!
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1751
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1752
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1753
    "show container & optionally let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1754
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1755
    |module package fileName info mgr resources|
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1756
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1757
    resources := ResourcePack for:self.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1758
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1759
    aClass isLoaded ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1760
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1761
            self warn:(resources string:'Please load the class first.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1762
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1763
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1764
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1765
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1766
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1767
    "/ ask the sourceCodeManager if it knows anything about that class
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1768
    "/ if so, take that as a default.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1769
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1770
    mgr := aClass sourceCodeManager.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1771
    mgr isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1772
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1773
            self warn:(resources string:'No sourceCodeManagement.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1774
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1775
        ^ false
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1776
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1777
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1778
    info := mgr sourceInfoOfClass:aClass.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1779
    info notNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1780
        (info includesKey:#module) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1781
            module := (info at:#module).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1782
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1783
        (info includesKey:#directory) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1784
            package := (info at:#directory).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1785
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1786
        fileName := mgr containerFromSourceInfo:info.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1787
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1788
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1789
    module isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1790
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1791
            self warn:(resources string:'classes module is unknown.\\It seems to not have a container.') withCRs.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1792
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1793
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1794
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1795
    package isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1796
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1797
            self warn:(resources string:'classes package is unknown.\\It seems to not have a container.') withCRs.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1798
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1799
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1800
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1801
    fileName isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1802
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1803
            self warn:(resources string:'classes container fileName is unknown.\\It seems to not have a container.') withCRs.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1804
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1805
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1806
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1807
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1808
    OperatingSystem isMSDOSlike ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1809
        module replaceAll:$\ with:$/.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1810
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1811
    OperatingSystem isMSDOSlike ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1812
        package replaceAll:$\ with:$/.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1813
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1814
    (mgr checkForExistingContainerInModule:module 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1815
                                   package:package 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1816
                                 container:fileName) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1817
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1818
            self warn:(resources string:'Class has no source container.') withCRs.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1819
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1820
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1821
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1822
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1823
    doConfirm ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1824
        (Dialog
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1825
            choose:(resources 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1826
                        string:'Please confirm removal of the container for %1:
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1827
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1828
container:    %2 / %3 / %4
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1829
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1830
Really remove ?' 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1831
                        with:aClass name 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1832
                        with:module 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1833
                        with:package 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1834
                        with:fileName) 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1835
            labels:(Array 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1836
                        with:(resources string:'no') 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1837
                        with:(resources string:'remove'))
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1838
            values:#(false true)
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1839
            default:false) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1840
            ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1841
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1842
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1843
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1844
    (mgr removeContainerFor:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1845
                   inModule:module
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1846
                    package:package
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1847
                  container:fileName) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1848
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1849
            self warn:(resources string:'failed to remove container.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1850
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1851
        ^ true.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1852
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  1853
    ^ false
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1854
!
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1855
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1856
repositoryLogOf:aClass onto:aStream
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1857
    |info rv mgr info2 module fn msg s|
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1858
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1859
    info := aClass revisionInfo.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1860
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1861
    rv := aClass binaryRevision.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1862
    rv notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1863
        aStream nextPutLine:'**** Loaded classes binary information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1864
        aStream nextPutLine:'  Binary based upon : ' , rv.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1865
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1866
    ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1867
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1868
    info notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1869
        mgr := aClass sourceCodeManager.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1870
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1871
        (info includesKey:#revision) ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1872
            aStream nextPutLine:'WARNING:'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1873
            aStream nextPutLine:'  The class seems not to be loaded from the repository.'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1874
            aStream nextPutLine:'  Check carefully before checking anything in.'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1875
            aStream nextPutLine:'  (i.e. compare with repository for renamed class(es), same-name but unrelated etc.)'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1876
            aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1877
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1878
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1879
        aStream nextPutLine:'**** Classes source information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1880
        s := info at:#repositoryPath ifAbsent:nil.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1881
        s notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1882
            aStream nextPutLine:'  Source repository : ' , s
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1883
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1884
        aStream nextPutLine:'  Filename ........ : ' , (info at:#fileName ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1885
        aStream nextPutLine:'  Revision ........ : ' , (info at:#revision ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1886
        aStream nextPutLine:'  Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1887
        aStream nextPutLine:'  Checkin user .... : ' , (info at:#user ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1888
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1889
        (info2 := aClass packageSourceCodeInfo) notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1890
            aStream nextPutLine:'  Repository: ..... : ' , (info2 at:#module ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1891
            aStream nextPutLine:'  Directory: ...... : ' , (info2 at:#directory ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1892
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1893
        aStream nextPutLine:'  Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?').
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1894
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1895
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1896
        mgr notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1897
            aStream nextPutLine:'**** Repository information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1898
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1899
            module := info2 at:#module ifAbsent:nil.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1900
            module notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1901
                aStream nextPutLine:('  CVS Root ......: ' , 
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1902
                                    ((mgr repositoryNameForModule:module) ifNil:[mgr repositoryName , ' (default)'])).
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1903
            ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1904
            mgr writeRevisionLogOf:aClass to:aStream.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1905
        ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1906
    ] ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1907
        aStream nextPutLine:'No revision info found'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1908
        aClass isLoaded ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1909
            aStream cr; nextPutAll:'This is an autoloaded class - you may see more after its loaded.'
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1910
        ] ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1911
            fn := aClass classFilename.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1912
            aClass wasAutoloaded ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1913
                msg := 'This class was autoloaded.'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1914
                fn notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1915
                    msg := msg , ' (from ''' , fn , ''')'.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1916
                ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1917
            ] ifFalse:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1918
                fn notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1919
                    msg := 'This class was loaded from ''' , fn , '''.'
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1920
                ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1921
            ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1922
            msg notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1923
                aStream cr; nextPutAll:msg.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1924
            ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1925
        ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1926
    ]
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1927
!
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  1928
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1929
setPackageOfAllMethodsIn:aClass to:aPackage
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1930
    "make all methods belong to the classes project"
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1931
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1932
    |anyChange anyChangeHere|
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1933
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1934
    anyChange := false.
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1935
    aClass withAllPrivateClassesDo:[:eachClass |
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1936
        anyChangeHere := false.
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1937
        eachClass allSelectorsAndMethodsDo:[:sel :mthd | 
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1938
            mthd package ~= aPackage ifTrue:[
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1939
                mthd setPackage:aPackage.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1940
                anyChangeHere := true.
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1941
            ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1942
        ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1943
        anyChangeHere ifTrue:[
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1944
            eachClass changed:#projectOrganization
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1945
        ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1946
        anyChangeHere ifTrue:[anyChange := true].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1947
    ].
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1948
    anyChange ifTrue:[
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1949
       Smalltalk changed:#projectOrganization
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
  1950
    ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  1951
    ^ anyChange
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1952
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1953
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1954
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1955
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1956
version
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  1957
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.65 2001-10-04 17:26:38 cg Exp $'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1958
! !