SourceCodeManagerUtilities.st
author Claus Gittinger <cg@exept.de>
Wed, 16 Jul 2014 14:35:45 +0200
changeset 3594 407ae2f32318
parent 3591 d86841bb0d5c
child 3602 d5a67c9e51dd
permissions -rw-r--r--
class: SourceCodeManagerUtilities changed: #diffSetOfProject:againstRepositoryVersionFrom:orTag:
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
"
920
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
ab68cf4c6ee6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    13
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#SourceCodeManagerUtilities
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    15
	instanceVariableNames:'manager resources confirmNewFiles'
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    16
	classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    17
		YesToAllNotification LastSourceLogMessages'
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    18
	poolDictionaries:''
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    19
	category:'System-SourceCodeManagement'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    24
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    25
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    26
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    27
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    28
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    29
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    30
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    32
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    33
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    34
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    35
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    36
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    37
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    38
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    utility code which is useful at more than one place
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    (extracted from the browser)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    [author:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        Claus Gittinger (cg@exept)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [see also:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [instance variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [class 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
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    55
!SourceCodeManagerUtilities class methodsFor:'instance creation'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    56
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    57
forManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    58
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    59
    ^self new setManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    60
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    61
    "Created: / 10-10-2011 / 11:45:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    62
!
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    63
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    64
new
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    65
    "return an initialized instance"
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    66
2969
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    67
    self == SourceCodeManagerUtilities ifTrue:[ 
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    68
        self abstractClassInstantiationError
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    69
    ].
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    70
    ^ self basicNew initialize.
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    71
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    72
    "Modified: / 25-07-2012 / 17:10:55 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    73
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    74
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    75
!SourceCodeManagerUtilities class methodsFor:'Signal constants'!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    76
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    77
yesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    78
    YesToAllNotification isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    79
        YesToAllNotification := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    80
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    81
    ^ YesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    82
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    83
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    84
yesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    85
    YesToAllQuery isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    86
        YesToAllQuery := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    87
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    88
    ^ YesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    89
! !
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    90
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    91
!SourceCodeManagerUtilities class methodsFor:'accessing'!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    92
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    93
default
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    94
2864
835ad5141223 changed: #default
Claus Gittinger <cg@exept.de>
parents: 2847
diff changeset
    95
    Default isNil ifTrue:[Default := SourceCodeManagerUtilitiesForContainerBasedManagers new].
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    96
    ^Default
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    97
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    98
    "Created: / 10-10-2011 / 11:28:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2864
835ad5141223 changed: #default
Claus Gittinger <cg@exept.de>
parents: 2847
diff changeset
    99
    "Modified: / 26-07-2012 / 20:31:52 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   100
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   101
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   102
lastModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   103
    "return the value of the static variable 'LastModule' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   104
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   105
    ^ LastModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   106
!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   107
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   108
lastModule:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   109
    "set the value of the static variable 'LastModule' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   110
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   111
    LastModule := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   112
!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   113
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   114
lastPackage
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   115
    "return the value of the static variable 'LastPackage' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   116
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   117
    ^ LastPackage
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   118
!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   119
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   120
lastPackage:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   121
    "set the value of the static variable 'LastPackage' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   122
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   123
    LastPackage := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   124
! !
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   125
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   126
!SourceCodeManagerUtilities class methodsFor:'error handling'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   127
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   128
doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   129
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   130
    (self default respondsTo: aMessage selector) ifTrue:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   131
        "Bad, method moved to instance side but not forwarded"
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   132
        self breakPoint: #jv.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   133
        self breakPoint: #cg.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   134
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   135
        ^aMessage sendTo: self default
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   136
    ] ifFalse:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   137
        ^super doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   138
    ]
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   139
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   140
    "Created: / 10-10-2011 / 14:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   141
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   142
2569
vrany
parents: 2556
diff changeset
   143
!SourceCodeManagerUtilities class methodsFor:'private-migration'!
vrany
parents: 2556
diff changeset
   144
vrany
parents: 2556
diff changeset
   145
compileForwarders
vrany
parents: 2556
diff changeset
   146
vrany
parents: 2556
diff changeset
   147
    "Utility method"
vrany
parents: 2556
diff changeset
   148
vrany
parents: 2556
diff changeset
   149
    "
vrany
parents: 2556
diff changeset
   150
        SourceCodeManagerUtilities compileForwarders.
vrany
parents: 2556
diff changeset
   151
    "
vrany
parents: 2556
diff changeset
   152
vrany
parents: 2556
diff changeset
   153
    self methodsDo:[:m|
vrany
parents: 2556
diff changeset
   154
        | sel |
vrany
parents: 2556
diff changeset
   155
        sel := m selector.
vrany
parents: 2556
diff changeset
   156
        ((self class includesSelector: sel) and: [(self class >> sel) source = m source]) ifTrue:[
vrany
parents: 2556
diff changeset
   157
            | source header |
vrany
parents: 2556
diff changeset
   158
vrany
parents: 2556
diff changeset
   159
            header := m source asStringCollection first.
vrany
parents: 2556
diff changeset
   160
            source := '%1
vrany
parents: 2556
diff changeset
   161
vrany
parents: 2556
diff changeset
   162
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   163
vrany
parents: 2556
diff changeset
   164
    self obsoleteMethodWarning: ''Please use instance protocol (SourceCodeManagerUtilities default doSomething)''.
vrany
parents: 2556
diff changeset
   165
vrany
parents: 2556
diff changeset
   166
    ^self default %1' bindWith: header with: header.
vrany
parents: 2556
diff changeset
   167
vrany
parents: 2556
diff changeset
   168
            self halt: 'Inspect source'.
vrany
parents: 2556
diff changeset
   169
            self class compile: source classified: m category.    
vrany
parents: 2556
diff changeset
   170
        ].
vrany
parents: 2556
diff changeset
   171
            
vrany
parents: 2556
diff changeset
   172
    ]
vrany
parents: 2556
diff changeset
   173
vrany
parents: 2556
diff changeset
   174
    "Created: / 11-10-2011 / 10:55:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2556
diff changeset
   175
! !
vrany
parents: 2556
diff changeset
   176
1806
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   177
!SourceCodeManagerUtilities class methodsFor:'resources'!
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   178
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   179
resourcePackage
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   180
    ^ #'stx:libtool'
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   181
! !
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   182
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
!SourceCodeManagerUtilities class methodsFor:'utilities'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   185
classIsNotYetInRepository:aClass withManager:mgr
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   186
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   187
    <resource: #obsolete>
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   188
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   189
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   190
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   191
    ^self default classIsNotYetInRepository:aClass withManager:mgr
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   192
!
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   193
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   194
nameOfExtensionsContainer
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   195
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   196
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   197
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   198
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   199
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   200
    ^self default nameOfExtensionsContainer
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   201
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   202
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   203
setPackageOfAllMethodsIn:aClass to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   204
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   205
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   206
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   207
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   208
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   209
    ^self default setPackageOfAllMethodsIn:aClass to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   210
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   211
    "Modified: / 10-10-2011 / 14:00:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   212
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   213
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   214
setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   215
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   216
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   217
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   218
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   219
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   220
    ^self default setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   221
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   222
    "Created: / 10-10-2011 / 14:00:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   223
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   224
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   225
sourceCodeManagerFor:aClass
3370
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   226
    |mgr assumption|
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   227
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   228
    mgr := aClass theNonMetaclass sourceCodeManager.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   229
    mgr isNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   230
        SourceCodeManager isNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   231
            "/ self warn:'SourceCodeManagement is disabled or not configured.\\Please setup in the Launcher.' withCRs.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   232
            ^ nil.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   233
        ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   234
        assumption := AbstractSourceCodeManager defaultManager ? CVSSourceCodeManager.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   235
        assumption notNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   236
            (self confirm:('Class does not seem to provide a valid sourceCodeManager.\\Assume %1 ?' bindWith:assumption managerTypeName) withCRs) ifFalse:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   237
                ^ nil
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   238
            ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   239
            mgr := assumption.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   240
        ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   241
    ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   242
    ^ mgr
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   243
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   244
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   245
sourceCodeOfClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   246
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   247
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   248
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   249
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   250
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   251
    ^self default sourceCodeOfClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   252
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   253
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   254
versionString:a isLessThan:b
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   255
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   256
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   257
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   258
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   259
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   260
    ^self default versionString:a isLessThan:b
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   261
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   262
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   263
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   264
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   265
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   266
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   267
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   268
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   269
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   270
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   271
    ^self default changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   272
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   273
    "Created: / 29-12-2011 / 14:28:08 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   274
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   275
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   276
changeSetForExtensionMethodsForPackage:packageToCheckOut revision:revisionOrNil orAskForRevision:askForRevision usingManager:aSourceCodeManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   277
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   278
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   279
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   280
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   281
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   282
    ^self default 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   283
        changeSetForExtensionMethodsForPackage:packageToCheckOut 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   284
        revision:revisionOrNil 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   285
        orAskForRevision:askForRevision 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   286
        usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   287
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   288
    "Created: / 29-12-2011 / 14:28:14 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   289
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   290
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   291
checkForExistingModule:module directory:directory container:containerFileName usingManager:mgr allowCreate:allowCreate
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   292
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   293
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   294
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   295
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   296
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   297
    ^self default checkForExistingModule:module directory:directory container:containerFileName usingManager:mgr allowCreate:allowCreate
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   298
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   299
    "Created: / 29-12-2011 / 14:30:37 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   300
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   301
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   302
checkForExistingModule:module directory:directory usingManager:mgr allowCreate:allowCreate
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   303
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   304
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   305
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   306
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   307
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   308
    ^self default checkForExistingModule:module directory:directory usingManager:mgr allowCreate:allowCreate
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   309
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   310
    "Created: / 29-12-2011 / 14:29:02 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   311
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   312
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   313
checkForExistingModule:module usingManager:mgr allowCreate:allowCreate
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   314
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   315
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   316
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   317
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   318
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   319
    ^self default checkForExistingModule:module usingManager:mgr allowCreate:allowCreate
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   320
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   321
    "Created: / 29-12-2011 / 14:30:00 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   322
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   323
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   324
checkinClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   325
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   326
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   327
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   328
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   329
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   330
    ^self default checkinClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   331
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   332
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   333
checkinClass:aClass withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   334
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   335
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   336
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   337
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   338
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   339
    ^self default checkinClass:aClass withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   340
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   341
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   342
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass
2569
vrany
parents: 2556
diff changeset
   343
vrany
parents: 2556
diff changeset
   344
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   345
vrany
parents: 2556
diff changeset
   346
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   347
vrany
parents: 2556
diff changeset
   348
    ^self default checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   349
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   350
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   351
checkinClasses:aCollectionOfClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   352
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   353
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   354
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   355
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   356
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   357
    ^self default checkinClasses:aCollectionOfClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   358
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   359
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   360
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   361
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   362
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   363
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   364
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   365
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   366
    ^self default checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   367
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   368
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   369
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses
2569
vrany
parents: 2556
diff changeset
   370
vrany
parents: 2556
diff changeset
   371
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   372
vrany
parents: 2556
diff changeset
   373
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   374
vrany
parents: 2556
diff changeset
   375
    ^self default checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   376
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   377
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   378
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   379
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   380
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   381
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   382
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   383
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   384
    ^self default checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   385
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   386
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   387
checkoutClass:aClass askForMerge:askForMerge
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   388
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   389
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   390
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   391
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   392
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   393
    ^self default checkoutClass:aClass askForMerge:askForMerge
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   394
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   395
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   396
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   397
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   398
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   399
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   400
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   401
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   402
    ^self default checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   403
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   404
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   405
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge askForConfirmation:askForConfirmation
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   406
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   407
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   408
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   409
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   410
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   411
    ^self default checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge askForConfirmation:askForConfirmation
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   412
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   413
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   414
checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge usingManager:aSourceCodeManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   415
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   416
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   417
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   418
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   419
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   420
    ^self default checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   421
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   422
    "Created: / 29-12-2011 / 14:34:24 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   423
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   424
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   425
compareClassWithRepository:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   426
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   427
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   428
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   429
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   430
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   431
    ^self default compareClassWithRepository:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   432
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   433
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   434
compareClassWithRepository:aClass askForRevision:askForRevision
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   435
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   436
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   437
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   438
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   439
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   440
    ^self default compareClassWithRepository:aClass askForRevision:askForRevision
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   441
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   442
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   443
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   444
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   445
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   446
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   447
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   448
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   449
    ^self default compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   450
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   451
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   452
compareProjectWithRepository:aProject
2569
vrany
parents: 2556
diff changeset
   453
vrany
parents: 2556
diff changeset
   454
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   455
vrany
parents: 2556
diff changeset
   456
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   457
vrany
parents: 2556
diff changeset
   458
    ^self default compareProjectWithRepository:aProject
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   459
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   460
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   461
createSourceContainerForClass:aClass
2569
vrany
parents: 2556
diff changeset
   462
vrany
parents: 2556
diff changeset
   463
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   464
vrany
parents: 2556
diff changeset
   465
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   466
vrany
parents: 2556
diff changeset
   467
    ^self default createSourceContainerForClass:aClass
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   468
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   469
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   470
defineSourceContainerForClass:aClass title:title text:boxText createDirectories:createDirs createContainer:createContainer
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   471
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   472
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   473
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   474
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   475
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   476
    ^self default defineSourceContainerForClass:aClass title:title text:boxText createDirectories:createDirs createContainer:createContainer
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   477
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   478
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   479
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   480
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   481
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   482
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   483
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   484
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   485
    ^self default diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   486
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   487
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   488
ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   489
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   490
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   491
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   492
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   493
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   494
    ^self default ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   495
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   496
    "Created: / 29-12-2011 / 14:33:37 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   497
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   498
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   499
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil forClass:aClass valuesInto:aBlock
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   500
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   501
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   502
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   503
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   504
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   505
    ^self default getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil forClass:aClass valuesInto:aBlock
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   506
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   507
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   508
removeSourceContainerForClass:aClass
2569
vrany
parents: 2556
diff changeset
   509
vrany
parents: 2556
diff changeset
   510
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   511
vrany
parents: 2556
diff changeset
   512
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   513
vrany
parents: 2556
diff changeset
   514
    ^self default removeSourceContainerForClass:aClass
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   515
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   516
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   517
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   518
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   519
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   520
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   521
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   522
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   523
    ^self default removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   524
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   525
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   526
repositoryLogOf:aClass onto:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   527
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   528
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   529
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   530
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   531
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   532
    ^self default repositoryLogOf:aClass onto:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   533
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   534
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   535
repositoryLogOf:aClass short:shortOrNot onto:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   536
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   537
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   538
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   539
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   540
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   541
    ^self default repositoryLogOf:aClass short:shortOrNot onto:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   542
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   543
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   544
tagClass:aClass as:tag
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   545
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   546
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   547
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   548
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   549
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   550
    ^self default tagClass:aClass as:tag
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   551
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   552
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   553
tagClasses:aCollectionOfClasses as:tag
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   554
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   555
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   557
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   558
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   559
    ^self default tagClasses:aCollectionOfClasses as:tag
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   560
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   561
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   562
tagPath:aPath as:tag usingManager:aManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   563
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   564
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   565
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   566
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   567
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   568
    ^self default tagPath:aPath as:tag usingManager:aManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   569
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   570
    "Created: / 29-12-2011 / 14:31:43 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   571
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   572
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   573
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-helpers'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   574
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   575
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   576
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   577
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   578
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   579
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   580
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   581
    ^self default getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   582
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   583
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   584
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-user interaction'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   585
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   586
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   587
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   588
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   589
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   590
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   591
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   592
    ^self default askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   593
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   594
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   595
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   596
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   597
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   598
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   599
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   600
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   601
    ^self default askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   602
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   603
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   604
askForExistingRevision:boxText title:title class:aClass
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   605
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   606
    <resource: #obsolete>
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   607
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   608
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   609
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   610
    ^self default askForExistingRevision:boxText title:title class:aClass
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   611
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   612
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   613
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:directory fileName:fileName
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   614
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   615
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   616
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   617
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   618
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   619
    ^self default askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:directory fileName:fileName
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   620
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   621
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   622
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   623
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   624
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   625
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   626
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   627
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   628
    ^self default checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   629
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   630
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   631
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   632
    ^self default 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   633
        getCheckinInfoFor:aClassNameOrPackageNameString     
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   634
        initialAnswer:initialAnswerOrNil
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   635
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   636
    "Modified: / 12-03-2012 / 12:56:45 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   637
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   638
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   639
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   640
    ^self default 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   641
        getCheckinInfoFor:aClassNameOrPackageNameString 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   642
        initialAnswer:initialAnswerOrNil 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   643
        withQuickOption:withQuickOption
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   644
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   645
    "Modified: / 12-03-2012 / 12:56:50 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   646
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   647
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   648
goodInitialLogMessageForCheckinClassOfClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   649
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   650
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   651
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   652
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   653
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   654
    ^self default goodInitialLogMessageForCheckinClassOfClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   655
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   656
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   657
!SourceCodeManagerUtilities class methodsFor:'utilities-encoding'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   658
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   659
guessEncodingOfFile:aFilename
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   660
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   661
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   662
2818
82c73234ac2d changed: #guessEncodingOfFile:
Stefan Vogel <sv@exept.de>
parents: 2817
diff changeset
   663
    self obsoleteMethodWarning:'ask CharacterEncoder'.
82c73234ac2d changed: #guessEncodingOfFile:
Stefan Vogel <sv@exept.de>
parents: 2817
diff changeset
   664
    ^ CharacterEncoder guessEncodingOfFile:aFilename
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   665
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   666
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   667
guessEncodingOfStream:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   668
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   669
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   670
2817
8a836ca902d4 changed: #guessEncodingOfStream:
Stefan Vogel <sv@exept.de>
parents: 2796
diff changeset
   671
    self obsoleteMethodWarning:'ask CharacterEncoder'.
8a836ca902d4 changed: #guessEncodingOfStream:
Stefan Vogel <sv@exept.de>
parents: 2796
diff changeset
   672
    ^ CharacterEncoder guessEncodingOfStream:aStream
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   673
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   674
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   675
!SourceCodeManagerUtilities methodsFor:'accessing'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   676
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   677
confirmNewFiles:aBoolean
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   678
    "if true, ask if new files are about to be added to the repo"
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   679
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   680
    confirmNewFiles := aBoolean.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   681
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   682
    "Modified (comment): / 24-07-2012 / 18:18:34 / cg"
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   683
!
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   684
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   685
lastSourceLogMessageHeadlines
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   686
    LastSourceLogMessage isNil ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   687
        LastSourceLogMessages := OrderedCollection new.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   688
    ].
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   689
    ^ LastSourceLogMessages 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   690
        collect:[:msg |
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   691
            msg withoutLeadingSeparators asCollectionOfLines first , '...'
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   692
        ]
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   693
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   694
    "Created: / 12-03-2012 / 12:34:35 / cg"
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   695
!
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   696
2569
vrany
parents: 2556
diff changeset
   697
yesToAllNotification
vrany
parents: 2556
diff changeset
   698
vrany
parents: 2556
diff changeset
   699
    ^self class yesToAllNotification
vrany
parents: 2556
diff changeset
   700
vrany
parents: 2556
diff changeset
   701
    "Created: / 11-10-2011 / 12:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2556
diff changeset
   702
!
vrany
parents: 2556
diff changeset
   703
vrany
parents: 2556
diff changeset
   704
yesToAllQuery
vrany
parents: 2556
diff changeset
   705
vrany
parents: 2556
diff changeset
   706
    ^self class yesToAllQuery
vrany
parents: 2556
diff changeset
   707
vrany
parents: 2556
diff changeset
   708
    "Created: / 11-10-2011 / 12:01:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   709
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   710
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   711
!SourceCodeManagerUtilities methodsFor:'error handling'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   712
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   713
doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   714
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   715
    (self class respondsTo: aMessage selector) ifTrue:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   716
        "Bad, method is not moved the the instance side"
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   717
        self breakPoint: #jv.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   718
        self breakPoint: #cg.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   719
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   720
        ^aMessage sendTo: self class
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   721
    ] ifFalse:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   722
        ^super doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   723
    ]
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   724
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   725
    "Created: / 10-10-2011 / 14:02:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   726
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   727
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   728
!SourceCodeManagerUtilities methodsFor:'initialization'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   729
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   730
initialize
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   731
    confirmNewFiles := true.
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
   732
    resources := self class classResources.
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   733
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   734
    "Modified: / 13-10-2011 / 11:03:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   735
    "Modified: / 24-07-2012 / 18:17:57 / cg"
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   736
!
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   737
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   738
setManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   739
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   740
    manager := aSourceCodeManager.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   741
    manager isContainerBased ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   742
        confirmNewFiles isNil "not yet set by user" ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   743
            confirmNewFiles := false.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   744
        ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   745
    ].
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   746
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   747
    "Created: / 10-10-2011 / 11:47:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   748
    "Modified: / 25-07-2012 / 08:35:35 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   749
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   750
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   751
!SourceCodeManagerUtilities methodsFor:'utilities'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   752
2569
vrany
parents: 2556
diff changeset
   753
