SourceCodeManagerUtilities.st
author ps
Fri, 21 Jan 2000 13:05:39 +0100
changeset 886 401f915dd118
parent 882 8af38187135c
child 893 09543b968f15
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
Object subclass:#SourceCodeManagerUtilities
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
     2
        instanceVariableNames:''
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
     3
        classVariableNames:'LastSourceLogMessage LastModule LastPackage'
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
     4
        poolDictionaries:''
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
     5
        category:'System-SourceCodeManagement'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
documentation
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
    utility code which is useful at more than one place
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
    (extracted from the browser)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
    [author:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
        Claus Gittinger (cg@exept)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
    [see also:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
    [instance variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
    [class variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
!SourceCodeManagerUtilities class methodsFor:'utilities'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
    28
checkinClass:aClass
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
    29
    "check a class into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
    30
     Asks interactively for log-message."
882
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
    31
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
    32
    ^ self checkinClass:aClass withLog:nil
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
    33
!
8af38187135c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
    34
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    35
checkinClass:aClass withLog:aLogMessageOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
    36
    "check a class into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
    37
     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
    38
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    39
    |logMessage info mgr pri resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    40
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    41
    aClass isLoaded ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    42
        self information:'cannot checkin unloaded classes (' , aClass name , ').'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
    43
        ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    44
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    45
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    46
    aLogMessageOrNil isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    47
        logMessage := SourceCodeManagerUtilities getLogMessageFor:aClass name.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    48
        logMessage isNil ifTrue:[^ self].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    49
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    50
        logMessage := aLogMessageOrNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    51
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    52
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    53
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    54
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    55
    mgr := (aClass sourceCodeManager).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    56
    info := mgr sourceInfoOfClass:aClass.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    57
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    58
    (info isNil 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    59
    or:[(info at:#fileName ifAbsent:nil) isNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    60
    or:[(info at:#module ifAbsent:nil) isNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    61
    or:[(info at:#directory ifAbsent:nil) isNil]]]) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    62
        (self createSourceContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    63
"/            self warn:'did not create a container for ''' , aClass name , ''''.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
    64
            ^ false
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    65
        ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
    66
        ^ true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    67
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    68
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    69
    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
    70
    pri := Processor activePriority.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    71
    Processor activeProcess withPriority:pri-1 to:pri
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    72
    do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    73
        |revision aborted freshCreated|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    74
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    75
        freshCreated := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    76
        revision := aClass revision.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    77
        revision isNil ifTrue:[ 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    78
            "/ mhmh - check if it has a container.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    79
            (mgr checkForExistingContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    80
                (self createSourceContainerForClass:aClass) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    81
                    self warn:'did not create a container for ''' , aClass name , ''''.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    82
                ] ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    83
                    freshCreated := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    84
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    85
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    86
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    87
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    88
        freshCreated ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    89
            aborted := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    90
            Object abortSignal handle:[:ex |
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    91
                aborted := true.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
    92
                ex return.
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
    93
                ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    94
            ] do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    95
                (mgr checkinClass:aClass logMessage:logMessage) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    96
                    Transcript showCR:'checkin of ''' , aClass name , ''' failed'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    97
                    self warn:'checkin of ''' , aClass name asText allBold , ''' failed'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
    98
                    ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
    99
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   100
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   101
            aborted ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   102
                Transcript showCR:'checkin of ''' , aClass name , ''' aborted'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   103
                self warn:'checkin of ''' , aClass name , ''' aborted'.
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   104
                ^ false.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   105
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   106
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   107
    ].
881
f5872252e5f9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   108
    ^ true
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   109
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   110
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   111
checkinClasses:aClass
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   112
    "check a collection of classes into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   113
     Asks interactively for log-message."
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   114
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   115
    ^ self checkinClasses:aClass withLog:nil
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   116
!
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   117
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   118
checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   119
    "check a bunch of classes into the source repository.
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   120
     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
   121
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   122
    |classes logMessage resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   123
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   124
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   125
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   126
    (logMessage := aLogMessageOrNil) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   127
        logMessage := SourceCodeManagerUtilities getLogMessageFor:(resources string:'classes to checkin').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   128
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   129
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   130
    "/ ignore private classes
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   131
    classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   132
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   133
    classes do:[:aClass |
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   134
        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
   135
        "/ ca does not want boxes to pop up all over ...
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   136
        InformationSignal handle:[:ex |
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   137
            Transcript showCR:ex errorString
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   138
        ] do:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   139
            self checkinClass:aClass withLog:logMessage
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   140
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   141
    ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   142
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   143
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   144
createSourceContainerForClass:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   145
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   146
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   147
    |resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   148
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   149
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   150
    ^ self 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   151
        defineSourceContainerForClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   152
        title:(resources string:'Repository information for %1' with:aClass name)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   153
        text:(resources string:'CREATE_REPOSITORY' with:aClass name)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   154
        createDirectories:true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   155
        createContainer:true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   156
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   157
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   158
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   159
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
   160
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   161
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   162
    |box className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   163
     moduleHolder packageHolder fileNameHolder
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   164
     oldModule oldPackage oldFileName
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   165
     module package fileName nameSpace nameSpacePrefix
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   166
     y component info project nm mgr creatingNew msg 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   167
     answer doCheckinWithoutAsking forceCheckIn resources|
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   168
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   169
    resources := ResourcePack for:self.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   170
    aClass isLoaded ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   171
        self warn:'please load the class first'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   172
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   173
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   174
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   175
    className := aClass name.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   176
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   177
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   178
    "/ defaults, if nothing at all is known
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   179
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   180
    (module := LastModule) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   181
        module := (OperatingSystem getLoginName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   182
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   183
    (package := LastPackage) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   184
        package := 'private'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   185
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   186
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   187
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   188
    "/ 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
   189
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   190
    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   191
        package isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   192
            (nm := project repositoryDirectory) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   193
                nm := project name
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   194
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   195
            package := nm.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   196
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   197
        module isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   198
            (nm := project repositoryModule) notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   199
                module := nm
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   200
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   201
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   202
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   203
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   204
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   205
    "/ 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
   206
    "/ if so, take that as a default.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   207
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   208
    info := (mgr := aClass sourceCodeManager) sourceInfoOfClass:aClass.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   209
    info notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   210
        module ~= LastModule ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   211
            (info includesKey:#module) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   212
                module := (info at:#module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   213
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   214
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   215
        package ~= LastPackage ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   216
            (info includesKey:#directory) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   217
                package := (info at:#directory).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   218
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   219
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   220
        fileName := mgr containerFromSourceInfo:info.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   221
        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   222
            nameSpacePrefix := nameSpace name , '::'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   223
            (fileName startsWith:nameSpacePrefix) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   224
                fileName := fileName copyFrom:(nameSpacePrefix size + 1).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   225
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   226
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   227
"/        (info includesKey:#fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   228
"/            fileName := (info at:#fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   229
"/        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   230
"/            (info includesKey:#expectedFileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   231
"/                fileName := (info at:#expectedFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   232
"/            ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   233
"/                (info includesKey:#classFileNameBase) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   234
"/                    fileName := (info at:#classFileNameBase) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   235
"/                ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   236
"/            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   237
"/        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   238
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   239
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   240
    fileName isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   241
        aClass nameSpace ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   242
             fileName := aClass nameWithoutPrefix , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   243
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   244
             fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   245
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   246
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   247
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   248
    fileNameHolder := fileName asValue.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   249
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   250
        module replaceAll:$\ with:$/.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   251
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   252
    moduleHolder := module asValue.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   253
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   254
        package replaceAll:$\ with:$/.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   255
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   256
    packageHolder := package asValue.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   257
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   258
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   259
    "/ 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
   260
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   261
    doCheckinWithoutAsking := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   262
    (mgr checkForExistingContainerInModule:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   263
                                   package:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   264
                                 container:fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   265
        answer := Dialog confirmWithCancel:(resources 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   266
                            string:'About to change the source container.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   267
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   268
Notice: there is a container for %1 in:
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   269
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   270
    %2 / %3 / %4
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   271
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   272
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
   273
                            with:className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   274
                            with:module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   275
                            with:package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   276
                            with:fileName)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   277
                labels:(resources array:#('cancel' 'check in' 'change')).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   278
        answer isNil ifTrue:[AbortSignal raise].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   279
        answer ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   280
            doCheckinWithoutAsking := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   281
            oldModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   282
            oldPackage := package.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   283
            oldFileName := fileName
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   284
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   285
            doCheckinWithoutAsking := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   286
            creatingNew := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   287
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   288
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   289
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   290
    doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   291
        "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   292
        "/ open a dialog for this
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   293
        "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   294
        box := DialogBox new.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   295
        box label:title.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   296
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   297
        component := box addTextLabel:boxText withCRs.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   298
        component adjust:#left; borderWidth:0.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   299
        box addVerticalSpace.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   300
        box addVerticalSpace.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   301
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   302
        y := box yPosition.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   303
        component := box addTextLabel:(resources string:'Module:').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   304
        component width:0.4; adjust:#right.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   305
        box yPosition:y.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   306
        component := box addInputFieldOn:moduleHolder tabable:true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   307
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   308
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   309
        box addVerticalSpace.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   310
        y := box yPosition.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   311
        component := box addTextLabel:'Package:'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   312
        component width:0.4; adjust:#right.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   313
        box yPosition:y.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   314
        component := box addInputFieldOn:packageHolder tabable:true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   315
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   316
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   317
        box addVerticalSpace.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   318
        y := box yPosition.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   319
        component := box addTextLabel:'Filename:'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   320
        component width:0.4; adjust:#right.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   321
        box yPosition:y.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   322
        component := box addInputFieldOn:fileNameHolder tabable:true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   323
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   324
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   325
        box addVerticalSpace.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   326
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   327
        (mgr checkForExistingContainerInModule:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   328
                                       package:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   329
                                     container:fileName) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   330
            component := box addTextLabel:'Notice: class seems to have no container yet.'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   331
            component adjust:#left; borderWidth:0.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   332
            creatingNew := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   333
        ] ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   334
            creatingNew := false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   335
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   336
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   337
        box addVerticalSpace.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   338
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   339
        box addAbortAndOkButtons.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   340
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   341
        box showAtPointer.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   342
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   343
        box accepted ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   344
            box destroy.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   345
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   346
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   347
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   348
        module := moduleHolder value withoutSpaces.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   349
        package := packageHolder value withoutSpaces.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   350
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   351
        fileName := fileNameHolder value withoutSpaces.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   352
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   353
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   354
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   355
    (fileName endsWith:',v') ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   356
        fileName := fileName copyWithoutLast:2
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   357
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   358
    (fileName endsWith:'.st') ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   359
        fileName := fileName , '.st'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   360
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   361
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   362
    info := aClass revisionInfo.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   363
    info notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   364
        (info includesKey:#repositoryPathName) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   365
            info := nil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   366
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   367
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   368
    info isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   369
        creatingNew ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   370
            doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   371
                (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   372
                    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
   373
                         withArgs:(Array with:module with:package with:fileName with:className)) withCRs
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   374
                    noLabel:'cancel')
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   375
                ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   376
                    ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   377
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   378
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   379
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   380
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   381
        doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   382
            (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   383
                confirm:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   384
                noLabel:'cancel')
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   385
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   386
                ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   387
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   388
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   389
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   390
        aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   391
                                           inModule:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   392
                                           package:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   393
                                           container:fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   394
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   395
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   396
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   397
    "/ check for the module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   398
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   399
    (mgr checkForExistingModule:module) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   400
        (createDirs or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   401
            self warn:(resources string:'a module named %1 does not exist in the source code management' with:module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   402
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   403
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   404
        (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   405
            confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   406
            noLabel:'cancel') 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   407
        ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   408
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   409
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   410
        (mgr createModule:module) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   411
            self warn:(resources string:'cannot create new module: %1' with:module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   412
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   413
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   414
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   415
    LastModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   416
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   417
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   418
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   419
    "/ check for the package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   420
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   421
    (mgr checkForExistingModule:module package:package) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   422
        (createDirs or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   423
            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
   424
            ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   425
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   426
        (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   427
            confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   428
            noLabel:'cancel') 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   429
        ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   430
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   431
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   432
        (mgr createModule:module package:package) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   433
            self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   434
            ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   435
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   436
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   437
    LastPackage := package.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   438
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   439
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   440
    "/ check for the container itself
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   441
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   442
    (mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   443
        creatingNew ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   444
            self warn:(resources string:'container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   445
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   446
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   447
"/            (oldModule notNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   448
"/            and:[(oldModule ~= module)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   449
"/                 or:[oldPackage ~= package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   450
"/                 or:[oldFileName ~= fileName]]])
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   451
"/            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   452
"/                self warn:(resources string:'no change').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   453
"/                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   454
"/            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   455
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   456
        doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   457
            (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   458
                confirm:(resources string:'check %1 into the existing container
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   459
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   460
    %2 / %3 / %4  ?'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   461
                                with:className
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   462
                                with:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   463
                                with:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   464
                                with:fileName) withCRs
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   465
                noLabel:'cancel') 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   466
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   467
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   468
            ].  
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
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   471
        aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   472
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   473
        oldFileName notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   474
            msg := ('forced checkin / source container change from ' , oldFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   475
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   476
            msg := 'defined source container'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   477
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   478
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   479
        (forceCheckIn := doCheckinWithoutAsking) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   480
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   481
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   482
                fileName:fileName 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   483
                directory:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   484
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   485
                logMessage:msg)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   486
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   487
                doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   488
                    (Dialog 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   489
                        confirm:'no easy merge seems possible; force checkin (no merge) ?'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   490
                        noLabel:'cancel') 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   491
                    ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   492
                        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   493
                    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   494
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   495
                forceCheckIn := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   496
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   497
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   498
        forceCheckIn ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   499
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   500
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   501
                fileName:fileName 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   502
                directory:package 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   503
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   504
                logMessage:msg
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   505
                force:true)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   506
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   507
                self warn:(resources string:'failed to check into existing container.').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   508
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   509
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   510
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   511
        ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   512
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   513
        (createContainer or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   514
            (Dialog
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   515
                 confirm:(resources string:'no container exists for %1 in %2/%3\\create ?' 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   516
                                      with:fileName with:module with:package) withCRs
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   517
                 noLabel:'cancel') ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   518
                ^ false
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
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   521
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   522
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   523
    (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   524
            createContainerFor:aClass
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   525
            inModule:module
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   526
            package:package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   527
            container:fileName) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   528
        self warn:(resources string:'failed to create container.').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   529
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   530
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   531
    ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   532
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   533
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   534
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
getLogMessageFor:aString
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
    "get a log message for checking in a class.
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
     Return the message or nil if aborted."
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   539
    |resources logMsg|
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
    resources := ResourcePack for:self.
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   542
    logMsg := Dialog
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
        requestText:(resources string:'enter log message for: %1' with:aString)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
        lines:10
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
        columns:70
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   546
        initialAnswer:LastSourceLogMessage.
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   547
    logMsg notNil ifTrue:[
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   548
        LastSourceLogMessage := logMsg
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   549
    ].
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   550
    ^ logMsg
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
    "
875
0fa0ac04cec2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
   553
     SourceCodeManagerUtilities getLogMessageFor:'hello'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
    "
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
version
886
401f915dd118 checkin from browser
ps
parents: 882
diff changeset
   562
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.6 2000-01-21 12:05:39 ps Exp $'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
! !