classIsNotYetInRepository:aClass withManager:mgr
vrany
parents: 2556
diff changeset
   754
    |info|
vrany
parents: 2556
diff changeset
   755
vrany
parents: 2556
diff changeset
   756
    info := mgr sourceInfoOfClass:aClass.
vrany
parents: 2556
diff changeset
   757
vrany
parents: 2556
diff changeset
   758
    ^ (info isNil 
vrany
parents: 2556
diff changeset
   759
    or:[(info at:#fileName ifAbsent:nil) isNil
vrany
parents: 2556
diff changeset
   760
    or:[(info at:#module ifAbsent:nil) isNil
vrany
parents: 2556
diff changeset
   761
    or:[(info at:#directory ifAbsent:nil) isNil]]])
vrany
parents: 2556
diff changeset
   762
vrany
parents: 2556
diff changeset
   763
    "Created: / 25-10-2006 / 09:43:00 / cg"
vrany
parents: 2556
diff changeset
   764
!
vrany
parents: 2556
diff changeset
   765
2673
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   766
defaultManager
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   767
    ^ manager
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   768
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   769
    "Created: / 22-12-2011 / 10:59:28 / cg"
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   770
!
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   771
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   772
nameOfExtensionsContainer
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   773
    ^ 'extensions.st'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   774
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   775
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   776
setPackageOfAllMethodsIn:aClass to:aPackage
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   777
    "make all methods belong to the classes project"
933
84fd7806afaf offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   778
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   779
    |anyChange anyChangeHere|
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   780
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   781
    anyChange := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   782
    aClass withAllPrivateClassesDo:[:eachClass |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   783
        anyChangeHere := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   784
        eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   785
            mthd package ~= aPackage ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   786
                mthd setPackage:aPackage.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   787
                anyChangeHere := true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   788
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   789
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   790
        anyChangeHere ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   791
            eachClass changed:#projectOrganization
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   792
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   793
        anyChangeHere ifTrue:[anyChange := true].
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   794
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   795
    anyChange ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   796
       Smalltalk changed:#projectOrganization
1185
e86907810d1f handle abortAll in checkIn
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   797
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   798
    ^ anyChange
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   799
!
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   800
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   801
setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   802
    "make all methods belong to the classes project"
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   803
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   804
    aChangeSet do:[:eachChange |
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   805
        eachChange isMethodCodeChange ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   806
            eachChange changeMethod package ~= aPackage ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   807
                Transcript showCR:'change package of ',eachChange changeMethod whoString.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   808
                eachChange changeMethod setPackage:aPackage.        
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   809
            ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   810
        ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   811
    ].
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   812
!
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
   813
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   814
sourceCodeForExtensions:aCollectionOfMethods package:aPackageID forManager:scmManagerOrNil
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   815
    |s methodsSortedByName defClass|
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   816
3201
f0993e3fdf02 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3199
diff changeset
   817
    s := CharacterWriteStream on:(String new:1000).
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   818
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   819
    s nextPutAll:'"{ Package: '''.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   820
    s nextPutAll:aPackageID asString.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   821
    s nextPutAll:''' }"'; nextPutChunkSeparator; cr; cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   822
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   823
    "/ don't write a timestamp. Otherwise we would always generate a new version, even if nothing changed
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   824
    "/ s nextPutAll:(Smalltalk timeStamp).
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   825
    "/ s nextPutChunkSeparator. 
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   826
    "/ s cr; cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   827
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   828
    "/ sort them by name (to avoid conflicts due to SCM merge)
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   829
    methodsSortedByName := aCollectionOfMethods asOrderedCollection.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   830
    methodsSortedByName sort:[:a :b |
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   831
                                |clsA clsB|
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   832
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   833
                                clsA := a mclass name.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   834
                                clsB := b mclass name.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   835
                                clsA < clsB ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   836
                                    true
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   837
                                ] ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   838
                                    clsA > clsB ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   839
                                        false
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   840
                                    ] ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   841
                                        a selector < b selector
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   842
                                    ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   843
                                ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   844
                              ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   845
    methodsSortedByName do:[:aMethod |
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   846
        aMethod mclass fileOutMethod:aMethod on:s.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   847
        s cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   848
    ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   849
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   850
    scmManagerOrNil notNil ifTrue:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   851
        defClass := ProjectDefinition definitionClassForPackage:aPackageID.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   852
        defClass notNil ifTrue:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   853
            "/ make sure, an extensionVersion_XXX method is included...
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   854
            "/ (notice: no need to support a secondary backward compatible non-manager related version method here)
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   855
            (methodsSortedByName contains:[:aMethod | aMethod selector == scmManagerOrNil nameOfVersionMethodForExtensions]) ifFalse:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   856
                s nextPutLine:('!!%1 class methodsFor:''documentation''!!' bindWith:defClass name).
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   857
                s cr.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   858
                s nextChunkPut:
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   859
                    (scmManagerOrNil versionMethodTemplateForSmalltalkFor:(scmManagerOrNil nameOfVersionMethodForExtensions)).
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   860
                s space; nextPutChunkSeparator; cr.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
   861
            ].
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   862
        ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   863
    ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   864
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   865
    ^ s contents.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   866
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   867
    "Created: / 25-07-2012 / 18:38:05 / cg"
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   868
!
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   869
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   870
sourceCodeManagerFor:aClass
3370
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   871
    manager notNil ifTrue:[^ manager].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   872
    ^ self class sourceCodeManagerFor:aClass.    
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   873
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   874
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   875
sourceCodeOfClass:aClass
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   876
    |stream src|
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   877
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   878
    stream := '' writeStream.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   879
    Method flushSourceStreamCache.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   880
    aClass fileOutOn:stream withTimeStamp:false.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   881
    src := stream contents asString.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   882
    stream close.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
   883
    ^ src
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   884
!
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   885
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   886
validateConsistencyOfPackage:aPackage
3146
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   887
    ^ self validateConsistencyOfPackage:aPackage doClasses:true  doExtensions:true
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   888
!
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   889
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   890
validateConsistencyOfPackage:aPackage doClasses:doClasses doExtensions:doExtensions
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
   891
    |checker report msg answer dialog|
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
   892
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
   893
    "/ also done by ProjectChecker...
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
   894
    "/ defClass := aPackage asPackageId projectDefinitionClass.
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   895
    "/ defClass validateDescription.
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   896
3146
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   897
    checker := ProjectChecker new.
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   898
    checker checkExtensionsOnly:(doClasses not and:[ doExtensions ]).
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
   899
    report := checker check: aPackage.
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   900
    (report notNil and:[report problems notEmptyOrNil]) ifTrue:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   901
        report problems size == 1 ifTrue:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   902
            msg := 'The ProblemChecker found the following error/inconsistency:\\    %2\\Need more detail or help for repair?'
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   903
        ] ifFalse:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   904
            msg := 'The ProblemChecker found %1 errors/inconsistencies.\\Browse them for detail or repair?'
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   905
        ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   906
        answer := Dialog confirmWithCancel:(msg bindWith:report problems size 
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   907
                                                with:report problems first label) withCRs.
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   908
        answer isNil ifTrue:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   909
            "/ cancel
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
   910
            AbortOperationRequest raiseRequest
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   911
        ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   912
        answer == true ifTrue:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   913
            dialog := Tools::ProjectCheckerBrowser new.
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   914
            dialog
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
   915
                projectChecker: (ProjectChecker forPackage: aPackage);
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   916
                problemList:report problems;
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   917
                showCancel:true;
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   918
                openModal.
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
   919
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   920
            dialog accepted ifFalse:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
   921
                AbortOperationRequest raiseRequest
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   922
            ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   923
        ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   924
    ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   925
!
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
   926
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   927
versionString:a isLessThan:b
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   928
    "compare two strings of the form: a.b.c..."
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   929
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   930
    |i1 i2 a1 b1 rest1 rest2|
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   931
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   932
    i1 := a indexOf:$. .
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   933
    i2 := b indexOf:$. .
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   934
    i1 == 0 ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   935
        i1 := a size + 1.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   936
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   937
    i2 == 0 ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   938
        i2 := b size + 1.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   939
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   940
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   941
    a1 := Integer readFrom:(a copyTo:i1-1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   942
    b1 := Integer readFrom:(b copyTo:i2-1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   943
    a1 < b1 ifTrue:[^ true].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   944
    a1 > b1 ifTrue:[^ false].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   945
    rest1 := (a copyFrom:i1+1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   946
    rest2 := (b copyFrom:i2+1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   947
    rest1 isEmpty ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   948
        ^ rest2 notEmpty
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   949
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   950
    rest2 isEmpty ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   951
        ^ false
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   952
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   953
    ^ self versionString:rest1 isLessThan:rest2
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   954
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   955
    "
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   956
     self assert:(self versionString:'12.34.66' isLessThan:'12.35.66').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   957
     self assert:(self versionString:'12.34.66' isLessThan:'12.35.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   958
     self assert:(self versionString:'11.34.66' isLessThan:'12.34.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   959
     self assert:(self versionString:'11.35.66' isLessThan:'12.34.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   960
     self assert:(self versionString:'13.35.66' isLessThan:'12.34.67') not.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   961
     self assert:(self versionString:'13.35.66' isLessThan:'13.34.67') not.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   962
     self assert:(self versionString:'13.35.66' isLessThan:'13.35.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   963
     self assert:(self versionString:'13.35.66' isLessThan:'13.35.65') not.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   964
     self assert:(self versionString:'13.35.66.1' isLessThan:'13.35.66') not.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   965
     self assert:(self versionString:'13.35.66' isLessThan:'13.35.66.1').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   966
     self assert:(self versionString:'13.35.66.2' isLessThan:'13.35.66.1') not.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   967
     self assert:(self versionString:'13.35.66.1' isLessThan:'13.35.66.2').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   968
    "
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   969
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   970
    "Modified: / 17-02-2011 / 10:20:14 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   971
! !
1160
d56159f5a86f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   972
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   973
!SourceCodeManagerUtilities methodsFor:'utilities-cvs'!
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   974
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   975
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   976
    "check-out an extension container from the source repository, and return the methods there as a change set.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   977
     If askForRevision is false, check-out the newest version.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   978
     Return a changeSet or nil (if any error occurred)"
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   979
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   980
    ^ self
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   981
        changeSetForExtensionMethodsForPackage:packageToCheckOut 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   982
        revision:nil orAskForRevision:askForRevision 
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   983
        usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   984
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   985
    "Created: / 29-12-2011 / 14:26:01 / cg"
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   986
!
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   987
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   988
changeSetForExtensionMethodsForPackage:packageToCheckOut revision:revisionOrNil orAskForRevision:askForRevision usingManager:aSourceCodeManager
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   989
    "check-out an extension container from the source repository, and return the methods there as a change set.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   990
     If askForRevision is false, check-out the newest version.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   991
     Return a changeSet or nil (if any error occurred)"
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
   992
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   993
    |directory module file aStream sourceToLoad rev msg newestRev |
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   994
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   995
    directory := packageToCheckOut asPackageId directory.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   996
    module := packageToCheckOut asPackageId module.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   997
    file := self nameOfExtensionsContainer.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   998
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
   999
    "/
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1000
    "/ ask for revision
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1001
    "/
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1002
    (rev := revisionOrNil) isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1003
        newestRev := aSourceCodeManager newestRevisionInFile:file directory:directory module:module.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1004
        askForRevision ifFalse:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1005
            rev := newestRev ? ''
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1006
        ] ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1007
            msg := resources string:'CheckOut which revision of extensions for ''%1'': (empty for newest)' with:packageToCheckOut allBold.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1008
            newestRev notNil ifTrue:[
3261
7a585999dcef class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3259
diff changeset
  1009
                msg := msg , '\' , (resources string:'Newest in repository is %1.' with:newestRev)
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1010
            ].
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1011
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1012
            rev := self
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1013
                    askForExistingRevision:msg 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1014
                    title:'CheckOut from repository' 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1015
                    class:nil 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1016
                    manager:aSourceCodeManager 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1017
                    module:module package:directory fileName:file.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1018
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1019
            rev isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1020
                ^ nil   "/ canceled
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1021
            ].
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1022
        ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1023
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1024
    rev withoutSpaces isEmpty ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1025
        rev := #newest.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1026
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1027
    ] ifFalse:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1028
        msg := 'extracting previous %1'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1029
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1030
    aStream := aSourceCodeManager  
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1031
        streamForClass:nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1032
        fileName:file 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1033
        revision:rev 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1034
        directory:directory 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1035
        module:module
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1036
        cache:true.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1037
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1038
    aStream isNil ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1039
        self warn:(resources string:'Could not extract "extensions.st" for %1 from repository' with:packageToCheckOut allBold).
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1040
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1041
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1042
    aStream class readErrorSignal handle:[:ex |
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1043
        self warn:('read error while reading extracted source\\' , ex description) withCRs.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1044
        aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1045
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1046
    ] do:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1047
        sourceToLoad := aStream contents asString.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1048
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1049
    aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1050
    ^ ChangeSet fromStream:(sourceToLoad readStream).
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1051
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1052
    "Created: / 29-12-2011 / 14:27:00 / cg"
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1053
!
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1054
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1055
checkForExistingModule:module directory:directory container:containerFileName usingManager:mgr allowCreate:allowCreate
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1056
    |moduleName directoryName containerName|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1057
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1058
    moduleName := module allBold.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1059
    directoryName := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1060
    containerName := containerFileName allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1061
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1062
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1063
    "/ check for the container
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1064
    "/
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1065
    (mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1066
        allowCreate ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1067
            self warn:(resources string:'A container for ''%1'' does not exist in ''%2:%3''' 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1068
                                   with:containerName with:moduleName with:directoryName) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1069
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1070
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1071
        (Dialog 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1072
            confirm:(resources string:'''%1'' is a new container (in ''%2:%3'').\\Create it ?' 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1073
                                 with:containerName with:moduleName with:directoryName) withCRs
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1074
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1075
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1076
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1077
        ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1078
        (mgr createContainerForText:'' inModule:module package:directory container:containerFileName) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1079
            self warn:(resources string:'Cannot create new container: ''%1'' (in ''%2:%3'')' 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1080
                                 with:containerName with:moduleName with:directoryName).
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1081
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1082
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1083
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1084
    ^ true.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1085
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1086
    "Modified: / 13-09-2006 / 18:24:57 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1087
    "Created: / 29-12-2011 / 14:35:36 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1088
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1089
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1090
checkForExistingModule:module directory:directory usingManager:mgr allowCreate:allowCreate
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1091
    |moduleNameBold directoryNameBold|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1092
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1093
    moduleNameBold := module allBold.
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1094
    directoryNameBold := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1095
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1096
    "/
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1097
    "/ check for the directory
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1098
    "/
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1099
    (mgr checkForExistingModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1100
        allowCreate ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1101
            self warn:(resources string:'A directory for ''%1'' does not exist in module ''%2''' 
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1102
                                   with:directoryNameBold with:moduleNameBold) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1103
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1104
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1105
        (Dialog 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1106
            confirm:(resources stringWithCRs:'''%1'' is a new directory in module ''%2''.\\Create it in %3?' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1107
                                with:directoryNameBold 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1108
                                with:moduleNameBold
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1109
                                with:mgr managerTypeName)
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1110
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1111
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1112
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1113
        ].
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1114
        (mgr createModule:module directory:directory) ifFalse:[
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1115
            self warn:(resources stringWithCRs:'Cannot create new directory: ''%1'' in module ''%2'' in %3' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1116
                                 with:directoryNameBold 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1117
                                 with:moduleNameBold
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1118
                                 with:mgr managerTypeName).
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1119
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1120
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1121
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1122
    ^ true.
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1123
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1124
    "Modified: / 21-12-2011 / 18:46:11 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1125
    "Created: / 29-12-2011 / 14:35:20 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1126
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1127
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1128
checkForExistingModule:module usingManager:mgr allowCreate:allowCreate
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1129
    |moduleName answer|
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1130
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1131
    (mgr checkForExistingModule:module) ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1132
        moduleName := module allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1133
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1134
        allowCreate ifFalse:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1135
            self warn:(resources stringWithCRs:'A module named ''%1'' does not exist in the repository' 
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1136
                                  with:moduleName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1137
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1138
        ].
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  1139
        AbortAllOperationWantedQuery query ifTrue:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1140
            answer := Dialog 
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1141
                confirmWithCancel:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName)
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1142
                labels:(resources array:#('Cancel All' 'Cancel' 'Yes' )).
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1143
            answer isNil ifTrue:[ AbortAllOperationRequest raise ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1144
        ] ifFalse:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1145
            answer := Dialog 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1146
                confirm:(resources stringWithCRs:'''%1'' is a new module in %2.\\create it ?' with:moduleName with:mgr managerTypeName) 
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1147
                noLabel:'Cancel'
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1148
        ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1149
        answer ifFalse:[ ^ false].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1150
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1151
        (mgr createModule:module) ifFalse:[
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1152
            self warn:(resources stringWithCRs:'Cannot create new module: ''%1'' in %2' with:moduleName with:mgr managerTypeName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1153
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1154
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1155
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1156
    ^ true.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  1157
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1158
    "Modified: / 21-12-2011 / 18:42:03 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1159
    "Created: / 29-12-2011 / 14:35:06 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1160
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1161
3534
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1162
checkOutPackages: packages askForRevision: askForRevision
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1163
    "Updates code of given packages (loaded in the image) to a specific revision.
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1164
     If `askForRevision` is true, then user is asked to specify to which revision to
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1165
     update. If `askForRevision` is false, then packages are updated to a 'newest'
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1166
     revision. 
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1167
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1168
     NOTE: Definition of `newest` revision may vary. For SCMs which allows for multiple
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1169
     heads, it is not clear which one it is. In that case, even if `askForRevision` is
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1170
     false, this method may result in user interation, asking user to select which of the
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1171
     newest she wants.
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1172
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1173
     NOTE: Naming is bit confusing, it should be something like #updatePackages:ask...
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1174
     but to keep this in line with other methods, we use #checkOutPackages"
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1175
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1176
    ^ self subclassResponsibility.
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1177
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1178
    "Created: / 01-04-2014 / 21:50:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1179
!
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1180
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1181
checkoutClass:aClass askForMerge:askForMerge
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1182
    "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
  1183
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1184
    self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1185
        checkoutClass:aClass 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1186
        askForRevision:true
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1187
        askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1188
!
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1189
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1190
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1191
    "check-out a class from the source repository.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1192
     If askForRevision is false, check-out the newest version."
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1193
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1194
    self
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1195
        checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge 
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1196
        askForConfirmation:true
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1197
!
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1198
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1199
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge askForConfirmation:askForConfirmation
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1200
    "check-out a class from the source repository.
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1201
     If askForRevision is false, check-out the newest version."
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1202
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1203
    |mgr sourceInfo
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1204
     currentClass inChangeSet
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1205
     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
  1206
     nm msg rev2 newestRev
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1207
     containerModule containerPackage containerFile rslt
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1208
     pkg listHere listRep diffSet 
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  1209
     changed onlyHere onlyInRep answer labels values singleChangeSelector
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1210
     changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1211
     wasInChangeSetBefore|
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1212
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1213
    aClass isNil ifTrue:[self error:'nil class'].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1214
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1215
    currentClass := aClass theNonMetaclass.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1216
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1217
    nm := currentClass name.
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1218
    mgr := self sourceCodeManagerFor:currentClass.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1219
    mgr isNil ifTrue:[
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1220
        ^ self
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1221
    ].
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1222
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1223
    sourceInfo := mgr sourceInfoOfClass:currentClass.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1224
    sourceInfo notNil ifTrue:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  1225
        currentClass package ~= PackageId noProjectID ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1226
            containerPackage := mgr directoryFromSourceInfo:sourceInfo.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1227
            containerModule := mgr moduleFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1228
        ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1229
        containerFile := mgr containerFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1230
    ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1231
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1232
    currentClass isLoaded ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1233
        rev := currentClass binaryRevision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1234
        rev2 := currentClass revision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1235
        rev isNil ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1236
            rev := rev2
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1237
        ].
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1238
        rev isNil ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1239
            pkg := currentClass package.
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  1240
            (pkg notNil and:[pkg ~= PackageId noProjectID]) ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1241
                containerModule := pkg upTo:$:.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1242
                containerPackage := pkg copyFrom:(containerModule size + 2).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1243
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1244
            containerModule size == 0 ifTrue:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1245
                containerModule := (self class lastModule ) ? Project current repositoryModule.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1246
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1247
            containerPackage size == 0 ifTrue:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1248
                containerPackage := (self class lastPackage ) ? Project current package.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1249
            ].
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1250
            answer := self confirmWithCancel:(resources 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  1251
                                                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
  1252
                                                with:containerModule allBold 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  1253
                                                with:containerPackage allBold
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1254
                                                with:currentClass name allBold) withCRs.
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1255
            answer isNil ifTrue:[^ self "cancelled"].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1256
            answer ifFalse:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1257
                rslt := self
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1258
                    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
  1259
                    title:'Container to load from' note:nil 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1260
                    initialModule:containerModule 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1261
                    initialPackage:containerPackage 
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1262
                    initialFileName:(currentClass nameWithoutPrefix , '.st')
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1263
                    forNewContainer:false.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1264
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1265
                rslt isNil ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1266
                    "/ canel
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1267
                    ^ self
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1268
                ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1269
                containerModule := "lastModule :=" rslt at:#module.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1270
                containerPackage := "lastPackage :=" rslt at:#package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1271
                containerFile := rslt at:#fileName.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1272
            ].
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1273
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1274
"/            rslt := self
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1275
"/                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
  1276
"/                title:'Container to checkOut' note:nil 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1277
"/                initialModule:containerModule 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1278
"/                initialPackage:containerPackage
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1279
"/                initialFileName:(currentClass name , '.st').
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1280
"/                forNewContainer:false.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1281
"/            rslt isNil ifTrue:[^ self].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1282
            "/ 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
  1283
            "/ ^ self
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1284
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1285
    ].
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1286
1966
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1287
    containerFile isNil ifTrue:[
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1288
        containerFile := currentClass classFilename.
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1289
    ].
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1290
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1291
    "/
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1292
    "/ 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
  1293
    "/
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1294
    containerModule isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1295
        containerModule := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1296
                                        stringWithCRs:'Missing Module Information for CheckOut of "%1".\\Module:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1297
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1298
        containerModule isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1299
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1300
    containerPackage isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1301
        containerPackage := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1302
                                        stringWithCRs:'Missing Package Information for CheckOut of "%1".\\Package:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1303
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1304
        containerPackage isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1305
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1306
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1307
    newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1308
    askForRevision ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1309
        rev := newestRev ? ''
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1310
    ] ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1311
        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
  1312
        rev notNil ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1313
            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
  1314
                                           with:nm allBold with:rev).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1315
            (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
2539
abce5c41eef8 comment/format in: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1316
                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.' with:rev2)
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1317
            ]
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1318
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1319
        newestRev notNil ifTrue:[
2539
abce5c41eef8 comment/format in: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1320
            msg := msg , '\' , (resources string:'Newest in repository is %1.' with:newestRev)
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1321
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1322
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1323
        rev := self
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1324
                    askForExistingRevision:msg 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1325
                    title:'CheckOut from repository' 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1326
                    class:currentClass.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1327
        rev isNil ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1328
            ^ self   "/ canceled
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1329
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1330
    ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1331
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1332
    rev withoutSpaces isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1333
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1334
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1335
        aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1336
        revString := '(newest: ' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1337
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1338
        msg := 'extracting previous %1'.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1339
"/        aStream := mgr getSourceStreamFor:currentClass revision:rev.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1340
"/        revString := rev
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1341
        aStream := mgr  
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1342
            streamForClass:currentClass
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1343
            fileName:containerFile 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1344
            revision:rev 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1345
            directory:containerPackage 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1346
            module:containerModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1347
            cache:true.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1348
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  1349
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1350
    aStream isNil ifTrue:[
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1351
        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
  1352
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1353
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1354
    aStream class readErrorSignal handle:[:ex |
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1355
        self warn:('Read error while reading extracted source\\' , ex description) withCRs.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1356
        aStream close.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1357
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1358
    ] do:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1359
        sourceToLoad := aStream contents asString.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1360
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1361
    aStream close.
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1362
1919
8d30ac5be40f *** empty log message ***
boris
parents: 1913
diff changeset
  1363
    wasInChangeSetBefore := ChangeSet current includesChangeForClassOrMetaclass:currentClass.
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1364
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1365
    currentClass isLoaded ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1366
        rev = newestRev ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1367
            currentClass autoload.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  1368
        ] ifFalse:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1369
            sourceToLoad readStream fileIn.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  1370
        ].
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1371
        wasInChangeSetBefore ifFalse:[
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1372
            ChangeSet current condenseChangesForClass:currentClass.
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1373
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1374
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1375
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1376
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  1377
    inChangeSet := aClass hasUnsavedChanges.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1378
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1379
    Error handle:[:ex |
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1380
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1381
            confirm:(resources 
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1382
                        stringWithCRs:'An error:\    %1\was encountered while generating the current source of the class %2.\This might be due to some missing or corrupted source file.\You may proceed, but no information about the differences between your current version and the repositories version can be shown.\\Continue ?'
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1383
                        with:ex description 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1384
                        with:currentClass name allBold) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1385
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1386
        ifFalse:[
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  1387
            AbortOperationRequest raise
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1388
        ].
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1389
        sourceToLoad readStream fileIn.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1390
        ^ self.
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1391
    ] do:[
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1392
        self activityNotification:'generating current source...'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1393
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1394
        currentSource := self sourceCodeOfClass:currentClass.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1395
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1396
        self activityNotification:'comparing...'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1397
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1398
        sourceToLoad = currentSource ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1399
            "/ make all methods belong to the classes project
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1400
            self setPackageOfAllMethodsIn:aClass to:aClass package.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1401
            inChangeSet ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1402
                rev = newestRev ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1403
                    (askForConfirmation not
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1404
                    or:[ wasInChangeSetBefore not
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1405
                    or:[ self confirm:(resources 
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1406
                                    stringWithCRs:'%1 is up-to-date.\\Remove entries for %1 from changeSet ?'
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1407
                                    with:aClass name)]]) 
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1408
                    ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1409
                        ChangeSet current condenseChangesForClass:aClass.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1410
                    ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1411
                ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1412
            ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1413
            self activityNotification:'... nothing changed in repository'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1414
            ^ self.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1415
        ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1416
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1417
        self activityNotification:'generating diffSet...'.
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1418
        listHere := ChangeSet fromStream:(currentSource readStream).
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1419
    ].
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1420
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1421
    listRep := ChangeSet fromStream:(sourceToLoad readStream).
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
  1422
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1423
    Error handle:[:ex |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1424
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1425
            confirm:(resources 
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1426
                        stringWithCRs:'An error:\    %1\was encountered while trying to figure out what has changed.\This might be due to some missing or corrupted source file.\If you proceed, the old code will be loaded over the existing code without further checks (fileIn).\\Continue ?'
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1427
                        with:ex description
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1428
                    ) 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1429
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1430
        ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1431
            ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1432
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1433
        sourceToLoad readStream fileIn.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1434
        ^ self.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1435
    ] do:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1436
        versionMethodsHere := listHere select:[:change | (change isMethodChange 
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  1437
                                               and:[((self sourceCodeManagerFor:aClass) "AbstractSourceCodeManager" isVersionMethodSelector:change selector)
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1438
                                               and:[change changeClass isMeta]])].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1439
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1440
        versionMethodsRep := listRep select:[:change | (change isMethodChange 
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  1441
                                               and:[((self sourceCodeManagerFor:aClass) "AbstractSourceCodeManager" isVersionMethodSelector:change selector)
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1442
                                               and:[change changeClass isMeta]])].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1443
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1444
        "/ compare all but the version methods
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  1445
        listHere := listHere reject:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  1446
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  1447
                                               and:[change changeClass isMeta]])].
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  1448
        listRep := listRep reject:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  1449
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  1450
                                               and:[change changeClass isMeta]])].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1451
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1452
        diffSet := listHere diffSetsAgainst:listRep.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1453
        changed := diffSet changed.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1454
        onlyHere := diffSet onlyInReceiver.
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1455
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1456
        "/ reject extensions
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1457
        onlyHere := onlyHere reject:[:eachDiff|  
2774
46c3fee4b485 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2719
diff changeset
  1458
                        |method methodsPackage|
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1459
3272
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1460
                        eachDiff isMethodChange  
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1461
                        and:[ eachDiff changeClass notNil
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1462
                        and:[ (method := (eachDiff changeClass compiledMethodAt:eachDiff selector)) notNil 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1463
                        and:[ (methodsPackage := method package) ~= containerPackage
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1464
                        and:[ methodsPackage ~= PackageId noProjectID  ]]]]
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1465
                    ]. 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1466
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1467
        onlyInRep := diffSet onlyInArg.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1468
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1469
        changedClassDefinitions := changed select:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1470
        changed := changed reject:[:eachChangePair | eachChangePair first isClassDefinitionChange]. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1471
        changed := changed reject:[:eachChangePair | eachChangePair first isClassCommentChange]. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1472
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1473
        labels := #('Cancel' 'Merge' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1474
        values := #(nil #merge #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1475
        default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1476
                        ifTrue:[3. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1477
                        ifFalse:[2. "i.e. merge"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1478
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1479
        msg := 'About to load ''%4''.\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1480
        onlyInRep size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1481
            msg := msg , 'The repositories version contains %1 method(s) which are not in your current class.\'.
2064
3e7b6104ce47 When checking out newest sources from a repository,
Stefan Vogel <sv@exept.de>
parents: 2063
diff changeset
  1482
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1483
        onlyHere size > 0 ifTrue:[
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1484
            msg := msg , (onlyInRep size > 0 ifTrue:['And there '] ifFalse:['There ']).
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1485
            msg := msg , 'are %2 methods in your current class, which are not in the repository.\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1486
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1487
        changed size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1488
            changed size == 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1489
                msg := msg , 'The ''%6''-method is different (present in both).\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1490
                singleChangeSelector := changed first first selector allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1491
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1492
                msg := msg , '%3 methods are different (present in both).\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1493
            ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1494
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1495
        changedClassDefinitions size > 0 ifTrue:[
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1496
            msg := msg , (changedClassDefinitions size == 1 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1497
                            ifTrue:['The class definition is different.\\'] 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  1498
                            ifFalse:['%5 class definitions are different.\\'])
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1499
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1500
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1501
        onlyHere isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1502
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1503
                (changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[
2605
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  1504
                    versionMethodsRep notEmpty ifTrue:[
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  1505
                        (self confirm:(resources string:'Only version methods are different in %1.\\Update the version-IDs ?' with:aClass name allBold) withCRs) ifTrue:[
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  1506
                            versionMethodsRep do:[:each | each apply].
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  1507
                        ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1508
                    ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1509
                    "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1510
                    "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1511
                    self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
2605
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  1512
                    self activityNotification:'Only version methods are different in the repository'.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1513
                    ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1514
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1515
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1516
                    msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made).'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1517
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1518
                labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1519
                values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1520
                default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1521
                                ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1522
                                ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1523
                default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1524
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1525
                changed isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1526
                    msg := msg , '\Attention:\Load will load methods which are not present in ''%4''.'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1527
                    labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1528
                    values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1529
                    default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1530
                                    ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1531
                                    ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1532
                    default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1533
                ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1534
                    inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1535
                        msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1536
                    ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1537
                    msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1538
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1539
            ]
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1540
        ] ifFalse:[
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1541
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1542
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1543
                    msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made),'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1544
                    msg := msg , '\and remove added methods which are not present in the repository version.'.
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1545
                ].
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1546
                labels := #('Cancel' 'Load'). 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1547
                values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1548
                default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1549
                                ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  1550
                                ifFalse:[1. "i.e. cancel"].
1907
30ca5aea5a7a dialogs defaults
fm
parents: 1886
diff changeset
  1551
                default := 2. 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1552
            ] ifFalse:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1553
                inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1554
                    msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1555
                    msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1556
                ]
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1557
            ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1558
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1559
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1560
        msg := msg bindWith:onlyInRep size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1561
                   with:onlyHere size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1562
                   with:changed size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1563
                   with:aClass name allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1564
                   with:changedClassDefinitions size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1565
                   with:singleChangeSelector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1566
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1567
        askForConfirmation ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1568
            answer := #load           
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1569
        ] ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1570
            answer := (Dialog confirmWithCancel:msg withCRs
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1571
                   labels:(resources array:labels)
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1572
                   values:values 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1573
                   default:default).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1574
            answer isNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1575
                self activityNotification:'...cancelled'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1576
                ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1577
            ].
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1578
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1579
        self activityNotification:'updating...'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1580
        changedClasses := IdentitySet new.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1581
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1582
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1583
            "when loading, remove all the methods which are no longer in classes with a changed
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1584
             class definition. So we avoid possible compile errors of old methods, which will go away"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1585
            onlyHere do:[:eachChange |   
3272
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1586
                "remove this change (method not present in repository version)"
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1587
                |cClass|
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1588
                eachChange isMethodChange ifTrue:[
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1589
                    cClass := eachChange changeClass.
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1590
                    cClass notNil ifTrue:[ 
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1591
                       cClass basicRemoveSelector:eachChange selector 
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1592
                    ].
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  1593
                ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1594
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1595
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1596
            changedClassDefinitions do:[:eachChangeArr | 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1597
                |cHere eachChangedClass| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1598
                cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1599
                eachChangedClass := cHere changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1600
                eachChangedClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1601
                    changedClasses add:eachChangedClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1602
                    eachChangedClass := eachChangedClass theNonMetaclass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1603
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1604
                    "remove changed methods now, but keep the changes (to be applied later)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1605
                    changed do:[:eachChangeArr|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1606
                        |eachChange eachClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1607
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1608
                        eachChange := eachChangeArr first.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1609
                        eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1610
                            eachClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1611
                            eachClass theNonMetaclass == eachChangedClass ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1612
                                eachClass basicRemoveSelector:eachChange selector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1613
                            ].
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  1614
                        ].
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  1615
                    ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1616
                ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1617
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1618
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1619
           "apply class definition changes (use the repository version)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1620
           changedClassDefinitions do:[:eachChangeArr |    
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1621
                |cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1622
                cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1623
                cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1624
            ].
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  1625
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1626
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1627
        onlyInRep do:[:eachChange |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1628
            |changeClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1629
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1630
            "apply this change (method only present in rep-version)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1631
             eachChange apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1632
             eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1633
                 changeClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1634
                 changeClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1635
                     eachChange changeMethod setPackage:(changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1636
                     changedClasses add:changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1637
                 ]
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1638
             ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1639
        ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1640
    .
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1641
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1642
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1643
                 |cHere cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1644
                 cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1645
                 cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1646
                 cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1647
                 cRep isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1648
                     cRep changeMethod setPackage:(cRep changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1649
                     changedClasses add:cRep changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1650
                 ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1651
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1652
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1653
            versionMethodsRep size >= 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1654
                versionMethodsRep last apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1655
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1656
                self error:'missing version method in repository' mayProceed:true.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1657
            ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1658
            "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1659
            "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1660
            self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1661
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1662
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1663
        answer == #load ifTrue:[
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  1664
            inChangeSet := aClass hasUnsavedChanges.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1665
            inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1666
                rev = newestRev ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1667
                    (wasInChangeSetBefore not
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1668
                     or:[ self confirm:(resources 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1669
                                    stringWithCRs:'%1 is now up-to-date.\\Remove entries for %1 from changeSet ?'
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1670
                                    with:aClass name)]) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1671
                    ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1672
                        ChangeSet current condenseChangesForClass:aClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1673
                    ].
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1674
                ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1675
            ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1676
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1677
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1678
        changedClasses do:[:eachClass |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1679
             eachClass changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1680
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1681
        Smalltalk changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1682
        self activityNotification:'... done'.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1683
    ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1684
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1685
    "Modified: / 07-02-2001 / 18:18:32 / ps"
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  1686
    "Modified: / 22-07-2013 / 13:17:32 / cg"
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1687
!
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1688
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1689
checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge usingManager:aSourceCodeManager
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1690
    "check-out a class from the source repository.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1691
     If askForRevision is false, check-out the newest version."
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1692
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  1693
    |inChangeSet extensionMethods msg
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1694
     listHere listRep diffSet 
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1695
     changed onlyHere onlyInRep answer labels values singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1696
     changedClasses default |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1697
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1698
    listRep := self changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager.
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1699
    listRep isNil ifTrue:[ ^self ].
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1700
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1701
    self activityNotification:'generating diffSet...'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1702
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1703
    extensionMethods := OrderedCollection new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1704
    Smalltalk allClassesDo:[:aClass | |owner classPackage|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1705
        "/ individual methods ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1706
        aClass isMeta ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1707
            (aClass package ~= packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1708
                aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1709
                    "/ methods in this project ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1710
                    (mthd package = packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1711
                        "/ ... whose class is not in the ckechIn-set
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1712
                        extensionMethods add:mthd
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1713
                    ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1714
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1715
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1716
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1717
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1718
    listHere := ChangeSet forExistingMethods:extensionMethods.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1719
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1720
    inChangeSet := listRep contains:[:someChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1721
                            |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1722
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1723
                            someChange isMethodChange ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1724
                                cClass := someChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1725
                                cSel := someChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1726
                                ChangeSet current includesChangeForClass:cClass selector:cSel
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1727
                            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1728
                    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1729
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1730
    diffSet := listHere diffSetsAgainst:listRep.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1731
    changed := diffSet changed.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1732
    onlyHere := diffSet onlyInReceiver.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1733
    onlyInRep := diffSet onlyInArg.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1734
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1735
    labels := #('Cancel' 'Merge' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1736
    values := #(nil #merge #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1737
    default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1738
                    ifTrue:[3. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1739
                    ifFalse:[2. "i.e. merge"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1740
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1741
    msg := 'About to load extensions for ''%5''.\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1742
    onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1743
        msg := msg , 'The repositories version contains %1 extension method(s) which are not in your current image.\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1744
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1745
    onlyHere size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1746
        onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1747
            msg := msg , 'And there '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1748
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1749
            msg := msg , 'There '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1750
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1751
        msg := msg , 'are %2 extension methods in your current image, which are not in the repository.\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1752
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1753
    changed size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1754
        changed size == 1 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1755
            msg := msg , 'The ''%5''-method is different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1756
            singleChangeSelector := changed first first selector allBold
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1757
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1758
            msg := msg , '%3 methods are different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1759
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1760
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1761
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1762
    onlyHere isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1763
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1764
            (changed isEmpty) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1765
                listRep do:[:eachChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1766
                    eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1767
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1768
                ^ self
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1769
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1770
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1771
                msg := msg , '\Attention:\Load may undo any changes made to on of the extension methods (if any were made).'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1772
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1773
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1774
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1775
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1776
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1777
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1778
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1779
            changed isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1780
                msg := msg , '\Attention:\Load will load methods which are not present in the image.'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1781
                labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1782
                values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1783
                default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1784
                                ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1785
                                ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1786
            ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1787
                inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1788
                    msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1789
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1790
                msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1791
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1792
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1793
    ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1794
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1795
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1796
                msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made),'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1797
                msg := msg , '\and remove added methods which are not present in the repository version.'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1798
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1799
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1800
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1801
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1802
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1803
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1804
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1805
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1806
                msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1807
                msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1808
            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1809
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1810
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1811
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1812
    msg := msg bindWith:onlyInRep size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1813
               with:onlyHere size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1814
               with:changed size printString
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1815
               with:singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1816
               with:packageToCheckOut allBold.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1817
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1818
    answer := (Dialog confirmWithCancel:msg withCRs
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1819
           labels:(resources array:labels)
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1820
           values:values 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1821
           default:default).
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1822
    answer isNil ifTrue:[^ self].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1823
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1824
    self activityNotification:'updating...'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1825
    changedClasses := IdentitySet new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1826
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1827
"/    Class withoutUpdatingChangesDo:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1828
        onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1829
                                     Class withoutUpdatingChangeSetDo:[ eachChange apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1830
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1831
                                     eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1832
                                     changedClasses add:eachChange changeClass.   
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1833
                     ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1834
        answer == #load ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1835
            onlyHere do:[:eachChange |   "remove this change (method not present in rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1836
                                         |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1837
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1838
                                         cClass := eachChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1839
                                         cSel := eachChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1840
                                         Class withoutUpdatingChangeSetDo:[ cClass removeSelector:cSel ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1841
                        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1842
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1843
                                         |cHere cRep| 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1844
                                         cHere := eachChangeArr at:1.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1845
                                         cRep := eachChangeArr at:2.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1846
                                         Class withoutUpdatingChangeSetDo:[ cRep apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1847
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1848
                                         cRep changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1849
                                         changedClasses add:cRep changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1850
                       ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1851
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1852
"/    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1853
    changedClasses do:[:eachClass |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1854
         eachClass changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1855
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1856
    Smalltalk changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1857
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1858
    "Modified: / 07-02-2001 / 18:18:32 / ps"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1859
    "Created: / 29-12-2011 / 14:34:12 / cg"
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1860
!
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  1861
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1862
compareClassWithRepository:aClass
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1863
    "open a diff-textView comparing the current (in-image) version
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1864
     against its orgiginal version found in the repository."
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1865
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1866
    self compareClassWithRepository:aClass askForRevision:true
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1867
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1868
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1869
      self compareClassWithRepository:Array
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1870
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1871
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1872
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1873
compareClassWithRepository:aClass askForRevision:askForRevision
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1874
    "open a diff-textView comparing the current (in-image) version
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1875
     against its orgiginal version found in the repository."
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1876
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1877
    |classToCompare brwsr
1194
d60b2ed25f45 Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 1193
diff changeset
  1878
     aStream comparedSource currentSource rev revString thisRevString mgr
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1879
     nm msg revisionInClass newestRev versionsAreTheSame|
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1880
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1881
    classToCompare := aClass theNonMetaclass.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1882
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1883
    nm := classToCompare name.
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1884
    (mgr := manager) isNil ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1885
        mgr := self sourceCodeManagerFor:classToCompare.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1886
        mgr isNil ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1887
            self error:'oops - no sourcecode manager' mayProceed:true.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1888
            ^ self
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1889
        ].
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1890
    ].
2397
e01669725571 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  1891
e01669725571 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  1892
    rev := classToCompare revisionInfoOfManager:mgr.
e01669725571 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  1893
"/    rev := classToCompare binaryRevision.
3544
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1894
    revisionInClass := classToCompare revisionOfManager:mgr.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1895
    rev isNil ifTrue:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1896
        rev := revisionInClass
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1897
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1898
    rev isNil ifTrue:[
3546
13f0b8ba6c85 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
  1899
        (Dialog confirm:'Class seems to be not yet in the repository (or classes revision info is missing or corrupted)\\Proceed ?' withCRs)
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1900
        ifFalse:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1901
            ^ self
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1902
        ]
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1903
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1904
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1905
    "/
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1906
    "/ class in repository - ask for revision
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1907
    "/
2793
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1908
    SourceCodeManagerError handle:[:ex |
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1909
        Dialog warn:(resources 
3313
7765a349ce83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3291
diff changeset
  1910
                                stringWithCRs:'Could not fetch source of "%1".\\Please check your sourcecode manager settings of %2 for package: "%3".\(and possibly the network for reachability of the repository)'
2793
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1911
                                with:classToCompare name
3313
7765a349ce83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3291
diff changeset
  1912
                                with:classToCompare sourceCodeManager managerTypeName
7765a349ce83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3291
diff changeset
  1913
                                with:classToCompare package).
2793
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1914
        ^ self.
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1915
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1916
    ] do:[
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1917
        newestRev := mgr newestRevisionOf:classToCompare.
3732543d2393 changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
  1918
    ].
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1919
    askForRevision ifTrue:[
1466
82e4152d5e9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1462
diff changeset
  1920
        msg := resources string:'Compare to revision: (empty for newest)'.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1921
        rev notNil ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1922
            msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1923
                                           with:nm allBold with:rev).
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1924
            (revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1925
                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1926
                                               with:revisionInClass)
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1927
            ]
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1928
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1929
        newestRev notNil ifTrue:[
3261
7a585999dcef class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3259
diff changeset
  1930
            msg := msg , '\' , (resources string:'Newest in repository is %1.'
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1931
                                           with:newestRev)
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1932
        ].
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1933
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1934
        rev := self
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1935
                    askForExistingRevision:msg 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1936
                    title:'Compare with repository' 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1937
                    class:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1938
    ] ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1939
        rev := newestRev.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1940
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1941
3544
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1942
    rev isNil ifTrue:[
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1943
        mgr = classToCompare sourceCodeManager ifTrue:[
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1944
            msg := 'Could not figure out the newest revision of "%1".\\Please check if this class is really contained in that repository,\and also your sourcecode manager settings of %2 for package: "%3".\(and possibly the network for reachability of the repository)'
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1945
        ] ifFalse:[
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1946
            msg := 'Could not figure out the newest revision of "%1".\\Notice that the class is actually maintained by %4, not %2.\Please check if this class is really in the %2 repository,\and also your sourcecode manager settings of %2 for package: "%3".\(and possibly the network for reachability of the repository)'
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1947
        ].
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1948
        Dialog warn:(resources 
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1949
                                stringWithCRs:msg
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1950
                                with:classToCompare name
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1951
                                with:mgr managerTypeName
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1952
                                with:classToCompare package
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1953
                                with:(classToCompare sourceCodeManager managerTypeName)).
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1954
        ^ self.
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1955
        
7efd6c5b392f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3536
diff changeset
  1956
    ] ifFalse:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1957
        rev withoutSpaces isEmpty ifTrue:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1958
            msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1959
            "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1960
            aStream := mgr getSourceStreamFor:classToCompare revision:newestRev.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1961
            revString := '(newest: ' , (newestRev ? '???') , ')'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1962
        ] ifFalse:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1963
            msg := 'extracting previous %1'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1964
            aStream := mgr getSourceStreamFor:classToCompare revision:rev.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1965
            revString := rev
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1966
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1967
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1968
        aStream isNil ifTrue:[
2692
e5b7d59ce49c changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1969
            self warn:'Could not extract source from repository (check repository settings / network)'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1970
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1971
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1972
        aStream class readErrorSignal handle:[:ex |
2692
e5b7d59ce49c changed: #compareClassWithRepository:askForRevision:
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1973
            self warn:('Read error while reading extracted source\\' , ex description) withCRs.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1974
            aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1975
            ^ self
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1976
        ] do:[
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1977
            comparedSource := aStream contents asString.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1978
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1979
        aStream close.
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1980
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1981
        self activityNotification:'generating current source...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1982
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1983
        currentSource := self sourceCodeOfClass:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1984
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1985
        self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1986
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1987
        versionsAreTheSame := false.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1988
        comparedSource = currentSource ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1989
            versionsAreTheSame := true.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1990
        ] ifFalse:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1991
            thisRevString := revisionInClass ? 'no revision'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1992
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1993
            revString = '(newest)' ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1994
                (rev := mgr newestRevisionOf:classToCompare) notNil ifTrue:[
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1995
                    revString := '(newest is ' , rev , ')'
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1996
                ]
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1997
            ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  1998
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1999
            self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2000
3579
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2001
            ChangeSet invalidChangeChunkError handle:[:ex |
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2002
                |answer|
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2003
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2004
                answer := Dialog 
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2005
                            confirm:(resources 
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2006
                                stringWithCRs:'An invalid change chunk was encountered when reading the source of %1.\This may be due to a currupted source file (or source file was modified/updated in the meantime, without recompilation).\\Proceed in debugger?'
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2007
                                with:aClass)
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2008
                            yesLabel:(resources string:'Debug')
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2009
                            noLabel:(resources string:'Cancel')
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2010
                            initialAnswer:false.
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2011
                answer ifTrue:[ex reject].
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2012
                AbortOperationRequest raise.
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2013
            ] do:[
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2014
                brwsr := (UserPreferences versionDiffViewerClass)
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2015
                      openOnClass:classToCompare
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2016
                      labelA:('Repository: ' , revString)
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2017
                      sourceA:comparedSource
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2018
                      labelB:('Current: (based on: ' , thisRevString , ')')
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2019
                      sourceB:currentSource
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2020
                      title:('Comparing ' , classToCompare name)
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2021
                      ifSame:[versionsAreTheSame := true].
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2022
            ].
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2023
            versionsAreTheSame ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2024
                brwsr classChangeSet 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2025
                    classBeingCompared:classToCompare;
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2026
                    versionA:rev;
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2027
                    versionB:rev , 'mod'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2028
            ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2029
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2030
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2031
        versionsAreTheSame ifTrue:[
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  2032
            (classToCompare hasUnsavedChanges) ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2033
                (self confirm:(resources 
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2034
                                stringWithCRs:'Versions of %1 are identical.\\Remove entries from changeSet ?'
1864
0a1a62489122 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1841
diff changeset
  2035
                                with:classToCompare name allBold)) ifTrue:[
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2036
                    ChangeSet current condenseChangesForClass:classToCompare.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2037
                ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2038
            ] ifFalse:[
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2039
                self information:'Versions are identical.'.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2040
                ChangeSet current unrememberChangedClasses.
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2041
            ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2042
            revisionInClass isNil ifTrue:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2043
                (Dialog confirm:'Update (Fix) the classes Revision Info ?' withCRs)
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2044
                ifTrue:[
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2045
                    |newString root|
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2046
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2047
                    newString := mgr updatedRevisionStringOf:aClass forRevision:rev with:aClass revisionString.
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2048
                    newString isNil ifTrue:[
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2049
                        root := mgr getCVSROOTForModule:(aClass package upTo:$:).
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2050
                        root := mgr repositoryTopDirectoryFromCVSRoot:root.
1500
70a48e2f5921 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  2051
                        newString := '$', 'Header: ',(root copyReplaceAll: $: with:$/ ),'/'
1911
d4088b5ba0ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
  2052
                                     ,(Smalltalk fileNameForClass:aClass),'.st,v ',rev,' '
2006
11622f51f754 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
  2053
                                     ,(Date today printStringFormat:'%y-%m-%d'),' '
11622f51f754 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
  2054
                                     ,(Time now printStringFormat:'%h:%m:%s'),' '
11622f51f754 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
  2055
                                     ,'+0000 '
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2056
                                     ,(OperatingSystem getLoginName),' Exp $'.
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2057
                    ].
2637
dbfb2ef410bd changed:
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  2058
                    mgr updateVersionMethodOf:aClass for:newString.
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2059
                ]
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  2060
            ].
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2061
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2062
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2063
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2064
    "
997
c55b39b6c7a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2065
      self compareClassWithRepository:Array
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2066
    "
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2067
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2068
    "Modified: / 24-07-2012 / 18:11:27 / cg"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2069
!
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2070
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2071
comparePackages:packages askForRevision:askForRevision 
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2072
    "Compares code of given packages (loaded in the image) against a specific revision
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2073
     and opens a diff browser on differences.
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2074
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2075
     If `askForRevision` is true, then user is asked to specify to which revision to
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2076
     update. If `askForRevision` is false, then packages are updated to a 'newest'
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2077
     revision. 
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2078
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2079
     NOTE: Definition of `newest` revision may vary. For SCMs which allows for multiple
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2080
     heads, it is not clear which one it is. In that case, even if `askForRevision` is
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2081
     false, this method may result in user interation, asking user to select which of the
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2082
     newest she wants."
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2083
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2084
    ^ self subclassResponsibility.
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2085
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2086
    "Created: / 04-04-2014 / 15:23:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2087
!
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2088
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2089
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2090
    |diffSet|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2091
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2092
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest.
1875
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2093
    VersionDiffBrowser 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2094
        openOnDiffSet:diffSet 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2095
        labelA:'Repository' 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2096
        labelB:'Image' 
2522
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  2097
        title:('Differences of %1' bindWith:aProject)
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2098
        ignoreExtensions:true
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2099
        ignoreVersionMethods:true.
2522
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  2100
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  2101
    "Modified: / 12-09-2011 / 11:56:01 / cg"
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2102
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2103
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2104
compareProject:aProject withRepositoryVersionTaggedAs:aSymbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2105
    |diffSet|
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2106
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2107
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionTaggedAs:aSymbolicName.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2108
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2109
    VersionDiffBrowser 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2110
        openOnDiffSet:diffSet 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2111
        labelA:'Repository ("',aSymbolicName,'")' 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2112
        labelB:'Image' 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2113
        title:('Differences of %1' bindWith:aProject)
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2114
        ignoreExtensions:true
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2115
        ignoreVersionMethods:true.
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2116
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2117
    "Modified: / 12-09-2011 / 11:56:01 / cg"
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2118
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2119
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2120
compareProjectWithRepository:aProject
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2121
    ^ self compareProject:aProject withRepositoryVersionFrom:nil
1875
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2122
!
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2123
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2124
createSourceContainerForClass:aClass
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2125
    "let user specify the source-repository values for aClass.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2126
     Return false, if failed."
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2127
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2128
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2129
        createSourceContainerForClass:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2130
        usingManager:(self sourceCodeManagerFor:aClass).
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2131
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2132
    "Modified: / 21-12-2011 / 18:31:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2133
!
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2134
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2135
createSourceContainerForClass:aClass usingManager:aManager
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2136
    "let user specify the source-repository values for aClass.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2137
     Return false, if failed."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2138
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2139
    aManager isNil ifTrue:[^ false].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2140
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2141
    ^ self 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2142
        defineSourceContainerForClass:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2143
        usingManager:aManager
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2144
        title:(resources string:'Repository information for %1' with:aClass name)
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2145
        text:(resources string:'Create new %1-repository container for ''%2''' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2146
                            with:aManager managerTypeName
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2147
                            with:aClass name allBold)
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2148
        createDirectories:true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2149
        createContainer:true.
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2150
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2151
    "Created: / 21-12-2011 / 18:31:23 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2152
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2153
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2154
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
  2155
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2156
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2157
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2158
        defineSourceContainerForClass:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2159
        usingManager:(self sourceCodeManagerFor:aClass)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2160
        title:title 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2161
        text:boxText 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2162
        createDirectories:createDirs 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2163
        createContainer:createContainer
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2164
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2165
    "Modified: / 21-12-2011 / 18:34:44 / cg"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2166
!
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2167
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2168
defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText createDirectories:createDirs createContainer:createContainer
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2169
    "let user specify the source-repository values for aClass"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2170
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2171
    |className
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2172
     "oldModule oldPackage" oldFileName
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2173
     module directory fileName nameSpace nameSpacePrefix
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2174
     info project nm creatingNew msg 
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2175
     answer doCheckinWithoutAsking forceCheckIn rslt note
3276
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  2176
     requiredPackage classPackage|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2177
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2178
    mgr isNil ifTrue:[^  false].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2179
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2180
    aClass isLoaded ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  2181
        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
  2182
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2183
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2184
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2185
    className := aClass name.
3276
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  2186
    classPackage := aClass package.
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  2187
    classPackage ~= PackageId noProjectID ifTrue:[
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  2188
        module := classPackage asPackageId module.
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  2189
        directory := classPackage asPackageId directory.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2190
    ] ifFalse:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2191
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2192
        "/ defaults, if nothing at all is known
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2193
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2194
        (module := LastModule) isNil ifTrue:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2195
            module := (OperatingSystem getLoginName).
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2196
        ].
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2197
        (directory := LastPackage) isNil ifTrue:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2198
            directory := 'private'.
3153
c2bca6dbe3a7 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3146
diff changeset
  2199
        ]. 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2200
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2201
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2202
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2203
    "/ 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
  2204
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2205
    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2206
        directory isNil ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2207
            (nm := project repositoryDirectory) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2208
                nm := project name
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2209
            ].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2210
            directory := nm.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2211
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2212
        module isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2213
            (nm := project repositoryModule) notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2214
                module := nm
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2215
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2216
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2217
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2218
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2219
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2220
    "/ 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
  2221
    "/ if so, take that as a default.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2222
    "/
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  2223
    info := mgr sourceInfoOfClass:aClass.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2224
    info notNil ifTrue:[
1368
20cde03a3cd6 defineSource - fixed package & module extraction
martin
parents: 1347
diff changeset
  2225
        true "module ~= LastModule" ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2226
            (info includesKey:#module) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2227
                module := (info at:#module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2228
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2229
        ].
1401
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  2230
"/        true "package ~= LastPackage" ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  2231
"/            (info includesKey:#directory) ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  2232
"/                package := (info at:#directory).
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  2233
"/            ].
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  2234
"/        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2235
        fileName := mgr containerFromSourceInfo:info.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2236
        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2237
            nameSpacePrefix := nameSpace name , '::'.
3259
5eb58e78257e refactored
Claus Gittinger <cg@exept.de>
parents: 3227
diff changeset
  2238
            fileName := fileName withoutPrefix:nameSpacePrefix.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2239
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2240
"/        (info includesKey:#fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2241
"/            fileName := (info at:#fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2242
"/        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2243
"/            (info includesKey:#expectedFileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2244
"/                fileName := (info at:#expectedFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2245
"/            ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2246
"/                (info includesKey:#classFileNameBase) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2247
"/                    fileName := (info at:#classFileNameBase) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2248
"/                ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2249
"/            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2250
"/        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2251
    ].
3514
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  2252
    directory isEmptyOrNil ifTrue:[
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  2253
        directory := LastPackage.
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  2254
    ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2255
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2256
    fileName isNil ifTrue:[
1338
bad5961fbff1 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 1323
diff changeset
  2257
        fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2258
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2259
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2260
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2261
        module replaceAll:$\ with:$/.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2262
        directory replaceAll:$\ with:$/.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2263
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2264
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2265
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2266
    "/ 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
  2267
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2268
    doCheckinWithoutAsking := false.
1831
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2269
"/false ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2270
"/    (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2271
"/        answer := Dialog confirmWithCancel:(resources 
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2272
"/                            string:'About to change the source container.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2273
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2274
"/Notice: there is a container for %1 in:
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2275
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2276
"/    %2 / %3 / %4
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2277
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2278
"/Do you want to change it or check right into that container ?'
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2279
"/                            with:className
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2280
"/                            with:module
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2281
"/                            with:directory
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2282
"/                            with:fileName)
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2283
"/                labels:(resources array:#('Cancel' 'Check in' 'Change')).
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  2284
"/        answer isNil ifTrue:[AbortOperationRequest raise].
1831
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2285
"/        answer ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2286
"/            doCheckinWithoutAsking := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2287
"/            oldModule := module.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2288
"/            oldPackage := directory.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2289
"/            oldFileName := fileName
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2290
"/        ] ifFalse:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2291
"/            doCheckinWithoutAsking := true.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2292
"/            creatingNew := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2293
"/        ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2294
"/    ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  2295
"/].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2296
    mgr isContainerBased ifTrue:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2297
        doCheckinWithoutAsking ifFalse:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2298
            "/
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2299
            "/ open a dialog for this
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2300
            "/
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2301
            (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2302
                note := 'Notice: class seems to have no container yet.'.
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2303
                creatingNew := true.
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2304
            ] ifTrue:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2305
                creatingNew := false.
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2306
            ].
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2307
            confirmNewFiles ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2308
                rslt := self 
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2309
                            askForContainer:boxText title:title note:note
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2310
                            initialModule:module initialPackage:directory initialFileName:fileName
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2311
                            forNewContainer:true.        
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2312
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2313
                rslt isNil ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2314
                    ^ false
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2315
                ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2316
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2317
                module := rslt at:#module.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2318
                directory := rslt at:#package.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2319
                fileName := rslt at:#fileName.
3514
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  2320
                (module isEmptyOrNil or:[directory isEmptyOrNil or:[fileName isEmptyOrNil]]) ifTrue:[
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  2321
                    ^ false
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  2322
                ].
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2323
            ]
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2324
        ].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2325
        (fileName endsWith:',v') ifTrue:[
3227
bcaec3eb2d97 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3202
diff changeset
  2326
            fileName := fileName copyButLast:2
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2327
        ].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2328
        (fileName endsWith:'.st') ifFalse:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2329
            fileName := fileName , '.st'
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2330
        ].
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  2331
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2332
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2333
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2334
    "/ 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
  2335
    "/ check for this ...
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2336
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2337
    requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol.
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2338
    requiredPackage ~= aClass package ifTrue:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2339
"/        doCheckinWithoutAsking ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2340
"/            (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
  2341
"/            ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2342
"/                ^ false
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2343
"/            ]
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2344
"/        ].
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  2345
        aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage].
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2346
        aClass package:requiredPackage.
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2347
    ].
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2348
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2349
    info := aClass revisionInfo.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2350
    info notNil ifTrue:[
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2351
        (info repositoryPathName isNil) ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2352
            info := nil
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2353
        ].
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2354
"/        (info includesKey:#repositoryPathName) ifFalse:[
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2355
"/            info := nil
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2356
"/        ]
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2357
    ].
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  2358
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2359
    info isNil ifTrue:[
1004
1bd564960810 dont ask if a version method should be created - just do it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
  2360
        true "doCheckinWithoutAsking" ifFalse:[
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  2361
            answer := Dialog 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  2362
                 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
  2363
                 labels:(resources array:#( 'Cancel' 'No' 'Yes')).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  2364
            answer isNil ifTrue:[^ false].
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  2365
        ] ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  2366
            answer := true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2367
        ].
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  2368
        answer ifTrue:[
2637
dbfb2ef410bd changed:
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  2369
            mgr
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2370
                updateVersionMethodOf:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2371
                for:(mgr initialRevisionStringFor:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2372
                         inModule:module 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2373
                         directory:directory 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2374
                         container:fileName).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  2375
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2376
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2377
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2378
    (self checkForExistingModule:module usingManager:mgr allowCreate:(createDirs or:[creatingNew]))
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2379
        ifFalse:[^ false].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2380
    LastModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2381
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2382
    (self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:(createDirs or:[creatingNew]))
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2383
        ifFalse:[^ false].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2384
    LastPackage := directory.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2385
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2386
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2387
    "/ check for the container itself
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2388
    "/
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2389
    (mgr isContainerBased not
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2390
    or:[ mgr checkForExistingContainer:fileName inModule:module directory:directory ]) ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2391
"/            (oldModule notNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2392
"/            and:[(oldModule ~= module)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2393
"/                 or:[oldPackage ~= package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2394
"/                 or:[oldFileName ~= fileName]]])
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2395
"/            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2396
"/                self warn:(resources string:'no change').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2397
"/                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2398
"/            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2399
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2400
        mgr isContainerBased ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2401
            creatingNew ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2402
                self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:directory) withCRs.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2403
            ].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2404
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2405
            doCheckinWithoutAsking ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2406
                (Dialog 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2407
                    confirm:(resources string:'check %1 into the existing container
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2408
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2409
    %2 / %3 / %4  ?'
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2410
                                    with:className
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2411
                                    with:module 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2412
                                    with:directory 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2413
                                    with:fileName) withCRs
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2414
                    noLabel:'Cancel') 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2415
                ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2416
                    ^ false.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2417
                ].  
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2418
            ].  
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2419
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2420
2637
dbfb2ef410bd changed:
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  2421
        mgr 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2422
            updateVersionMethodOf:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2423
            for:('$' , 'Header' , '$'). "/ concatenated to avoid RCS-expansion
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2424
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2425
        oldFileName notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2426
            msg := ('forced checkin / source container change from ' , oldFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2427
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2428
            msg := 'defined source container'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2429
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2430
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2431
        (forceCheckIn := doCheckinWithoutAsking) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2432
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2433
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2434
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2435
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2436
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2437
                logMessage:msg)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2438
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2439
                doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2440
                    (Dialog 
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  2441
                        confirm:'No easy merge seems possible; force checkin (no merge) ?'
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  2442
                        noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2443
                    ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2444
                        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2445
                    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2446
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2447
                forceCheckIn := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2448
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2449
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2450
        forceCheckIn ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2451
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2452
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2453
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2454
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2455
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2456
                logMessage:msg
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2457
                force:true)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2458
            ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  2459
                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
  2460
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2461
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2462
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2463
        ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2464
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2465
        (createContainer or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2466
            (Dialog
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  2467
                 confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2468
                                      with:fileName with:module with:directory) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  2469
                 noLabel:'Cancel') ifFalse:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2470
                ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2471
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2472
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2473
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2474
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2475
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage].
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2476
    aClass package:requiredPackage.
1913
d87c1ed5bf1f oops - halt
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  2477
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  2478
    [ mgr
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2479
        createContainerFor:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2480
        inModule:module
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2481
        package:directory
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2482
        container:fileName
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  2483
    ] whileFalse:[
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  2484
        (Dialog confirm:(resources stringWithCRs:'Failed to create container.\(fix your setup then retry, or cancel)\\Retry?') yesLabel:'Retry') ifFalse:[
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  2485
            ^ false.
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  2486
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2487
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2488
    ^ true
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  2489
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2490
    "Created: / 21-12-2011 / 18:34:02 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2491
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2492
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2493
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2494
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2495
        diffSetOfProject:aProject 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2496
        againstRepositoryVersionFrom:aDateOrNilForNewest
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2497
        orTag:nil
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2498
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2499
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2500
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest orTag:aTagOrNil
2950
cd6dc0f1d994 comment/format in: #diffSetOfProject:againstRepositoryVersionFrom:orTag:
Claus Gittinger <cg@exept.de>
parents: 2949
diff changeset
  2501
    "return a diffset against either the newest (head), or the version at a particular date,
cd6dc0f1d994 comment/format in: #diffSetOfProject:againstRepositoryVersionFrom:orTag:
Claus Gittinger <cg@exept.de>
parents: 2949
diff changeset
  2502
     or a the version with a particular tag."
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2503
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2504
    |classesInImage filesInImage module directory perProjectInfo 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2505
     classesNotInRepository filesNotInImage classesDeletedInRepository
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2506
     classesModifiedInImage classesNotReallyModified classesReallyModified classesNewerInRepository 
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2507
     classesAddedInImage extensionMethods extensionsInImage extensionsInRepository extensionDiffs
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2508
     box doCleanup diffSet def autoloadedFilesNotInImage 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2509
     autoloadedClassesInImage autoloadedFilesInImage versionMethodsAndDoitsRejected|
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2510
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2511
    module := aProject asPackageId module.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2512
    directory := aProject asPackageId directory.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2513
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2514
    (aDateOrNilForNewest isNil and:[ aTagOrNil notNil ]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2515
        perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aTagOrNil.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2516
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2517
        perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilForNewest.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2518
    ].
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2519
    perProjectInfo := perProjectInfo ? #().
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2520
    perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2521
    perProjectInfo := Dictionary withAssociations:perProjectInfo.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2522
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2523
    "/ to ignore version_xxx methods
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2524
    versionMethodsAndDoitsRejected := 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2525
        [:aChangeSet | 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2526
            aChangeSet reject:[:chg | 
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2527
                false "chg isMethodChangeForVersionMethod" 
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2528
                or:[false "chg isMethodChangeForExtensionsVersionMethod"
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2529
                or:[chg isDoIt]]]
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2530
        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2531
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2532
    classesInImage := Smalltalk allClassesInPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2533
    autoloadedClassesInImage := classesInImage reject:[:cls | cls isLoaded].
2903
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  2534
    classesInImage := classesInImage select:[:cls | cls isLoaded and:[cls isPrivate not]].
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  2535
    filesInImage := classesInImage collect:[:cls | cls classBaseFilename] as:Set.
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  2536
    autoloadedFilesInImage := autoloadedClassesInImage collect:[:cls | cls classBaseFilename] as:Set.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2537
    "/ any differences ?
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2538
    classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2539
    classesDeletedInRepository := classesInImage select:[:cls | (perProjectInfo at:cls classBaseFilename ifAbsent:nil) == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2540
    perProjectInfo := perProjectInfo reject:[:v | v == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2541
    filesNotInImage := perProjectInfo keys reject:[:file | (filesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2542
    filesNotInImage := filesNotInImage reject:[:file | (autoloadedFilesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2543
    filesNotInImage remove:'extensions.st' ifAbsent:[].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2544
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2545
    "/ if comparing against the newest, only look for chaged stuff
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2546
    classesModifiedInImage := classesInImage select:[:cls | ChangeSet current includesChangeForClassOrMetaclass:cls].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2547
    classesModifiedInImage := classesModifiedInImage \ classesNotInRepository.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2548
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2549
    classesNewerInRepository := classesInImage 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2550
                                    select:[:cls | 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2551
                                        |v clsRevision|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2552
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2553
                                        v := (perProjectInfo at:cls classBaseFilename ifAbsent:nil).
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2554
                                        v notNil 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2555
                                            and:[ cls isLoaded 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2556
                                            and:[ (clsRevision := cls revision) notNil 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2557
                                            and:[ v > clsRevision ]]]
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2558
                                    ].
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2559
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2560
    "/ stupid: as we do not have any revision information for extensions (sigh);
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2561
    "/ we must checkout and look at the extension.st contents, to see if it has changed.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2562
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2563
    extensionMethods := Smalltalk allExtensionsForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2564
    extensionsInImage := ChangeSet forExistingMethods:extensionMethods.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2565
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2566
    [
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2567
        |s extensionsRevision|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2568
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2569
        extensionsRevision := perProjectInfo at:'extensions.st' ifAbsent:#newest.
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2570
        [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2571
            s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2572
                    streamForClass:nil fileName:'extensions.st' revision:extensionsRevision 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2573
                    directory:directory module:module cache:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2574
            s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2575
                extensionsInRepository := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2576
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2577
        ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2578
            s notNil ifTrue:[s close]
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2579
        ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2580
        extensionsInRepository isNil ifTrue:[extensionsInRepository := ChangeSet new].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2581
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2582
        "/ ignore package doIts and all extensionVersion_xxx methods
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2583
        extensionsInRepository := versionMethodsAndDoitsRejected value:extensionsInRepository.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2584
    ] value.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2585
    extensionDiffs := extensionsInRepository diffSetsAgainst:extensionsInImage.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2586
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2587
    diffSet := extensionDiffs copy.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2588
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2589
    (aDateOrNilForNewest isNil and:[aTagOrNil isNil]) ifTrue:[
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2590
        "/ we could do the same as below for each class.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2591
        "/ however - as we do have change-info and revision info, we can avoid checking out
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2592
        "/ for all classes which are not changed and which have the same version info.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2593
        classesModifiedInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2594
            classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2595
                classesModifiedInImage select:[:eachChangedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2596
                    |currentVersion repositoryVersion s stFile diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2597
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2598
                    stFile := eachChangedClass classBaseFilename.
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2599
                    [    
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2600
                        s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2601
                                streamForClass:nil fileName:stFile revision:#newest 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2602
                                directory:directory module:module cache:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2603
                        s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2604
                            repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2605
                        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2606
                    ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2607
                        s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2608
                    ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2609
                    repositoryVersion isNil ifTrue:[ repositoryVersion := ChangeSet new ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2610
                    repositoryVersion := versionMethodsAndDoitsRejected value:repositoryVersion.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2611
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2612
                    currentVersion := ChangeSet forExistingClass:eachChangedClass withExtensions:false withLooseMethods:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2613
                    currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2614
                    diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2615
                    diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2616
                    diffs notEmpty
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2617
                ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2618
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2619
            classesNotReallyModified := classesModifiedInImage \ classesReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2620
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2621
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2622
        classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2623
            classesInImage select:[:eachClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2624
                |currentVersion repositoryVersion s stFile stRevision diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2625
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2626
                stFile := eachClass classBaseFilename.
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2627
                stRevision := perProjectInfo at:stFile ifAbsent:nil.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2628
                stRevision notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2629
                    [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2630
                        s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2631
                                streamForClass:nil fileName:stFile revision:stRevision 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2632
                                directory:directory module:module cache:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2633
                        s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2634
                            repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2635
                        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2636
                    ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2637
                        s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2638
                    ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2639
                ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2640
                repositoryVersion isNil ifTrue:[
2295
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  2641
                    repositoryVersion := ChangeSet new.
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  2642
                ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2643
                repositoryVersion := versionMethodsAndDoitsRejected value:repositoryVersion.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2644
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2645
                currentVersion := ChangeSet forExistingClass:eachClass withExtensions:false withLooseMethods:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2646
                currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2647
                diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2648
                diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2649
                diffs notEmpty
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2650
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2651
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2652
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2653
    filesNotInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2654
        "/ first, check if these are autoloaded classes which have NOT been installed
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2655
        "/ (for example, due to a --quick argument during startup)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2656
        autoloadedFilesNotInImage := OrderedCollection new.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2657
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2658
        def := ProjectDefinition definitionClassForPackage:aProject createIfAbsent:false projectType:nil.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2659
        def notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2660
            def classNamesAndAttributesDo:[:eachClassname :eachAttributes | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2661
                |cls eachFileName isAutoload|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2662
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2663
                cls := Smalltalk classNamed:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2664
                cls isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2665
                    isAutoload := eachAttributes includes:#autoload.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2666
                    isAutoload ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2667
                        eachFileName := Smalltalk fileNameForClass:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2668
                        autoloadedFilesNotInImage add:(eachFileName , '.st')
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2669
                    ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2670
                ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2671
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2672
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2673
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2674
        (filesNotInImage \ autoloadedFilesNotInImage) do:[:eachSTFile |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2675
            |s chgSet classDefinitions|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2676
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2677
            [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2678
                s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2679
                        streamForClass:nil fileName:eachSTFile revision:#newest directory:directory module:module cache:true.
3594
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  2680
                s isNil ifTrue:[
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  2681
                    chgSet := ChangeSet new
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  2682
                ] ifFalse:[
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  2683
                    chgSet := ChangeSet fromStream:s.
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  2684
                ]
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2685
            ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2686
                s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2687
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2688
            chgSet := versionMethodsAndDoitsRejected value:chgSet.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2689
            diffSet onlyInReceiver addAll:chgSet
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2690
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2691
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2692
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2693
    classesNewerInRepository notEmpty ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2694
        classesNewerInRepository do:[:eachClass|
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2695
            |s diffs repositoryVersion currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2696
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2697
            [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2698
                s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2699
                        streamForClass:eachClass fileName:nil revision:#newest directory:directory module:module cache:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2700
                repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2701
            ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2702
                s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2703
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2704
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2705
            currentVersion := ChangeSet forExistingClass:eachClass withExtensions:false withLooseMethods:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2706
            currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2707
            diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2708
            diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2709
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2710
    ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2711
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2712
    classesDeletedInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2713
"/ self halt.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2714
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2715
    classesNotInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2716
        "/ if there are no changeSet entries for those classes, they seem to be
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2717
        "/ no longer in the repository (possibly moved ?)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2718
        "/ If there are entries, these might have been added in the image and need a check-in
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2719
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2720
        classesAddedInImage := classesNotInRepository \ classesDeletedInRepository.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2721
        classesAddedInImage do:[:eachAddedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2722
            |currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2723
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2724
            currentVersion := ChangeSet forExistingClass:eachAddedClass withExtensions:false withLooseMethods:true.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2725
            currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2726
            diffSet onlyInArg addAll:currentVersion.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2727
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2728
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2729
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2730
    diffSet isEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2731
        "/ Dialog information:(resources string:'%1 is up-to-date.' with:eachProject allBold).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2732
        Transcript showCR:('%1 is up-to-date.' bindWith:aProject allBold).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2733
        (ChangeSet current includesChangeForPackage:aProject) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2734
            (Dialog confirm:('%1 is up-to-date.\\Cleanup ChangeSet ?' bindWith:aProject allBold) withCRs) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2735
                ChangeSet current condenseChangesForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2736
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2737
        ].
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2738
        ^ diffSet.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2739
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2740
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2741
    "/ as a side-effect, if we find that some classes are modified but the same as in the repository,
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2742
    "/ give user a chance to cleanup the changeSet here.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2743
    aDateOrNilForNewest isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2744
        classesNotReallyModified notEmptyOrNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2745
            doCleanup := false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2746
            box := Dialog
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2747
                forRequestText:(resources 
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2748
                                    stringWithCRs:'The following classes from %1 are equal to the repository version.\\Remove entries from the changeSet?'
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2749
                                    with:aProject allBold) 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2750
                editViewClass:ListView
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2751
                lines:10 columns:20 
3199
830195868b71 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  2752
                initialAnswer:nil 
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2753
                setupWith:
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2754
                   [:v :d | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2755
                            |removeButton|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2756
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2757
                            v list:classesNotReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2758
                            removeButton := Button label:(resources string:'Cleanup ChangeSet').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2759
                            removeButton action:[ doCleanup := true. box okPressed. ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2760
                            d addButton:removeButton after:(d okButton).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2761
                            d okButton label:(resources string:'Continue').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2762
                            d okButton isReturnButton:false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2763
                            removeButton isReturnButton:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2764
                   ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2765
            box open.
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2766
            box accepted ifTrue:[
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2767
                doCleanup ifTrue:[
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2768
                    classesNotReallyModified do:[:class |
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2769
                        ChangeSet current condenseChangesForClass:class.
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2770
                    ]
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2771
                ].
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2772
            ]
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2773
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2774
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2775
    ^ diffSet
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  2776
2295
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  2777
    "Modified: / 01-11-2010 / 21:02:52 / cg"
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2778
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2779
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2780
diffSetOfProject:aProject againstRepositoryVersionTaggedAs:symbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2781
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2782
        diffSetOfProject:aProject 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2783
        againstRepositoryVersionFrom:nil
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2784
        orTag:symbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2785
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2786
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2787
ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2788
    |theMetaclass src newSrc versionMethodName oldVersionMethodName|
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2789
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2790
    theMetaclass := aClass theMetaclass.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2791
    versionMethodName := aManager nameOfVersionMethodInClasses.
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  2792
    oldVersionMethodName := aClass nameOfOldVersionMethod.
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2793
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2794
    (theMetaclass includesSelector:versionMethodName) ifTrue:[
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  2795
"/        (theMetaclass includesSelector:oldVersionMethodName) ifTrue:[
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  2796
"/            theMetaclass removeSelector:oldVersionMethodName.   
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  2797
"/        ].
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2798
        "/ ensure that my version method is parsable (contains $'s)
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2799
        src := (theMetaclass compiledMethodAt:versionMethodName) source.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2800
        src notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2801
            newSrc := aManager ensureDollarsInVersionMethod:src.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2802
            newSrc ~= src ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2803
                theMetaclass compile:newSrc.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2804
            ]
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2805
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2806
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2807
        (theMetaclass includesSelector:oldVersionMethodName) ifTrue:[
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2808
            "/ but make sure, it is a version method for this sourcecodemanager...
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2809
            (theMetaclass methodDictionary keys count:[:sel | sel startsWith:'version']) size == 1 ifTrue:[
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2810
                src := (theMetaclass compiledMethodAt:oldVersionMethodName) source.
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2811
                (src startsWith:oldVersionMethodName) ifTrue:[
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2812
                    newSrc := versionMethodName 
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2813
                              , (src copyFrom:(oldVersionMethodName size + 1))
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2814
                ].
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2815
                theMetaclass compile:newSrc.
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2816
            ]
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2817
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2818
    ].
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  2819
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2820
    "Modified: / 20-08-2011 / 14:40:27 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2821
    "Created: / 29-12-2011 / 14:33:46 / cg"
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2822
!
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2823
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2824
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil forClass:aClass valuesInto:aBlock
3325
944f6a6e66ff class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3313
diff changeset
  2825
    "open a dialog, asking for commit/checkin log info.
944f6a6e66ff class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3313
diff changeset
  2826
     Returns 2 values: a log message and additional checkinInfo (containing things like
944f6a6e66ff class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3313
diff changeset
  2827
     markAsStable, etc,)"
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2828
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2829
    |initialLogMessage checkinInfo logMessage|
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2830
    
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2831
    "/ heuristics for a useful initial log message...
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2832
    aLogInfoOrNil isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2833
        initialLogMessage := (self goodInitialLogMessageForCheckinClassOfClass:aClass) ? ''.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2834
        "/ initial checkin ?
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2835
        (aClass package isNil or:[aClass revision isNil]) ifTrue:[ 
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2836
            initialLogMessage := 'initial checkin\\' withCRs , initialLogMessage
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2837
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2838
        checkinInfo := self 
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2839
                        getCheckinInfoFor:aClass name 
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2840
                        initialAnswer:initialLogMessage.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2841
        checkinInfo isNil ifTrue:[^ false].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2842
        logMessage := checkinInfo logMessage.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2843
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2844
        aLogInfoOrNil isString ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2845
            "soon obsolete..."    
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2846
            logMessage := aLogInfoOrNil
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2847
        ] ifFalse:[ 
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2848
            checkinInfo := aLogInfoOrNil.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2849
            logMessage := checkinInfo logMessage.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2850
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2851
    ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2852
    logMessage notNil ifTrue:[  
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2853
        logMessage := logMessage asSingleByteStringReplaceInvalidWith:$?
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2854
    ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2855
    aBlock value:logMessage value:checkinInfo.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2856
    ^ true
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2857
!
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  2858
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2859
removeSourceContainerForClass:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2860
    "show container & let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2861
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2862
    ^ self removeSourceContainerForClass:aClass confirm:true warn:true
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2863
!
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2864
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2865
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2866
    "show container & optionally let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2867
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  2868
    |module directory fileName info mgr|
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2869
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2870
    aClass isLoaded ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2871
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2872
            self warn:(resources string:'Please load the class first.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2873
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2874
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2875
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2876
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2877
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2878
    "/ 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
  2879
    "/ if so, take that as a default.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2880
    "/
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  2881
    mgr := self sourceCodeManagerFor:aClass.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2882
    mgr isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2883
        ^ false
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2884
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2885
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2886
    info := mgr sourceInfoOfClass:aClass.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2887
    info notNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2888
        (info includesKey:#module) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2889
            module := (info at:#module).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2890
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2891
        (info includesKey:#directory) ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2892
            directory := (info at:#directory).
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2893
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2894
        fileName := mgr containerFromSourceInfo:info.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2895
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2896
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2897
    module isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2898
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2899
            self warn:(resources stringWithCRs:'classes module is unknown.\\It seems to not have a container.') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2900
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2901
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2902
    ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2903
    directory isNil ifTrue:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2904
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2905
            self warn:(resources stringWithCRs:'classes package is unknown.\\It seems to not have a container.') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2906
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2907
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2908
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2909
    fileName isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2910
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2911
            self warn:(resources stringWithCRs:'classes container fileName is unknown.\\It seems to not have a container.') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2912
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2913
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2914
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2915
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2916
    OperatingSystem isMSDOSlike ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2917
        "cvs expects unix-filenames"
3591
d86841bb0d5c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3579
diff changeset
  2918
        module := module asUnixFilenameString.
d86841bb0d5c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3579
diff changeset
  2919
        directory := directory asUnixFilenameString.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2920
    ].
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  2921
    (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2922
        doWarn ifTrue:[
2830
f5204449764a changed: #removeSourceContainerForClass:confirm:warn:
Claus Gittinger <cg@exept.de>
parents: 2818
diff changeset
  2923
            self warn:(resources stringWithCRs:'Class had no source container (or SCM access is broken).') .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2924
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2925
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2926
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2927
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2928
    doConfirm ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2929
        (Dialog
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2930
            choose:(resources 
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  2931
                        stringWithCRs:'Please confirm removal of the container for %1:
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2932
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2933
container:    %2 / %3 / %4
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2934
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2935
Really remove ?' 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2936
                        with:aClass name 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2937
                        with:module 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2938
                        with:directory 
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2939
                        with:fileName) 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2940
            labels:(Array 
1129
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  2941
                        with:(resources string:'No') 
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  2942
                        with:(resources string:'Remove'))
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2943
            values:#(false true)
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2944
            default:false) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2945
            ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2946
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2947
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2948
1921
ab2e300fbc9c oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  2949
    (mgr removeContainer:fileName
ab2e300fbc9c oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  2950
                inModule:module
ab2e300fbc9c oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  2951
               directory:directory) ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2952
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2953
            self warn:(resources string:'failed to remove container.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2954
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2955
        ^ true.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2956
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  2957
    ^ false
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2958
3351
68989ed1137f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3344
diff changeset
  2959
    "Modified: / 16-07-2013 / 19:46:50 / cg"
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2960
!
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  2961
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2962
repositoryLogOf:aClass onto:aStream
2050
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2963
    self repositoryLogOf:aClass short:false onto:aStream
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2964
!
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2965
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  2966
repositoryLogOf:aClass short:shortOrNot onto:aStream
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2967
    |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
  2968
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2969
    info := aClass revisionInfo.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2970
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2971
    rv := aClass binaryRevision.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2972
    rv notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2973
        aStream nextPutLine:'**** Loaded classes binary information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2974
        aStream nextPutLine:'  Binary based upon : ' , rv.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2975
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2976
    ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  2977
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2978
    "/ old
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2979
"/    info isNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2980
"/        aStream nextPutLine:'No revision info found'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2981
"/        aClass isLoaded ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2982
"/            aStream cr; nextPutAll:'This is an autoloaded class - you may see more after it is loaded.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2983
"/        ] ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2984
"/            fn := aClass classFilename.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2985
"/            aClass wasAutoloaded ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2986
"/                msg := 'This class was autoloaded.'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2987
"/                msg := msg , ' (from ''' , fn , ''')'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2988
"/            ] ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2989
"/                msg := 'This class was loaded from ''' , fn , '''.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2990
"/            ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2991
"/            msg notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2992
"/                aStream cr; nextPutAll:msg.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2993
"/            ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2994
"/        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2995
"/        ^ self
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2996
"/    ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2997
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2998
    info isNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  2999
        aClass isLoaded ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3000
            aStream nextPutLine:'This is an autoloaded class - you may see more after it is loaded.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3001
        ] ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3002
            fn := aClass classFilename.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3003
            aClass wasAutoloaded ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3004
                msg := 'This class was autoloaded.'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3005
                msg := msg , ' (from ''' , fn , ''')'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3006
            ] ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3007
                msg := 'This class was loaded from ''' , fn , '''.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3008
            ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3009
            msg notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3010
                aStream nextPutLine:msg.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3011
            ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3012
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3013
        aStream cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3014
    ] ifFalse:[
2041
fb85bf748dbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  3015
        (info revision notNil) ifFalse:[
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3016
            aStream nextPutLine:'WARNING:'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3017
            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
  3018
            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
  3019
            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
  3020
            aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3021
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3022
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3023
        aStream nextPutLine:'**** Classes source information ****'; cr.
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3024
        s := info repositoryPathName.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3025
        s notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3026
            aStream nextPutLine:'  Source repository : ' , s
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3027
        ].
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3028
        aStream nextPutLine:'  Filename ........ : ' , (info fileName ? '?').
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3029
        aStream nextPutLine:'  Revision ........ : ' , (info revision ? '?').
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3030
        aStream nextPutLine:'  Checkin date .... : ' , (info date  ? '?') , ' ' , 
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3031
                                                       (info time ? '?'), ' ', 
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3032
                                                       (info timezone ? '').
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3033
        aStream nextPutLine:'  Checkin user .... : ' , (info user ? '?').
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3034
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3035
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3036
    (info2 := aClass packageSourceCodeInfo) notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3037
        aStream nextPutLine:'  Repository: ..... : ' , (info2 at:#module ifAbsent:'?').
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3038
        aStream nextPutLine:'  Directory: ...... : ' , (info2 at:#directory ifAbsent:'?').
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3039
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3040
    info notNil ifTrue:[
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3041
        aStream nextPutLine:'  Container ....... : ' , (info repositoryPathName ? '?').
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3042
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3043
    aStream cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3044
    mgr := self sourceCodeManagerFor:aClass.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3045
    mgr notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3046
        aStream nextPutLine:'**** Repository information ****'; cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3047
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3048
        module := nil.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3049
        info2 notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3050
            module := info2 at:#module ifAbsent:nil.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3051
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3052
        module notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3053
            aStream nextPutLine:('  Repository URL ......: ' , 
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3054
                                ((mgr repositoryNameForPackage:aClass package) ifNil:[mgr repositoryName , ' (default)'])).
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3055
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3056
        mgr writeRevisionLogOf:aClass short:shortOrNot to:aStream.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3057
    ]
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3058
2836
91e9be94d80b changed: #repositoryLogOf:short:onto:
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  3059
    "Modified: / 12-10-2011 / 18:06:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
91e9be94d80b changed: #repositoryLogOf:short:onto:
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  3060
    "Modified: / 11-07-2012 / 13:50:59 / cg"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3061
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3062
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3063
tagClass:aClass as:tag
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3064
    |mgr|
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3065
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3066
    mgr := self sourceCodeManagerFor:aClass.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3067
    mgr
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3068
        setSymbolicName:tag 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3069
        revision:nil 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3070
        overWrite:true 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3071
        class:aClass.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3072
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3073
    "Modified: / 12-09-2006 / 13:03:59 / cg"
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3074
!
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3075
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3076
tagClasses:aCollectionOfClasses as:tag
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3077
    |classesPerManager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3078
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3079
    classesPerManager := Dictionary new.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3080
    aCollectionOfClasses 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3081
        do:[:eachClass | 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3082
            |manager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3083
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3084
            manager := self sourceCodeManagerFor:eachClass.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3085
            (classesPerManager at:manager ifAbsentPut:[Set new]) add:eachClass
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3086
        ].
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3087
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3088
    classesPerManager keysAndValuesDo:[:manager :classesPerManager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3089
        manager
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3090
            setSymbolicName:tag 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3091
            revision:nil 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3092
            overWrite:true 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3093
            classes:classesPerManager.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3094
    ].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3095
    ^ true
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3096
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3097
    "Created: / 12-09-2006 / 13:04:29 / cg"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3098
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3099
2602
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3100
tagPackage: package as:tag
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3101
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3102
    self tagClasses:(Smalltalk allClassesInPackage:package) as:tag.
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3103
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3104
    "Created: / 12-09-2006 / 13:04:29 / cg"
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3105
    "Created: / 15-10-2011 / 22:47:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3106
!
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  3107
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3108
tagPath:aPath as:tag usingManager:aManager
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3109
    aManager 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3110
        setSymbolicName:tag 
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3111
        revision:nil 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3112
        overWrite:true 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  3113
        path:aPath.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3114
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  3115
    "Modified: / 12-09-2006 / 12:04:44 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3116
    "Created: / 29-12-2011 / 14:32:38 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3117
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3118
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  3119
!SourceCodeManagerUtilities methodsFor:'utilities-cvs-helpers'!
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3120
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3121
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3122
    "check-out all previous versions of aClass and retrieve the history of selector.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3123
     Return a dictionary associating revision with a changeList entries for that method.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3124
     Unfinished - need a GUI for that."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3125
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3126
    |mgr theClass revisionLog revisions items s entriesPerRevision previousVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3127
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3128
    theClass := aClass theNonMetaclass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3129
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3130
    mgr := self sourceCodeManagerFor:theClass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3131
    mgr isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3132
        self error:'no sourceCodeManager'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3133
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3134
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3135
    revisionLog := mgr
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3136
                        revisionLogOf:theClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3137
                        numberOfRevisions:numberOfRevisionsOrNil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3138
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3139
    revisions := revisionLog at:#revisions.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3140
    items := revisions collect:[:each | |rev date who|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3141
                                    rev := each at:#revision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3142
                                    date := each at:#date.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3143
                                    who := each at:#author.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3144
                                    rev allBold , ' [' , date , ' by ' , who , ']'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3145
                               ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3146
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3147
    revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3148
    revisions addFirst:#current.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3149
    entriesPerRevision := Dictionary new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3150
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3151
    previousVersion := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3152
    revisions reverseDo:[:eachRevision |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3153
        |srcStream entries thisVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3154
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3155
        eachRevision == #current ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3156
            s := '' writeStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3157
            theClass fileOutOn:s withTimeStamp:false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3158
            srcStream := s contents readStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3159
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3160
            self activityNotification:('checking out revision ' , eachRevision , '...').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3161
            srcStream := mgr getSourceStreamFor:theClass revision:eachRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3162
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3163
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3164
        entries := ChangeSet fromStream:srcStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3165
        srcStream close.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3166
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3167
        "/ remove all definitions       
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3168
        entries := entries select:[:each | each isMethodChange].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3169
        "/ remove all methods which are for other selectors      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3170
        entries := entries select:[:each | each selector == selector].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3171
        "/ remove all methods which are for private subclasses      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3172
        entries := entries select:[:each | each className = aClass name].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3173
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3174
        entries size == 1 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3175
            "/ the method is there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3176
            thisVersion := entries first.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3177
            (previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3178
                "/ no change
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3179
            ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3180
                entriesPerRevision at:eachRevision put:thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3181
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3182
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3183
            "/ the method is not there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3184
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3185
        previousVersion := thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3186
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3187
    self error:'unfinished code'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3188
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3189
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3190
     self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3191
     self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3192
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3193
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3194
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  3195
!SourceCodeManagerUtilities methodsFor:'utilities-cvs-user interaction'!
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3196
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3197
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3198
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3199
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3200
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3201
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3202
    ^ self
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3203
        askForContainer:boxText title:title note:notice 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3204
        initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3205
        forNewContainer:true
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3206
!
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  3207
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3208
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3209
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3210
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3211
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3212
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  3213
    |box y component answer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3214
     moduleHolder packageHolder fileNameHolder
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3215
     module package fileName 
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3216
     allPackageIDs knownContainers knownPackages packageUpdater
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3217
     packageBoxComponent fileNameBoxComponent fileNameUpdater|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3218
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3219
    allPackageIDs := Smalltalk allProjectIDs.
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3220
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3221
    knownContainers := allPackageIDs collect:[:package | (package upTo:$:)] as:Set.
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3222
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  3223
    knownContainers := knownContainers asOrderedCollection reject:[:module | module isBlank].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3224
    knownContainers sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3225
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3226
    packageUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3227
        |theModulePrefix|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3228
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3229
        theModulePrefix := moduleHolder value , ':'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3230
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3231
        Cursor wait showWhile:[
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3232
            knownPackages := 
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3233
                allPackageIDs
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3234
                    select:[:package | (package startsWith:theModulePrefix)]
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3235
                    thenCollect:[:package | |idx|
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3236
                        idx := package indexOf:$:.
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3237
                        (package copyFrom:idx + 1)].
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3238
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  3239
            knownPackages := knownPackages asSet asOrderedCollection.
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  3240
            knownPackages := knownPackages reject:[:package | package isBlank].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3241
            knownPackages sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3242
            packageBoxComponent list:knownPackages.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3243
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3244
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3245
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3246
    fileNameUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3247
        |module package files|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3248
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3249
        Cursor read showWhile:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  3250
            module := moduleHolder value ? (PackageId noProjectID).
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  3251
            package := packageHolder value ? (PackageId noProjectID).
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3252
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  3253
            files := SourceCodeManager getExistingContainersInModule:module directory:package.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3254
            files := files asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3255
            files := files select:[:eachFile | eachFile asFilename hasSuffix:'st'].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3256
            files sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3257
            fileNameBoxComponent list:files.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3258
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3259
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3260
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3261
    moduleHolder := initialModule asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3262
    packageHolder := initialPackage asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3263
    fileNameHolder := initialFileName asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3264
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3265
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3266
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3267
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3268
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3269
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3270
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3271
    component := box addTextLabel:boxText withCRs adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3272
    component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3273
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3274
    box addVerticalSpace.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  3275
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3276
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3277
    component := box addTextLabel:(resources string:'Module:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3278
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3279
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3280
    component := box addComboBoxOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3281
    component list:knownContainers.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3282
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3283
"/    component := box addInputFieldOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3284
    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3285
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3286
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3287
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3288
    component := box addTextLabel:(resources string:'Package:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3289
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3290
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3291
    packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3292
"/    component := box addInputFieldOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3293
    component width:0.6; left:0.4; "immediateAccept:true; "acceptOnLeave:true; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3294
    packageUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3295
    moduleHolder onChangeEvaluate:packageUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3296
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3297
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3298
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3299
    component := box addTextLabel:(resources string:'Filename:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3300
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3301
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3302
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3303
    forNewContainer ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3304
        component := box addInputFieldOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3305
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3306
    ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3307
        fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3308
        component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3309
        fileNameUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3310
        packageHolder onChangeEvaluate:fileNameUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3311
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3312
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3313
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3314
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3315
    notice notNil ifTrue:[
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3316
        component := box addTextLabel:notice adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3317
        component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3318
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3319
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3320
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3321
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3322
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3323
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3324
        component := Button label:'Yes to all'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3325
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3326
                            YesToAllNotification queryWith:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3327
                            box doAccept.
2253
7d7b0d2d1fe7 changed: #askForContainer:title:note:initialModule:initialPackage:initialFileName:forNewContainer:
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  3328
                            box okPressed.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3329
                         ].
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  3330
        box addButton:component.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3331
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3332
    (AbortAllSignal isHandled) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3333
        component := Button label:'Cancel all'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3334
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3335
                            box hide.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3336
                            AbortAllSignal raiseSignal.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3337
                         ].
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  3338
        box addButton:component before:nil.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3339
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3340
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3341
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3342
        answer := YesToAllQuery query.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3343
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3344
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3345
    answer isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3346
        box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3347
        answer := box accepted
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3348
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3349
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3350
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3351
    answer ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3352
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3353
    ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  3354
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3355
    module := moduleHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3356
    package := packageHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3357
    fileName := fileNameHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3358
    ^ Dictionary new
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3359
        at:#module put:module;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3360
        at:#package put:package;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3361
        at:#fileName put:fileName;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3362
        yourself
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3363
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3364
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3365
     self 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3366
        askForContainer:'enter container' title:'container' note:'some note'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3367
        initialModule:'foo' initialPackage:'bar' initialFileName:'baz'        
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3368
    "
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  3369
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  3370
    "Modified: / 29-08-2013 / 12:26:04 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3371
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3372
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3373
askForExistingRevision:boxText title:title class:aClass
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3374
    "open a dialog asking for a containers revision;
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3375
     return a revision number, or nil if canceled."
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3376
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3377
    |mgr sourceInfo module package fileName|
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3378
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3379
    mgr := self sourceCodeManagerFor:aClass.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3380
    sourceInfo := mgr sourceInfoOfClass:aClass.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3381
    sourceInfo isNil ifTrue:[^ nil].
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3382
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3383
    package := mgr directoryFromSourceInfo:sourceInfo.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3384
    module := mgr moduleFromSourceInfo:sourceInfo.  
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3385
    fileName := mgr containerFromSourceInfo:sourceInfo.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3386
    ^ self
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3387
        askForExistingRevision:boxText 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3388
        title:title 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3389
        class:aClass 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3390
        manager:mgr 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3391
        module:module package:package 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3392
        fileName:fileName
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3393
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3394
    "
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3395
     SourceCodeManagerUtilities
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3396
        askForRevisionToCompare:'enter revision'
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3397
        title:'revision'
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3398
        class:Array
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3399
    "
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3400
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3401
    "Modified: / 12-09-2006 / 14:17:04 / cg"
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3402
!
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  3403
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  3404
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:directory fileName:fileName
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3405
    "open a dialog asking for a containers revision;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3406
     return a revision number, or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3407
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3408
    |partialLog revisions items newestRev
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  3409
     box y component revisionHolder symbolicNames stableRevision releasedRevision
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3410
     tagHolder tagList lockChange|
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3411
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3412
    partialLog := aSourceCodeManager
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3413
        revisionLogOf:clsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3414
        numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3415
        fileName:fileName
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  3416
        directory:directory 
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3417
        module:module.
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  3418
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3419
    partialLog notNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3420
        newestRev := partialLog at:#newestRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3421
        revisions := partialLog at:#revisions.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3422
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3423
        symbolicNames notNil ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3424
            stableRevision := symbolicNames at:'stable' ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3425
            releasedRevision := symbolicNames at:'released' ifAbsent:[].
3332
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  3426
            tagList := ((symbolicNames associations sort:[:a :b | a key < b key "self versionString:(a value) isLessThan:(b value)"])
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3427
                         collect:[:assoc | assoc key]) reverse.
3332
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  3428
            tagList remove:'stable' ifAbsent:[].
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  3429
            tagList notEmpty ifTrue:[tagList addFirst:'-'].
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  3430
            tagList addFirst:'stable'.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3431
        ].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3432
            
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3433
        items := revisions collect:[:each | |rev date who flag|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3434
                                        rev := each at:#revision.
2670
2aee2fd0314e refactoring
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  3435
                                        date := (each at:#date ifAbsent:nil) ? '?'.
2aee2fd0314e refactoring
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  3436
                                        who := (each at:#author ifAbsent:nil) ? '?'.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3437
                                        rev = stableRevision ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3438
                                            flag := ' Stable' allBold.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3439
                                        ] ifFalse:[rev = releasedRevision ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3440
                                            flag := ' Released' allBold.
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3441
                                        ] ifFalse:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3442
                                            flag := ' '
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3443
                                        ]].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3444
                                        rev allBold , flag, ' [' , date , ' by ' , who , ']'
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3445
                                   ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3446
        revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3447
    ] ifFalse:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  3448
        newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3449
        revisions := items := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3450
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3451
        newestRev isNil ifTrue:[
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  3452
            (aSourceCodeManager checkForExistingContainer:fileName inModule:module directory:directory)
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3453
            ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3454
                self warn:'Could not find/access the container for ',fileName,' in the repository.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3455
This could be due to:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3456
    - invalid/wrong CVS-Root setting
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3457
    - missing CVS access rights
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3458
        (no access / not logged in)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3459
    - changed CVSRoot after compilation
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3460
        (i.e. wrong CVS-path in classes version method)
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3461
'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3462
                ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3463
            ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3464
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3465
    ].
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3466
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3467
    lockChange := false.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3468
    revisionHolder := newestRev asValue.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3469
    revisionHolder onChangeEvaluate:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3470
        "/ cut off everything after revision
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3471
        |s first words tag|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3472
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3473
        s := revisionHolder value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3474
        words := s asCollectionOfWords.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3475
        words size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3476
            first := words first string.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3477
            first ~= s ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3478
                revisionHolder value:first
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3479
            ]
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3480
        ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3481
        lockChange ifFalse:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3482
            tagHolder value:''
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3483
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3484
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3485
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3486
    tagHolder := '' asValue.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3487
    tagHolder 
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3488
        onChangeEvaluate:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3489
            |tag rev|
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3490
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3491
            (tag := tagHolder value) notEmptyOrNil ifTrue:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3492
                rev := symbolicNames at:tag.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3493
                rev ~= revisionHolder value ifTrue:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3494
                    lockChange := true.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3495
                    revisionHolder value:rev.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3496
                    lockChange := false.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3497
                ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3498
            ]
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3499
        ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3500
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3501
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3502
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3503
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3504
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3505
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3506
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3507
    component := box addTextLabel:boxText withCRs adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3508
    component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3509
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3510
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3511
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3512
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3513
    component := box addTextLabel:(resources string:'Revision:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3514
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3515
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3516
    component := box addComboBoxOn:revisionHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3517
    component list:items.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3518
    component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3519
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3520
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3521
    component := box addTextLabel:(resources string:'or Tag:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  3522
    component width:0.4.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3523
    box yPosition:y.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3524
    component := box addComboListOn:tagHolder tabable:true.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3525
    component list:tagList.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3526
    component width:0.6; left:0.4.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3527
    tagList isNil ifTrue:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3528
        component disable
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3529
    ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3530
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3531
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3532
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3533
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3534
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  3535
    AbortAllOperationWantedQuery query ifTrue:[
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3536
        (box addAbortButtonLabelled:'Cancel all') action:[AbortAllSignal raise].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3537
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3538
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3539
    box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3540
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3541
    box accepted ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3542
        box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3543
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3544
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3545
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3546
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  3547
    ^ (tagHolder value notEmptyOrNil ifTrue:[tagHolder] ifFalse:[revisionHolder]) value withoutSpaces.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3548
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3549
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3550
     SourceCodeManagerUtilities
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3551
        askForRevisionToCompare:'enter revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3552
        title:'revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3553
        class:nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3554
        manager:SourceCodeManager 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3555
        module:'stx'
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  3556
        directory:'libbasic'
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3557
        fileName:'Array.st'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3558
    "
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  3559
2670
2aee2fd0314e refactoring
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  3560
    "Modified: / 21-12-2011 / 23:09:26 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3561
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3562
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  3563
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3564
    "check if a class contains message-sends to:
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3565
        #halt , #halt:
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3566
        #error
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3567
        #todo , #todo:
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3568
        (and maybe more in the future)
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3569
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3570
     Only checks in non-extension methods - as this is only called when checking "
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3571
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3572
    |badStuff whatIsBad msg answer labels values defaultAnswer dontShowAgain
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  3573
     methodsWithBadStuff|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3574
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3575
    badStuff := #(
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3576
        ( halt         'send of #halt (use for debugging only) - better use #error:''some message'' or #breakPoint:')
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3577
        ( halt:        'send of #halt: (use for debugging only) - better use #error: or #breakPoint:')
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3578
        ( error        'send of #error without descriptive message - better use #error:''some message''' )
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3579
        ( todo         'send of #todo - unfinished code present?' )
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3580
        ( todo:        'send of #todo:- unfinished code present?' )
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3581
    ).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3582
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3583
    methodsWithBadStuff := Set new.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3584
    whatIsBad := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3585
    aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3586
        |setOfLiterals setOfSentMessages|
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3587
2977
e5bfe652373f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
  3588
        mthd isExtension ifFalse:[
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3589
            setOfLiterals := mthd literals.  "/ try without parsing first.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3590
            (badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3591
                setOfSentMessages := mthd messagesSent.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3592
                badStuff do:[:eachEntry | 
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3593
                    (setOfSentMessages includes:eachEntry first) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3594
                        whatIsBad add:eachEntry second.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3595
                        methodsWithBadStuff add:mthd.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3596
                    ]
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3597
                ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  3598
            ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  3599
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3600
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3601
    whatIsBad isEmpty ifTrue:[^ true].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3602
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3603
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3604
        answer := YesToAllQuery query.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3605
        answer notNil ifTrue:[ ^ answer ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3606
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3607
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3608
    msg := resources string:'%1 contains the following (considered bad style) message sends:' with:aClass name.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3609
    msg := msg , '\\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3610
    whatIsBad do:[:each |
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3611
        msg := msg , '   ' , each , '\'
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3612
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3613
    msg := msg , '\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3614
    methodsWithBadStuff size == 1 ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3615
        msg := msg , (resources string:'In %1.' 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3616
                        with:methodsWithBadStuff anElement whoString allBold).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3617
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3618
        msg := msg , (resources string:'In %1 and %2 other methods.' 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3619
                        with:methodsWithBadStuff anElement whoString allBold 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3620
                        with:methodsWithBadStuff size-1).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3621
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3622
    msg := msg , '\\' , (resources string:'Do you really want to checkIn the %1 class ?' with:aClass name).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3623
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3624
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3625
        labels := #('Cancel All' 'Cancel' 'No to All' 'No' 'No, Browse' 'Yes to All' 'Yes') "#('Yes' 'Yes to All' 'No' 'No to All' 'Cancel')".
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3626
        values := #(#cancelAll nil #noToAll #noBrowse false #yesToAll true) "#(true #yesToAll false #noToAll nil)".
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3627
        defaultAnswer := #yesToAll.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3628
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3629
        labels := #('No' 'No, Browse' 'Yes').
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3630
        values := #(false #noBrowse true).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3631
        defaultAnswer := true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3632
    ].
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  3633
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  3634
"/        AbortAllOperationRequest isHandled ifTrue:[
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  3635
"/            labels := #('Cancel All') , labels.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  3636
"/            values := #(#cancelAll) , values.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  3637
"/        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  3638
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3639
    DialogBox aboutToOpenBoxNotificationSignal handle:[:ex |
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3640
        checkAgainHolder isValueModel ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3641
            dontShowAgain := checkAgainHolder value not asValue.
3384
e4252eb0a327 aboutToOpenBoxNotificationSignal semantic change (for Jan)
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
  3642
            ex box addCheckBoxAtBottom:(resources string:'Do not show this Dialog again (reenable in Launcher).')
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3643
                on:dontShowAgain.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  3644
        ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3645
    ] do:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3646
        answer := OptionBox 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3647
                      request:msg withCRs
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3648
                      label:(resources string:'Really CheckIn ?')
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3649
                      image:(InfoBox iconBitmap)
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  3650
                      buttonLabels:(Dialog classResources array:labels)
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3651
                      values:values
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3652
                      default:defaultAnswer
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3653
                      onCancel:nil.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3654
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3655
    answer isNil ifTrue:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  3656
        AbortOperationRequest raise.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3657
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3658
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3659
    dontShowAgain notNil ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3660
        checkAgainHolder value:dontShowAgain value not 
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  3661
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3662
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3663
    answer == #noBrowse ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3664
        UserPreferences browserClass browseMethods:methodsWithBadStuff title:'Methods with Bad Stuff'.
1995
f832f7ec6ccf Don't use possibly uninitialized class variable
Stefan Vogel <sv@exept.de>
parents: 1994
diff changeset
  3665
        self yesToAllNotification queryWith:false.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3666
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3667
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3668
    answer == #cancelAll ifTrue:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  3669
        AbortOperationRequest raise.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3670
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3671
    answer == #yesToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3672
        YesToAllNotification queryWith:true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3673
        ^ true
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3674
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3675
    answer == #noToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3676
        YesToAllNotification queryWith:false.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3677
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3678
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3679
    ^ answer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3680
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3681
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3682
     self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities)  
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3683
    "
2775
d1908ae4aed8 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2774
diff changeset
  3684
d1908ae4aed8 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2774
diff changeset
  3685
    "Modified: / 28-02-2012 / 10:41:38 / cg"
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3686
!
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3687
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3688
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  3689
    "ask for a log message for checking in a class (plus checkinQuick state info),
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  3690
     and other info (mark as stable, for example).
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  3691
     Return the info-object (actually: the dialog) or nil if aborted."
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3692
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3693
    ^ self
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3694
        getCheckinInfoFor:aClassNameOrPackageNameString 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3695
        initialAnswer:initialAnswerOrNil
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3696
        withQuickOption:false
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3697
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3698
    "
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3699
     SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3700
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3701
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  3702
    "Modified: / 06-07-2010 / 11:22:15 / cg"
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3703
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  3704
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3705
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  3706
    "ask for a log message for checking in a class (plus checkinQuick state info),
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  3707
     and other info (mark as stable, for example).
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3708
     Return the info-object (actually: the dialog) or nil if aborted."
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3709
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3710
    ^  self 
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3711
        getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3712
        withValidateConsistencyOption:false
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3713
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3714
    "
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3715
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3716
    "
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3717
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3718
    "Modified: / 12-03-2012 / 13:12:40 / cg"
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3719
!
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3720
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3721
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption withValidateConsistencyOption:withValidateConsistencyOption
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3722
    "ask for a log message for checking in a class (plus checkinQuick state info),
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3723
     and other info (mark as stable, for example).
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3724
     Return the info-object (actually: the dialog) or nil if aborted."
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3725
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3726
    |logMsg infoDialog|
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3727
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3728
    infoDialog := Tools::CheckinInfoDialog 
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3729
                    getCheckinInfoFor:aClassNameOrPackageNameString 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3730
                    initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage)
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3731
                    withQuickOption:withQuickOption
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3732
                    logHistory:(LastSourceLogMessages ? #())
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  3733
                    withValidateConsistencyOption:withValidateConsistencyOption.
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3734
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3735
    infoDialog notNil ifTrue:[
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3736
        logMsg := infoDialog logMessage.
2284
624993d61344 comment
Claus Gittinger <cg@exept.de>
parents: 2283
diff changeset
  3737
        logMsg notEmptyOrNil ifTrue:[
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3738
            LastSourceLogMessage := logMsg.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3739
            LastSourceLogMessages isNil ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3740
                LastSourceLogMessages := OrderedCollection new.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3741
            ].
2796
78401b160a28 changed: #getCheckinInfoFor:initialAnswer:withQuickOption:
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  3742
            LastSourceLogMessages remove:logMsg ifAbsent:[].
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3743
            LastSourceLogMessages addFirst:logMsg.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3744
            LastSourceLogMessages size > 10 ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3745
                LastSourceLogMessages removeLast
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3746
            ].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3747
        ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3748
    ].
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  3749
    ^ infoDialog
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3750
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3751
    "
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  3752
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  3753
    "
1501
6bb154127b0f CheckInDialog class moved
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
  3754
2796
78401b160a28 changed: #getCheckinInfoFor:initialAnswer:withQuickOption:
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  3755
    "Modified: / 12-03-2012 / 13:12:40 / cg"
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3756
!
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3757
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3758
goodInitialLogMessageForCheckinClassOfClass:aClass
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3759
    "figure out, if there were any non-comment changes. 
2971
7fefd3a142a4 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  3760
     Provide a reasonable initial log message (I am tired of typing in 'comment only').
7fefd3a142a4 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  3761
     This is a q&d hack - not complete and not correct (for example, it will generate a method change
7fefd3a142a4 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  3762
     info line, even if the selector was removed afterwards).
7fefd3a142a4 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  3763
     So check the outcome."
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3764
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3765
    |selectorsInChangeSet newSelectors modifiedSelectors
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3766
     classChanges changesForThisClass definitionChangesForThisClass methodChangesForThisClass 
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3767
     allMethodChangesForThisClass modifiedMethodsForThisClass newMethodsForThisClass removedMethodsForThisClass
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3768
     initialLogStream printSelectors selectorsWithCommentOrFormattingChangeOnly
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3769
     selectorsWithVariableChangeOnly newSelectorsRemoved
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3770
     removedSelectors categoryChanges categoryChangeSelectors additionalInfoPerChangedSelector|
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3771
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3772
    "/ a helper function
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3773
    printSelectors := 
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3774
        [:what :selectors :more |
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3775
            |sel moreInfo|
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3776
3334
c3473a753372 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3332
diff changeset
  3777
            selectors remove:nil ifAbsent:[].
2922
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3778
            initialLogStream nextPutAll:(what,':').
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3779
            selectors size < 5 ifTrue:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3780
                selectors size == 1 ifTrue:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3781
                    sel := selectors first.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3782
                    initialLogStream nextPutAll: ' #'; nextPutAll:sel.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3783
                    more ifTrue:[
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3784
                        (moreInfo := additionalInfoPerChangedSelector at:sel ifAbsent:nil) notNil ifTrue:[
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3785
                            initialLogStream space; nextPutAll:moreInfo.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3786
                        ]
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3787
                    ].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3788
                    initialLogStream cr.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3789
                ] ifFalse:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3790
                    initialLogStream cr.
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3791
                    selectors asSortedCollection do:[:sel | 
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3792
                        initialLogStream tab; nextPutAll:'#'; nextPutAll:sel. 
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3793
                        more ifTrue:[
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3794
                            (moreInfo := additionalInfoPerChangedSelector at:sel ifAbsent:nil) notNil ifTrue:[
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3795
                                initialLogStream space; nextPutAll:moreInfo.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3796
                            ].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3797
                        ].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3798
                        initialLogStream cr
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3799
                    ].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3800
                ].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3801
            ] ifFalse:[
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3802
                initialLogStream 
3343
01a016e0df7a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3334
diff changeset
  3803
                    print: (selectors size); nextPutAll: ' methods'; cr.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3804
            ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3805
        ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3806
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3807
    classChanges := ChangeSet current select:[:aChange | aChange isClassChange].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3808
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3809
    changesForThisClass := classChanges 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3810
                                select:[:aChange | aChange className = aClass theNonMetaclass name
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3811
                                                   or:[aChange className = aClass theMetaclass name] ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3812
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3813
    additionalInfoPerChangedSelector := Dictionary new.
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  3814
    definitionChangesForThisClass := changesForThisClass reject:[:aChange | aChange isMethodChange].
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3815
    categoryChanges := changesForThisClass select:[:aChange | aChange isMethodCategoryChange]. 
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3816
    categoryChangeSelectors := categoryChanges collect:[:aChange | aChange changeSelector] as:Set.
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3817
    allMethodChangesForThisClass := changesForThisClass select:[:aChange | aChange isMethodCodeChange].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3818
    selectorsInChangeSet := allMethodChangesForThisClass collect:[:aChange | aChange changeSelector] as:Set.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3819
    methodChangesForThisClass := selectorsInChangeSet collect:[:eachSelector |
2161
c1d39e2f7115 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
  3820
                                        allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector]] as:OrderedCollection.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3821
                                            
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3822
    modifiedMethodsForThisClass := methodChangesForThisClass 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3823
                                select:[:aChange | aChange previousVersion notNil].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3824
    modifiedSelectors := modifiedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3825
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3826
    newMethodsForThisClass := allMethodChangesForThisClass 
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3827
                                select:[:aChange | aChange previousVersion isNil].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3828
    newSelectors := newMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3829
    
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3830
    removedMethodsForThisClass := changesForThisClass 
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3831
                                select:[:aChange | aChange isMethodRemoveChange and:[ aChange changeMethod isNil ]].
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3832
    removedSelectors := removedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3833
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3834
    initialLogStream := '' writeStream.
2971
7fefd3a142a4 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  3835
7fefd3a142a4 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  3836
    initialLogStream printCR:'class: ',aClass name.
7fefd3a142a4 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  3837
2313
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3838
    "/ definition?
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3839
    "/ suppress definition-message if initial checkin
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3840
    (aClass package isNil or:[aClass revision isNil]) ifFalse:[ 
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3841
        definitionChangesForThisClass notEmpty ifTrue:[
2974
df015da58d8a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
  3842
            "/ self halt.
2922
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3843
            initialLogStream printCR:'class definition'.
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3844
        ].
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3845
    ].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3846
2313
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3847
    "/ added selectors?
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3848
    newSelectorsRemoved := newSelectors select:[:sel | removedSelectors includes:sel].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3849
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3850
    newSelectors removeAllFoundIn:removedSelectors.
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3851
    newSelectors notEmpty ifTrue:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3852
        printSelectors value:'added' value:newSelectors value:false.
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3853
    ].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3854
    modifiedSelectors removeAllFoundIn:newSelectors.
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3855
    categoryChangeSelectors removeAllFoundIn:newSelectors.
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3856
2313
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3857
    "/ removed selectors?
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3858
    removedSelectors removeAllFoundIn:newSelectorsRemoved.
2313
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3859
    removedSelectors notEmpty ifTrue:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3860
        printSelectors value:'removed' value:removedSelectors value:false.
2313
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3861
    ].
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3862
    modifiedSelectors removeAllFoundIn:removedSelectors.
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3863
    categoryChangeSelectors removeAllFoundIn:removedSelectors.
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3864
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3865
    "/ modifications?
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3866
    modifiedSelectors notEmpty ifTrue:[
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3867
        selectorsWithCommentOrFormattingChangeOnly := Set new.
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3868
        selectorsWithVariableChangeOnly := Set new.
2313
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3869
2922
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3870
        "/ check for format/comment change
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3871
        RBParser notNil ifTrue:[
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3872
            modifiedSelectors do:[:eachSelector |
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3873
                |oldest newest oldMethod newMethod oldTree newTree 
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3874
                 variableMapping selectorMapping unchangedVariables unchangedSelectors|
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3875
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3876
                (newSelectors includes:eachSelector) ifFalse:[
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3877
                    oldest := allMethodChangesForThisClass detect:[:change | change changeSelector = eachSelector].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3878
                    newest := allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3879
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3880
                    oldest := oldest previousVersion notNil ifTrue:[oldest previousVersion] ifFalse:[oldest].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3881
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3882
                    oldTree := RBParser parseMethod:oldest source onError:[:aString :pos | nil].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3883
                    newTree := RBParser parseMethod:newest source onError:[:aString :pos | nil].
2922
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3884
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3885
                    (oldTree notNil and:[newTree notNil]) ifTrue:[
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3886
                        variableMapping := Dictionary new.
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3887
                        (oldTree equalTo:newTree withMapping: variableMapping) ifTrue:[
2922
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3888
                            unchangedVariables := variableMapping keys select:[:k | (variableMapping at:k) = k].
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3889
                            variableMapping removeAllKeys:unchangedVariables.
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3890
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3891
                            (variableMapping at:'self' ifAbsent:'self') = 'self' ifTrue:[
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3892
                                ((variableMapping associations count:[:assoc | assoc key ~= assoc value]) == 0) ifTrue:[
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3893
                                    selectorsWithCommentOrFormattingChangeOnly add:eachSelector.
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3894
                                ] ifFalse:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3895
                                    "/ check, if a global has changed (aka sends to another global)
2922
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3896
                                    ((variableMapping keys contains:[:var | var first isUppercase])
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3897
                                    or:[ (variableMapping values contains:[:var | var first isUppercase]) ]) ifFalse:[
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3898
                                        selectorsWithVariableChangeOnly add:eachSelector.
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3899
                                    ].
2142
d09c9d1b8c46 changed: #goodInitialLogMessageForCheckinClassOfClass:
sr
parents: 2137
diff changeset
  3900
                                ].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3901
                            ].
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3902
                        ] ifFalse:[
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3903
                            selectorMapping := Dictionary new.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3904
                            (oldTree equalTo:newTree withSelectorMapping: selectorMapping) ifTrue:[
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3905
                                unchangedSelectors := selectorMapping keys select:[:k | (selectorMapping at:k) = k].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3906
                                selectorMapping removeAllKeys:unchangedSelectors.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3907
                                (selectorMapping notEmpty and:[selectorMapping size <= 2]) ifTrue:[
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3908
                                    additionalInfoPerChangedSelector at:eachSelector put:(
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3909
                                        String streamContents:[:s |
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3910
                                            |first|
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3911
                        
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3912
                                            s nextPutAll:'('.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3913
                                            first := true.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3914
                                            selectorMapping keysAndValuesDo:[:selOld :selNew | 
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3915
                                                first ifFalse:[s nextPutAll:', '].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3916
                                                s print:('send #',selNew,' instead of #',selOld).
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3917
                                                first := false.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3918
                                            ].
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3919
                                            s nextPutAll:')'.
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3920
                                        ]).
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3921
                                ]
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3922
                            ]
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3923
                        ].
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3924
                    ].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3925
                ]
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3926
            ].
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3927
        ].
2313
3dbafc3a51a4 changed:
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  3928
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3929
        modifiedSelectors removeAllFoundIn:selectorsWithCommentOrFormattingChangeOnly.
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3930
        modifiedSelectors removeAllFoundIn:selectorsWithVariableChangeOnly.
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3931
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3932
        (selectorsWithCommentOrFormattingChangeOnly notEmpty) ifTrue:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3933
            printSelectors value:'comment/format in' value:selectorsWithCommentOrFormattingChangeOnly value:false.
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3934
        ].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3935
        (selectorsWithVariableChangeOnly notEmpty) ifTrue:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3936
            printSelectors value:'variable renamed in' value:selectorsWithVariableChangeOnly value:false.
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3937
        ].
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3938
        (modifiedSelectors notEmpty) ifTrue:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3939
            printSelectors value:'changed' value:modifiedSelectors value:true.
2194
c45cd185ee80 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  3940
        ].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3941
    ].
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3942
    categoryChanges notEmpty ifTrue:[
3327
a3200580a76f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3325
diff changeset
  3943
        printSelectors value:'category of' value:categoryChangeSelectors value:false.
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3944
    ].
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  3945
    ^ initialLogStream contents
2312
21fb10cf6914 changed:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  3946
2922
19cfd7d9b629 changed: #goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2903
diff changeset
  3947
    "Modified: / 26-09-2012 / 18:31:38 / cg"
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3948
!
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3949
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3950
revisionForSymbolicName:tag class:cls fileName:classFileName directory:packageDir module:moduleDir manager:aSourceCodeManager
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3951
    "given a tag, return the corresponding revision"
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3952
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3953
    |partialLog symbolicNames|
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3954
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3955
    partialLog := aSourceCodeManager
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3956
        revisionLogOf:cls
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3957
        numberOfRevisions:20
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3958
        fileName:classFileName
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3959
        directory:packageDir 
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3960
        module:moduleDir.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3961
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3962
    partialLog notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3963
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3964
        symbolicNames notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3965
            ^ symbolicNames at:tag ifAbsent:nil
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3966
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3967
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  3968
    ^ nil
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3969
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3970
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  3971
!SourceCodeManagerUtilities methodsFor:'utilities-encoding'!
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3972
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3973
guessEncodingOfFile:aFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3974
    "look for a string
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3975
        encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3976
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3977
        encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3978
     within the given buffer 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3979
     (which is usually the first few bytes of a textFile).
2719
a25a07c06d84 refactored
Claus Gittinger <cg@exept.de>
parents: 2693
diff changeset
  3980
     If that's not found, use heuristics (in CharacterArray) to guess."
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3981
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3982
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  3983
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3984
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  3985
    ^ CharacterEncoder guessEncodingOfFile:aFilename
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3986
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3987
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3988
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3989
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3990
    "
2719
a25a07c06d84 refactored
Claus Gittinger <cg@exept.de>
parents: 2693
diff changeset
  3991
a25a07c06d84 refactored
Claus Gittinger <cg@exept.de>
parents: 2693
diff changeset
  3992
    "Modified (comment): / 14-01-2012 / 20:54:35 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3993
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3994
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3995
guessEncodingOfStream:aStream
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3996
    "look for a string of the form
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3997
            encoding #name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3998
     or:
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  3999
            encoding: name
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4000
     in the first few bytes of aStream."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4001
1433
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  4002
    <resource: #obsolete>
c3696ad0922b mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents: 1429
diff changeset
  4003
1414
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  4004
    self obsoleteMethodWarning:'ask CharacterEncoder'.
f67d4b166606 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
  4005
    ^ CharacterEncoder guessEncodingOfStream:aStream
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4006
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4007
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4008
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4009
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  4010
version
3594
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  4011
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.305 2014-07-16 12:35:45 cg Exp $'
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  4012
!
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  4013
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  4014
version_CVS
3594
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  4015
    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.305 2014-07-16 12:35:45 cg Exp $'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4016
! !
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  4017