SourceCodeManagerUtilities.st
author Stefan Vogel <sv@exept.de>
Fri, 31 Mar 2017 15:57:47 +0200
changeset 4232 f02d9d68eabc
parent 4230 51459e224b36
child 4241 6aa29eece1bb
permissions -rw-r--r--
#FEATURE by stefan class: CVSSourceCodeManager class changed: #checkinClass:fileName:directory:module:source:logMessage:force: #checkinClass:fileName:directory:module:source:logMessage:force:asBranch: prepare for branch support (unfinished yet)
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
3812
173678af0074 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3692
diff changeset
    14
"{ NameSpace: Smalltalk }"
173678af0074 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3692
diff changeset
    15
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
Object subclass:#SourceCodeManagerUtilities
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    17
	instanceVariableNames:'manager resources confirmNewFiles'
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    18
	classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery
4174
3b55c406664f #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4160
diff changeset
    19
		YesToAllNotification LastSourceLogMessages DefaultUtilities
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
    20
		LastTag LastComparedTag'
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    21
	poolDictionaries:''
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    22
	category:'System-SourceCodeManagement'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    27
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    28
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    29
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    30
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    31
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    32
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    33
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    35
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    36
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    37
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    38
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    39
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    40
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    41
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
documentation
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    utility code which is useful at more than one place
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    (extracted from the browser)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [author:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        Claus Gittinger (cg@exept)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    [see also:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    [instance variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    [class variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    58
!SourceCodeManagerUtilities class methodsFor:'instance creation'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    59
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    60
forManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    61
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    62
    ^self new setManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    63
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    64
    "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
    65
!
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    66
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    67
new
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    68
    "return an initialized instance"
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    69
2969
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    70
    self == SourceCodeManagerUtilities ifTrue:[ 
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    71
        self abstractClassInstantiationError
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    72
    ].
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    73
    ^ self basicNew initialize.
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    74
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    75
    "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
    76
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    77
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    78
!SourceCodeManagerUtilities class methodsFor:'Signal constants'!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    79
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    80
yesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    81
    YesToAllNotification isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    82
        YesToAllNotification := QuerySignal new.
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
    ^ YesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    85
!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    86
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    87
yesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    88
    YesToAllQuery isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    89
        YesToAllQuery := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    90
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    91
    ^ YesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    92
! !
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    93
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    94
!SourceCodeManagerUtilities class methodsFor:'accessing'!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    95
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
3635
765b567f596a oops - a global variable named "Default" was introduced
Claus Gittinger <cg@exept.de>
parents: 3633
diff changeset
    98
    DefaultUtilities isNil ifTrue:[DefaultUtilities := SourceCodeManagerUtilitiesForContainerBasedManagers new].
3642
28683778b9c3 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3635
diff changeset
    99
    ^ DefaultUtilities
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
    "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
   102
    "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
   103
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   104
1084
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
    "return the value of the static variable 'LastModule' (automatically generated)"
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
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   109
!
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
    "set the value of the static variable 'LastModule' (automatically generated)"
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
    LastModule := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   115
!
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
    "return the value of the static variable 'LastPackage' (automatically generated)"
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
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   121
!
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
    "set the value of the static variable 'LastPackage' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   125
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   126
    LastPackage := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   127
! !
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   128
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   129
!SourceCodeManagerUtilities class methodsFor:'error handling'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   130
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   131
doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   132
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   133
    (self default respondsTo: aMessage selector) ifTrue:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   134
        "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
   135
        self breakPoint: #jv.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   136
        self breakPoint: #cg.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   137
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   138
        ^aMessage sendTo: self default
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   139
    ] ifFalse:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   140
        ^super doesNotUnderstand: aMessage
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   143
    "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
   144
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   145
2569
vrany
parents: 2556
diff changeset
   146
!SourceCodeManagerUtilities class methodsFor:'private-migration'!
vrany
parents: 2556
diff changeset
   147
vrany
parents: 2556
diff changeset
   148
compileForwarders
vrany
parents: 2556
diff changeset
   149
vrany
parents: 2556
diff changeset
   150
    "Utility method"
vrany
parents: 2556
diff changeset
   151
vrany
parents: 2556
diff changeset
   152
    "
vrany
parents: 2556
diff changeset
   153
        SourceCodeManagerUtilities compileForwarders.
vrany
parents: 2556
diff changeset
   154
    "
vrany
parents: 2556
diff changeset
   155
vrany
parents: 2556
diff changeset
   156
    self methodsDo:[:m|
vrany
parents: 2556
diff changeset
   157
        | sel |
vrany
parents: 2556
diff changeset
   158
        sel := m selector.
vrany
parents: 2556
diff changeset
   159
        ((self class includesSelector: sel) and: [(self class >> sel) source = m source]) ifTrue:[
vrany
parents: 2556
diff changeset
   160
            | source header |
vrany
parents: 2556
diff changeset
   161
vrany
parents: 2556
diff changeset
   162
            header := m source asStringCollection first.
vrany
parents: 2556
diff changeset
   163
            source := '%1
vrany
parents: 2556
diff changeset
   164
vrany
parents: 2556
diff changeset
   165
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   166
vrany
parents: 2556
diff changeset
   167
    self obsoleteMethodWarning: ''Please use instance protocol (SourceCodeManagerUtilities default doSomething)''.
vrany
parents: 2556
diff changeset
   168
vrany
parents: 2556
diff changeset
   169
    ^self default %1' bindWith: header with: header.
vrany
parents: 2556
diff changeset
   170
vrany
parents: 2556
diff changeset
   171
            self halt: 'Inspect source'.
vrany
parents: 2556
diff changeset
   172
            self class compile: source classified: m category.    
vrany
parents: 2556
diff changeset
   173
        ].
vrany
parents: 2556
diff changeset
   174
            
vrany
parents: 2556
diff changeset
   175
    ]
vrany
parents: 2556
diff changeset
   176
vrany
parents: 2556
diff changeset
   177
    "Created: / 11-10-2011 / 10:55:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2556
diff changeset
   178
! !
vrany
parents: 2556
diff changeset
   179
1806
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   180
!SourceCodeManagerUtilities class methodsFor:'resources'!
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
resourcePackage
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   183
    ^ #'stx:libtool'
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   184
! !
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   185
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
!SourceCodeManagerUtilities class methodsFor:'utilities'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   188
classIsNotYetInRepository:aClass withManager:mgr
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   189
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   190
    <resource: #obsolete>
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   191
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   192
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   193
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   194
    ^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
   195
!
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   196
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   197
nameOfExtensionsContainer
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   198
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   199
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   200
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   201
    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
   202
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   203
    ^self default nameOfExtensionsContainer
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   206
setPackageOfAllMethodsIn:aClass to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   207
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   208
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   209
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   210
    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
   211
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   212
    ^self default setPackageOfAllMethodsIn:aClass to:aPackage
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
    "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
   215
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   216
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   217
setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   218
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   219
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   220
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   221
    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
   222
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   223
    ^self default setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
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
    "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
   226
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   227
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   228
sourceCodeManagerFor:aClass
3370
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   229
    |mgr assumption|
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   230
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   231
    mgr := aClass theNonMetaclass sourceCodeManager.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   232
    mgr isNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   233
        SourceCodeManager isNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   234
            "/ 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
   235
            ^ nil.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   236
        ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   237
        assumption := AbstractSourceCodeManager defaultManager ? CVSSourceCodeManager.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   238
        assumption notNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   239
            (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
   240
                ^ nil
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 := assumption.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   243
        ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   244
    ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   245
    ^ mgr
2556
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   248
sourceCodeOfClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   249
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   250
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   251
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   252
    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
   253
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   254
    ^self default sourceCodeOfClass:aClass
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   257
versionString:a isLessThan:b
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   258
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   259
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   260
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   261
    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
   262
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   263
    ^self default versionString:a isLessThan:b
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   264
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   265
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   266
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   267
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   268
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   269
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   270
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   271
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   272
    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
   273
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   274
    ^self default changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   275
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   276
    "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
   277
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   278
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   279
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
   280
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   281
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   282
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   283
    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
   284
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   285
    ^self default 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   286
        changeSetForExtensionMethodsForPackage:packageToCheckOut 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   287
        revision:revisionOrNil 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   288
        orAskForRevision:askForRevision 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   289
        usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   290
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   291
    "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
   292
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   293
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   294
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
   295
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   296
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   297
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   298
    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
   299
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   300
    ^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
   301
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   302
    "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
   303
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   304
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   305
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
   306
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   307
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   308
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   309
    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
   310
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   311
    ^self default checkForExistingModule:module directory:directory usingManager:mgr allowCreate:allowCreate
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   312
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   313
    "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
   314
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   315
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   316
checkForExistingModule:module usingManager:mgr allowCreate:allowCreate
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   317
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   318
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   319
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   320
    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
   321
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   322
    ^self default checkForExistingModule:module usingManager:mgr allowCreate:allowCreate
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   323
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   324
    "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
   325
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   326
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   327
checkinClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   328
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   329
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   330
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   331
    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
   332
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   333
    ^self default checkinClass:aClass
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   336
checkinClass:aClass withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   337
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   338
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   339
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   340
    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
   341
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   342
    ^self default checkinClass:aClass withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   343
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   344
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   345
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass
2569
vrany
parents: 2556
diff changeset
   346
vrany
parents: 2556
diff changeset
   347
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   348
vrany
parents: 2556
diff changeset
   349
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   350
vrany
parents: 2556
diff changeset
   351
    ^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
   352
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   353
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   354
checkinClasses:aCollectionOfClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   355
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   356
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   357
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   358
    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
   359
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   360
    ^self default checkinClasses:aCollectionOfClass
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   363
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   364
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   365
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   366
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   367
    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
   368
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   369
    ^self default checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   370
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   371
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   372
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses
2569
vrany
parents: 2556
diff changeset
   373
vrany
parents: 2556
diff changeset
   374
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   375
vrany
parents: 2556
diff changeset
   376
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   377
vrany
parents: 2556
diff changeset
   378
    ^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
   379
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   380
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   381
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   382
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   383
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   384
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   385
    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
   386
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   387
    ^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
   388
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   389
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   390
checkoutClass:aClass askForMerge:askForMerge
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   391
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   392
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   393
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   394
    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
   395
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   396
    ^self default checkoutClass:aClass 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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   399
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   400
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   401
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   402
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   403
    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
   404
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   405
    ^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
   406
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   407
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   408
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
   409
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   410
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   411
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   412
    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
   413
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   414
    ^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
   415
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   416
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   417
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
   418
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   419
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   420
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   421
    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
   422
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   423
    ^self default checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   424
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   425
    "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
   426
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   427
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   428
compareClassWithRepository:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   429
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   430
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   431
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   432
    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
   433
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   434
    ^self default compareClassWithRepository:aClass
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   437
compareClassWithRepository:aClass askForRevision:askForRevision
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   438
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   439
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   440
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   441
    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
   442
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   443
    ^self default compareClassWithRepository:aClass askForRevision:askForRevision
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   446
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   447
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   448
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   449
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   450
    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
   451
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   452
    ^self compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   453
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   454
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   455
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   456
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   457
    <resource: #obsolete>
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   458
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   459
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   460
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   461
    ^self default compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   462
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   463
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   464
compareProjectWithRepository:aProject
2569
vrany
parents: 2556
diff changeset
   465
vrany
parents: 2556
diff changeset
   466
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   467
vrany
parents: 2556
diff changeset
   468
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   469
vrany
parents: 2556
diff changeset
   470
    ^self default compareProjectWithRepository:aProject
2556
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   473
createSourceContainerForClass:aClass
2569
vrany
parents: 2556
diff changeset
   474
vrany
parents: 2556
diff changeset
   475
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   476
vrany
parents: 2556
diff changeset
   477
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   478
vrany
parents: 2556
diff changeset
   479
    ^self default createSourceContainerForClass:aClass
2556
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   482
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
   483
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   484
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   485
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   486
    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
   487
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   488
    ^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
   489
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   490
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   491
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   492
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   493
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   494
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   495
    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
   496
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   497
    ^self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   498
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   499
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   500
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   501
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   502
    <resource: #obsolete>
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   503
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   504
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   505
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   506
    ^self default 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   507
        diffSetOfProject:aProject 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   508
        againstRepositoryVersionFrom:aDateOrNilForNewest 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   509
        extensionsOnly:extensionsOnly
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   510
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   511
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   512
ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   513
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   514
    <resource: #obsolete>
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
    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
   517
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   518
    ^self default ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   519
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   520
    "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
   521
!
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
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil forClass:aClass valuesInto:aBlock
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
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   526
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   527
    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
   528
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   529
    ^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
   530
!
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
removeSourceContainerForClass:aClass
2569
vrany
parents: 2556
diff changeset
   533
vrany
parents: 2556
diff changeset
   534
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   535
vrany
parents: 2556
diff changeset
   536
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   537
vrany
parents: 2556
diff changeset
   538
    ^self default removeSourceContainerForClass:aClass
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   539
!
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
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
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
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   544
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   545
    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
   546
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   547
    ^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
   548
!
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
repositoryLogOf:aClass onto:aStream
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
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   553
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   554
    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
   555
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   556
    ^self default repositoryLogOf:aClass onto:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   557
!
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
repositoryLogOf:aClass short:shortOrNot onto:aStream
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
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   562
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   563
    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
   564
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   565
    ^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
   566
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   567
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   568
tagClass:aClass as:tag
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   569
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   570
    <resource: #obsolete>
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
    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
   573
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   574
    ^self default tagClass:aClass as:tag
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   575
!
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
tagClasses:aCollectionOfClasses as:tag
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
    <resource: #obsolete>
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 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
   582
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   583
    ^self default tagClasses:aCollectionOfClasses as:tag
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   584
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   585
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   586
tagPath:aPath as:tag usingManager:aManager
2556
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
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   592
    ^self default tagPath:aPath as:tag usingManager:aManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   593
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   594
    "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
   595
! !
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
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-helpers'!
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
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
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
    <resource: #obsolete>
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
    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
   604
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   605
    ^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
   606
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   607
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   608
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-user interaction'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   609
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   610
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
   611
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   612
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   613
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   614
    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
   615
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   616
    ^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
   617
!
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
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
   620
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   621
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   622
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   623
    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
   624
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   625
    ^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
   626
!
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
askForExistingRevision:boxText title:title class:aClass
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   629
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   630
    <resource: #obsolete>
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   631
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   632
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   633
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   634
    ^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
   635
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   636
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   637
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
   638
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   639
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   640
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   641
    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
   642
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   643
    ^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
   644
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   645
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   646
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
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
    <resource: #obsolete>
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
    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
   651
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   652
    ^self default checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   655
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   656
    ^self default 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   657
        getCheckinInfoFor:aClassNameOrPackageNameString     
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   658
        initialAnswer:initialAnswerOrNil
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   659
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   660
    "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
   661
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   662
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   663
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   664
    ^self default 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   665
        getCheckinInfoFor:aClassNameOrPackageNameString 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   666
        initialAnswer:initialAnswerOrNil 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   667
        withQuickOption:withQuickOption
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   668
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   669
    "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
   670
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   671
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   672
goodInitialLogMessageForCheckinClassOfClass:aClass
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   673
    "figure out, if there were any non-comment changes. 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   674
     Provide a reasonable initial log message (I am tired of typing in 'comment only').
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   675
     This is a q&d hack - not complete and not correct (for example, it will generate a method change
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   676
     info line, even if the selector was removed afterwards).
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   677
     So check the outcome."
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   678
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   679
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   680
    "/ a helper function
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   681
    |printSelectors initialLogStream additionalInfoPerChangedSelector changesForThisCheckin changesPerClass|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   682
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   683
    printSelectors := 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   684
        [:what :selectors :more |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   685
            |sel moreInfo|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   686
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   687
            selectors remove:nil ifAbsent:[].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   688
            initialLogStream nextPutAll:(what,':').
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   689
            selectors size < 15 ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   690
                selectors size == 1 ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   691
                    sel := selectors first.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   692
                    initialLogStream nextPutAll: ' #'; nextPutAll:sel.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   693
                    more ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   694
                        (moreInfo := additionalInfoPerChangedSelector at:sel ifAbsent:nil) notNil ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   695
                            initialLogStream space; nextPutAll:moreInfo.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   696
                        ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   697
                    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   698
                    initialLogStream cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   699
                ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   700
                    initialLogStream cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   701
                    selectors asSortedCollection do:[:sel | 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   702
                        initialLogStream tab; nextPutAll:'#'; nextPutAll:sel. 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   703
                        more ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   704
                            (moreInfo := additionalInfoPerChangedSelector at:sel ifAbsent:nil) notNil ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   705
                                initialLogStream space; nextPutAll:moreInfo.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   706
                            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   707
                        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   708
                        initialLogStream cr
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   709
                    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   710
                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   711
            ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   712
                initialLogStream 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   713
                    print: (selectors size); nextPutAll: ' methods'; cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   714
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   715
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   716
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   717
    changesForThisCheckin := ChangeSet current 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   718
                                select:[:aChange | 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   719
                                    |changeClass|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   720
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   721
                                    aChange isClassChange and:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   722
                                        changeClass := aChange changeClass theNonMetaclass.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   723
                                        changeClass == aClass or:[changeClass topOwningClass == aClass]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   724
                                    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   725
                                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   726
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   727
    changesForThisCheckin sort:[:a :b| a className < b className].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   728
    changesPerClass := changesForThisCheckin asCollectionOfSubCollectionsSeparatedByAnyChange:[:prev :curr| prev className ~= curr className].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   729
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   730
    initialLogStream := '' writeStream.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   731
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   732
    changesPerClass do:[:changesForThisClass|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   733
        |selectorsInChangeSet newSelectors modifiedSelectors definitionChangesForThisClass methodChangesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   734
         allMethodChangesForThisClass modifiedMethodsForThisClass newMethodsForThisClass removedMethodsForThisClass
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   735
         selectorsWithCommentOrFormattingChangeOnly
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   736
         selectorsWithVariableChangeOnly newSelectorsRemoved
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   737
         removedSelectors categoryChanges categoryChangeSelectors|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   738
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   739
        additionalInfoPerChangedSelector := Dictionary new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   740
        definitionChangesForThisClass := changesForThisClass reject:[:aChange | aChange isMethodChange].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   741
        categoryChanges := changesForThisClass select:[:aChange | aChange isMethodCategoryChange]. 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   742
        categoryChangeSelectors := categoryChanges collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   743
        allMethodChangesForThisClass := changesForThisClass select:[:aChange | aChange isMethodCodeChange].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   744
        selectorsInChangeSet := allMethodChangesForThisClass collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   745
        methodChangesForThisClass := selectorsInChangeSet collect:[:eachSelector |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   746
                                            allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector]] as:OrderedCollection.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   747
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   748
        modifiedMethodsForThisClass := methodChangesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   749
                                    select:[:aChange | aChange previousVersion notNil].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   750
        modifiedSelectors := modifiedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   751
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   752
        newMethodsForThisClass := allMethodChangesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   753
                                    select:[:aChange | aChange previousVersion isNil].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   754
        newSelectors := newMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   755
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   756
        removedMethodsForThisClass := changesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   757
                                    select:[:aChange | aChange isMethodRemoveChange and:[ aChange changeMethod isNil ]].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   758
        removedSelectors := removedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   759
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   760
        "/ get rid of category changes for new and removed methods
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   761
        categoryChanges := categoryChanges reject:[:chg |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   762
                                |methodWithChangedCat|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   763
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   764
                                (methodWithChangedCat := chg changeMethod) isNil
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   765
                                or:[ newMethodsForThisClass contains:[:newChg | newChg changeMethod = methodWithChangedCat]]].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   766
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   767
        initialLogStream nextPutLine:'class: ', changesForThisClass first className.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   768
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   769
        "/ definition?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   770
        "/ suppress definition-message if initial checkin
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   771
        (aClass package isNil or:[aClass revision isNil]) ifFalse:[ 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   772
            definitionChangesForThisClass notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   773
                "/ self halt.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   774
                initialLogStream nextPutLine:'class definition'.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   775
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   776
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   777
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   778
        "/ added selectors?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   779
        newSelectorsRemoved := newSelectors select:[:sel | removedSelectors includes:sel].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   780
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   781
        newSelectors removeAllFoundIn:removedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   782
        newSelectors notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   783
            printSelectors value:'added' value:newSelectors value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   784
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   785
        modifiedSelectors removeAllFoundIn:newSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   786
        categoryChangeSelectors removeAllFoundIn:newSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   787
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   788
        "/ removed selectors?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   789
        removedSelectors removeAllFoundIn:newSelectorsRemoved.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   790
        removedSelectors notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   791
            printSelectors value:'removed' value:removedSelectors value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   792
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   793
        modifiedSelectors removeAllFoundIn:removedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   794
        categoryChangeSelectors removeAllFoundIn:removedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   795
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   796
        "/ modifications?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   797
        modifiedSelectors notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   798
            selectorsWithCommentOrFormattingChangeOnly := Set new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   799
            selectorsWithVariableChangeOnly := Set new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   800
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   801
            "/ check for format/comment change
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   802
            RBParser notNil ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   803
                modifiedSelectors do:[:eachSelector |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   804
                    |oldest newest oldMethod newMethod oldTree newTree 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   805
                     variableMapping selectorMapping unchangedVariables unchangedSelectors|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   806
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   807
                    (newSelectors includes:eachSelector) ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   808
                        oldest := allMethodChangesForThisClass detect:[:change | change changeSelector = eachSelector].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   809
                        newest := allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   810
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   811
                        oldest := oldest previousVersion notNil ifTrue:[oldest previousVersion] ifFalse:[oldest].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   812
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   813
                        oldTree := RBParser parseMethod:oldest source onError:[:aString :pos | nil].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   814
                        newTree := RBParser parseMethod:newest source onError:[:aString :pos | nil].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   815
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   816
                        (oldTree notNil and:[newTree notNil]) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   817
                            variableMapping := Dictionary new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   818
                            (oldTree "semanticallyEqualTo:" equalTo:newTree withMapping: variableMapping) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   819
                                unchangedVariables := variableMapping keys select:[:k | (variableMapping at:k) = k].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   820
                                variableMapping removeAllKeys:unchangedVariables.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   821
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   822
                                (variableMapping at:'self' ifAbsent:'self') = 'self' ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   823
                                    ((variableMapping associations count:[:assoc | assoc key ~= assoc value]) == 0) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   824
                                        selectorsWithCommentOrFormattingChangeOnly add:eachSelector.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   825
                                    ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   826
                                        "/ check, if a global has changed (aka sends to another global)
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   827
                                        ((variableMapping keys contains:[:var | var first isUppercase])
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   828
                                        or:[ (variableMapping values contains:[:var | var first isUppercase]) ]) ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   829
                                            selectorsWithVariableChangeOnly add:eachSelector.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   830
                                        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   831
                                    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   832
                                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   833
                            ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   834
                                selectorMapping := Dictionary new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   835
                                (oldTree equalTo:newTree withSelectorMapping: selectorMapping) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   836
                                    unchangedSelectors := selectorMapping keys select:[:k | (selectorMapping at:k) = k].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   837
                                    selectorMapping removeAllKeys:unchangedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   838
                                    (selectorMapping notEmpty and:[selectorMapping size <= 2]) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   839
                                        additionalInfoPerChangedSelector at:eachSelector put:(
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   840
                                            String streamContents:[:s |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   841
                                                |first|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   842
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   843
                                                s nextPutAll:'('.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   844
                                                first := true.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   845
                                                selectorMapping keysAndValuesDo:[:selOld :selNew | 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   846
                                                    first ifFalse:[s nextPutAll:', '].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   847
                                                    s print:('send #',selNew,' instead of #',selOld).
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   848
                                                    first := false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   849
                                                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   850
                                                s nextPutAll:')'.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   851
                                            ]).
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   852
                                    ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   853
                                ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   854
                            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   855
                        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   856
                    ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   857
                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   858
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   859
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   860
            modifiedSelectors removeAllFoundIn:selectorsWithCommentOrFormattingChangeOnly.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   861
            modifiedSelectors removeAllFoundIn:selectorsWithVariableChangeOnly.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   862
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   863
            (selectorsWithCommentOrFormattingChangeOnly notEmpty) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   864
                printSelectors value:'comment/format in' value:selectorsWithCommentOrFormattingChangeOnly value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   865
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   866
            (selectorsWithVariableChangeOnly notEmpty) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   867
                printSelectors value:'variable renamed in' value:selectorsWithVariableChangeOnly value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   868
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   869
            (modifiedSelectors notEmpty) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   870
                printSelectors value:'changed' value:modifiedSelectors value:true.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   871
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   872
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   873
        categoryChanges notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   874
            printSelectors value:'category of' value:categoryChangeSelectors value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   875
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   876
    ] separatedBy:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   877
        initialLogStream cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   878
    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   879
    ^ initialLogStream contents
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   880
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   881
    "Modified: / 17-03-2017 / 18:39:28 / stefan"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   882
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   883
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   884
!SourceCodeManagerUtilities class methodsFor:'utilities-encoding'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   885
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   886
guessEncodingOfFile:aFilename
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   887
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   888
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   889
2818
82c73234ac2d changed: #guessEncodingOfFile:
Stefan Vogel <sv@exept.de>
parents: 2817
diff changeset
   890
    self obsoleteMethodWarning:'ask CharacterEncoder'.
82c73234ac2d changed: #guessEncodingOfFile:
Stefan Vogel <sv@exept.de>
parents: 2817
diff changeset
   891
    ^ CharacterEncoder guessEncodingOfFile:aFilename
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   892
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   893
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   894
guessEncodingOfStream:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   895
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   896
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   897
2817
8a836ca902d4 changed: #guessEncodingOfStream:
Stefan Vogel <sv@exept.de>
parents: 2796
diff changeset
   898
    self obsoleteMethodWarning:'ask CharacterEncoder'.
8a836ca902d4 changed: #guessEncodingOfStream:
Stefan Vogel <sv@exept.de>
parents: 2796
diff changeset
   899
    ^ CharacterEncoder guessEncodingOfStream:aStream
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   900
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   901
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   902
!SourceCodeManagerUtilities methodsFor:'accessing'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   903
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   904
confirmNewFiles:aBoolean
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   905
    "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
   906
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   907
    confirmNewFiles := aBoolean.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   908
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   909
    "Modified (comment): / 24-07-2012 / 18:18:34 / cg"
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   910
!
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   911
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   912
lastSourceLogMessageHeadlines
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   913
    LastSourceLogMessage isNil ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   914
        LastSourceLogMessages := OrderedCollection new.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   915
    ].
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   916
    ^ LastSourceLogMessages 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   917
        collect:[:msg |
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   918
            msg withoutLeadingSeparators asCollectionOfLines first , '...'
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   919
        ]
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   920
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   921
    "Created: / 12-03-2012 / 12:34:35 / cg"
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   922
!
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   923
2569
vrany
parents: 2556
diff changeset
   924
yesToAllNotification
vrany
parents: 2556
diff changeset
   925
vrany
parents: 2556
diff changeset
   926
    ^self class yesToAllNotification
vrany
parents: 2556
diff changeset
   927
vrany
parents: 2556
diff changeset
   928
    "Created: / 11-10-2011 / 12:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2556
diff changeset
   929
!
vrany
parents: 2556
diff changeset
   930
vrany
parents: 2556
diff changeset
   931
yesToAllQuery
vrany
parents: 2556
diff changeset
   932
vrany
parents: 2556
diff changeset
   933
    ^self class yesToAllQuery
vrany
parents: 2556
diff changeset
   934
vrany
parents: 2556
diff changeset
   935
    "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
   936
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   937
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   938
!SourceCodeManagerUtilities methodsFor:'error handling'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   939
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   940
doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   941
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   942
    (self class respondsTo: aMessage selector) ifTrue:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   943
        "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
   944
        self breakPoint: #jv.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   945
        self breakPoint: #cg.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   946
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   947
        ^aMessage sendTo: self class
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   948
    ] ifFalse:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   949
        ^super doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   950
    ]
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   951
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   952
    "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
   953
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   954
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   955
!SourceCodeManagerUtilities methodsFor:'initialization'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   956
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   957
initialize
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   958
    confirmNewFiles := true.
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
   959
    resources := self class classResources.
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   960
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   961
    "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
   962
    "Modified: / 24-07-2012 / 18:17:57 / cg"
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   963
!
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
   964
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   965
setManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   966
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   967
    manager := aSourceCodeManager.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   968
    manager isContainerBased ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   969
        confirmNewFiles isNil "not yet set by user" ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   970
            confirmNewFiles := false.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   971
        ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   972
    ].
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   973
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   974
    "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
   975
    "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
   976
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   977
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   978
!SourceCodeManagerUtilities methodsFor:'utilities'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   979
2569
vrany
parents: 2556
diff changeset
   980
classIsNotYetInRepository:aClass withManager:mgr
vrany
parents: 2556
diff changeset
   981
    |info|
vrany
parents: 2556
diff changeset
   982
vrany
parents: 2556
diff changeset
   983
    info := mgr sourceInfoOfClass:aClass.
vrany
parents: 2556
diff changeset
   984
vrany
parents: 2556
diff changeset
   985
    ^ (info isNil 
vrany
parents: 2556
diff changeset
   986
    or:[(info at:#fileName ifAbsent:nil) isNil
vrany
parents: 2556
diff changeset
   987
    or:[(info at:#module ifAbsent:nil) isNil
vrany
parents: 2556
diff changeset
   988
    or:[(info at:#directory ifAbsent:nil) isNil]]])
vrany
parents: 2556
diff changeset
   989
vrany
parents: 2556
diff changeset
   990
    "Created: / 25-10-2006 / 09:43:00 / cg"
vrany
parents: 2556
diff changeset
   991
!
vrany
parents: 2556
diff changeset
   992
2673
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   993
defaultManager
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   994
    ^ manager
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   995
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   996
    "Created: / 22-12-2011 / 10:59:28 / cg"
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   997
!
06f4f56d7818 added: #defaultManager
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   998
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   999
nameOfExtensionsContainer
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1000
    ^ 'extensions.st'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1001
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1002
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1003
setPackageOfAllMethodsIn:aClass to:aPackage
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1004
    "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
  1005
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1006
    |anyChange anyChangeHere|
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1007
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1008
    anyChange := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1009
    aClass withAllPrivateClassesDo:[:eachClass |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1010
        anyChangeHere := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1011
        eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1012
            mthd package ~= aPackage ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1013
                mthd setPackage:aPackage.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1014
                anyChangeHere := true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1015
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1016
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1017
        anyChangeHere ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1018
            eachClass changed:#projectOrganization
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1019
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1020
        anyChangeHere ifTrue:[anyChange := true].
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1021
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1022
    anyChange ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1023
       Smalltalk changed:#projectOrganization
1185
e86907810d1f handle abortAll in checkIn
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1024
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1025
    ^ anyChange
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1026
!
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1027
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1028
setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1029
    "make all methods belong to the classes project"
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1030
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1031
    aChangeSet do:[:eachChange |
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1032
        eachChange isMethodCodeChange ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1033
            eachChange changeMethod package ~= aPackage ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1034
                Transcript showCR:'change package of ',eachChange changeMethod whoString.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1035
                eachChange changeMethod setPackage:aPackage.        
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1036
            ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1037
        ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1038
    ].
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1039
!
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1040
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1041
sourceCodeForExtensions:aCollectionOfMethods package:aPackageID forManager:scmManagerOrNil
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1042
    |s methodsSortedByName defClass|
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1043
3201
f0993e3fdf02 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3199
diff changeset
  1044
    s := CharacterWriteStream on:(String new:1000).
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1045
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1046
    s nextPutAll:'"{ Package: '''.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1047
    s nextPutAll:aPackageID asString.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1048
    s nextPutAll:''' }"'; nextPutChunkSeparator; cr; cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1049
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1050
    "/ 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
  1051
    "/ s nextPutAll:(Smalltalk timeStamp).
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1052
    "/ s nextPutChunkSeparator. 
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1053
    "/ s cr; cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1054
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1055
    "/ sort them by name (to avoid conflicts due to SCM merge)
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1056
    methodsSortedByName := aCollectionOfMethods asOrderedCollection.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1057
    methodsSortedByName sort:[:a :b |
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1058
                                |clsA clsB|
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1059
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1060
                                clsA := a mclass name.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1061
                                clsB := b mclass name.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1062
                                clsA < clsB ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1063
                                    true
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1064
                                ] ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1065
                                    clsA > clsB ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1066
                                        false
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1067
                                    ] ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1068
                                        a selector < b selector
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1069
                                    ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1070
                                ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1071
                              ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1072
    methodsSortedByName do:[:aMethod |
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1073
        aMethod mclass fileOutMethod:aMethod on:s.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1074
        s cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1075
    ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1076
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1077
    scmManagerOrNil notNil ifTrue:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1078
        defClass := ProjectDefinition definitionClassForPackage:aPackageID.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1079
        defClass notNil ifTrue:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1080
            "/ make sure, an extensionVersion_XXX method is included...
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1081
            "/ (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
  1082
            (methodsSortedByName contains:[:aMethod | aMethod selector == scmManagerOrNil nameOfVersionMethodForExtensions]) ifFalse:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1083
                s nextPutLine:('!!%1 class methodsFor:''documentation''!!' bindWith:defClass name).
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1084
                s cr.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1085
                s nextChunkPut:
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1086
                    (scmManagerOrNil versionMethodTemplateForSmalltalkFor:(scmManagerOrNil nameOfVersionMethodForExtensions)).
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1087
                s space; nextPutChunkSeparator; cr.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1088
            ].
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1089
        ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1090
    ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1091
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1092
    ^ s contents.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1093
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1094
    "Created: / 25-07-2012 / 18:38:05 / cg"
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1095
!
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1096
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1097
sourceCodeManagerFor:aClass
3370
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
  1098
    manager notNil ifTrue:[^ manager].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
  1099
    ^ self class sourceCodeManagerFor:aClass.    
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1100
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1101
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1102
sourceCodeOfClass:aClass
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1103
    |stream src|
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1104
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1105
    stream := '' writeStream.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1106
    Method flushSourceStreamCache.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1107
    aClass fileOutOn:stream withTimeStamp:false.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1108
    src := stream contents asString.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1109
    stream close.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1110
    ^ src
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1111
!
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1112
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1113
validateConsistencyOfPackage:aPackage
3146
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1114
    ^ self validateConsistencyOfPackage:aPackage doClasses:true  doExtensions:true
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1115
!
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1116
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1117
validateConsistencyOfPackage:aPackage doClasses:doClasses doExtensions:doExtensions
3692
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1118
    |checker report msg answer dialog problems numProblems|
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1119
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1120
    "/ also done by ProjectChecker...
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1121
    "/ defClass := aPackage asPackageId projectDefinitionClass.
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1122
    "/ defClass validateDescription.
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1123
3146
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1124
    checker := ProjectChecker new.
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1125
    checker checkExtensionsOnly:(doClasses not and:[ doExtensions ]).
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1126
    report := checker check: aPackage.
3692
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1127
    (report notNil and:[(problems := report problems) notEmptyOrNil]) ifTrue:[
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1128
        numProblems := problems size.
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1129
        numProblems == 1 ifTrue:[
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1130
            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
  1131
        ] ifFalse:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1132
            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
  1133
        ].
3692
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1134
        answer := Dialog confirmWithCancel:(msg bindWith:numProblems 
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1135
                                                with:problems first label) withCRs.
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1136
        answer isNil ifTrue:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1137
            "/ cancel
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  1138
            AbortOperationRequest raiseRequest
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1139
        ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1140
        answer == true ifTrue:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1141
            dialog := Tools::ProjectCheckerBrowser new.
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1142
            dialog
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1143
                projectChecker: (ProjectChecker forPackage: aPackage);
3692
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1144
                problemList:problems;
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1145
                showCancel:true;
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1146
                openModal.
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1147
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1148
            dialog accepted ifFalse:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  1149
                AbortOperationRequest raiseRequest
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1150
            ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1151
        ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1152
    ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1153
!
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1154
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1155
versionString:a isLessThan:b
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1156
    "compare two strings of the form: a.b.c..."
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1157
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1158
    |i1 i2 a1 b1 rest1 rest2|
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1159
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1160
    i1 := a indexOf:$. .
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1161
    i2 := b indexOf:$. .
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1162
    i1 == 0 ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1163
        i1 := a size + 1.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1164
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1165
    i2 == 0 ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1166
        i2 := b size + 1.
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1167
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1168
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1169
    a1 := Integer readFrom:(a copyTo:i1-1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1170
    b1 := Integer readFrom:(b copyTo:i2-1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1171
    a1 < b1 ifTrue:[^ true].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1172
    a1 > b1 ifTrue:[^ false].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1173
    rest1 := (a copyFrom:i1+1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1174
    rest2 := (b copyFrom:i2+1).
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1175
    rest1 isEmpty ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1176
        ^ rest2 notEmpty
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1177
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1178
    rest2 isEmpty ifTrue:[
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1179
        ^ false
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1180
    ].
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1181
    ^ self versionString:rest1 isLessThan:rest2
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1182
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1183
    "
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1184
     self assert:(self versionString:'12.34.66' isLessThan:'12.35.66').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1185
     self assert:(self versionString:'12.34.66' isLessThan:'12.35.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1186
     self assert:(self versionString:'11.34.66' isLessThan:'12.34.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1187
     self assert:(self versionString:'11.35.66' isLessThan:'12.34.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1188
     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
  1189
     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
  1190
     self assert:(self versionString:'13.35.66' isLessThan:'13.35.67').
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1191
     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
  1192
     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
  1193
     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
  1194
     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
  1195
     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
  1196
    "
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1197
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1198
    "Modified: / 17-02-2011 / 10:20:14 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1199
! !
1160
d56159f5a86f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
  1200
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1201
!SourceCodeManagerUtilities methodsFor:'utilities-encoding'!
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1202
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1203
guessEncodingOfFile:aFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1204
    "look for a string
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1205
        encoding #name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1206
     or:
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1207
        encoding: name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1208
     within the given buffer 
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1209
     (which is usually the first few bytes of a textFile).
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1210
     If that's not found, use heuristics (in CharacterArray) to guess."
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1211
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1212
    <resource: #obsolete>
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1213
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1214
    self obsoleteMethodWarning:'ask CharacterEncoder'.
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1215
    ^ CharacterEncoder guessEncodingOfFile:aFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1216
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1217
    "
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1218
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1219
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1220
    "
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1221
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1222
    "Modified (comment): / 14-01-2012 / 20:54:35 / cg"
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1223
!
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1224
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1225
guessEncodingOfStream:aStream
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1226
    "look for a string of the form
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1227
            encoding #name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1228
     or:
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1229
            encoding: name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1230
     in the first few bytes of aStream."
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1231
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1232
    <resource: #obsolete>
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1233
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1234
    self obsoleteMethodWarning:'ask CharacterEncoder'.
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1235
    ^ CharacterEncoder guessEncodingOfStream:aStream
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1236
! !
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1237
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1238
!SourceCodeManagerUtilities methodsFor:'utilities-scm'!
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1239
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1240
askForPackageVersion:question with:includeSubProjectsHolderOrNil knownTags:knownTags into:aTwoArgBlock
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1241
    |dateFormat string dateOrNil symbolicNameOrNil|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1242
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1243
    dateFormat := UserPreferences current dateInputFormat.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1244
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1245
    Dialog 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1246
        modifyingBoxWith:[:box |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1247
            includeSubProjectsHolderOrNil notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1248
                box verticalPanel 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1249
                    add:(CheckBox label:(resources string:'Include Subprojects')
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1250
                                  model:includeSubProjectsHolderOrNil).
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1251
            ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1252
        ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1253
        do:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1254
            |suggestion|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1255
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1256
            suggestion := LastComparedTag.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1257
            suggestion isNil ifTrue:[ suggestion := Date today printStringFormat:dateFormat ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1258
            
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1259
            string := Dialog
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1260
                        request:(resources string:question with:dateFormat)
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1261
                        initialAnswer:suggestion
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1262
                        list:knownTags.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1263
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1264
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1265
    string notEmptyOrNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1266
        dateOrNil := Date readFrom:string printFormat:dateFormat onError:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1267
        dateOrNil isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1268
            symbolicNameOrNil := string
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1269
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1270
        aTwoArgBlock value:dateOrNil value:symbolicNameOrNil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1271
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1272
    ^ string
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1273
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1274
    "Created: / 04-02-2017 / 18:39:11 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1275
    "Modified: / 05-02-2017 / 04:24:23 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1276
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1277
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1278
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1279
    "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
  1280
     If askForRevision is false, check-out the newest version.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1281
     Return a changeSet or nil (if any error occurred)"
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1282
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1283
    ^ self
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1284
        changeSetForExtensionMethodsForPackage:packageToCheckOut 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1285
        revision:nil orAskForRevision:askForRevision 
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1286
        usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1287
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1288
    "Created: / 29-12-2011 / 14:26:01 / cg"
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1289
!
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1290
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1291
changeSetForExtensionMethodsForPackage:packageToCheckOut revision:revisionOrNil orAskForRevision:askForRevision usingManager:aSourceCodeManager
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1292
    "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
  1293
     If askForRevision is false, check-out the newest version.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1294
     Return a changeSet or nil (if any error occurred)"
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1295
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1296
    |directory module file aStream sourceToLoad rev msg newestRev |
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1297
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1298
    directory := packageToCheckOut asPackageId directory.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1299
    module := packageToCheckOut asPackageId module.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1300
    file := self nameOfExtensionsContainer.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1301
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1302
    "/
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1303
    "/ ask for revision
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1304
    "/
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1305
    (rev := revisionOrNil) isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1306
        newestRev := aSourceCodeManager newestRevisionInFile:file directory:directory module:module.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1307
        askForRevision ifFalse:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1308
            rev := newestRev ? ''
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1309
        ] ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1310
            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
  1311
            newestRev notNil ifTrue:[
3261
7a585999dcef class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3259
diff changeset
  1312
                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
  1313
            ].
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1314
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1315
            rev := self
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1316
                    askForExistingRevision:msg 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1317
                    title:'CheckOut from repository' 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1318
                    class:nil 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1319
                    manager:aSourceCodeManager 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1320
                    module:module package:directory fileName:file.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1321
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1322
            rev isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1323
                ^ nil   "/ canceled
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1324
            ].
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1325
        ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1326
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1327
    rev withoutSpaces isEmpty ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1328
        rev := #newest.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1329
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1330
    ] ifFalse:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1331
        msg := 'extracting previous %1'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1332
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1333
    aStream := aSourceCodeManager  
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1334
        streamForClass:nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1335
        fileName:file 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1336
        revision:rev 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1337
        directory:directory 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1338
        module:module
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1339
        cache:true.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1340
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1341
    aStream isNil ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1342
        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
  1343
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1344
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1345
    aStream class readErrorSignal handle:[:ex |
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1346
        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
  1347
        aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1348
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1349
    ] do:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1350
        sourceToLoad := aStream contents asString.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1351
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1352
    aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1353
    ^ ChangeSet fromStream:(sourceToLoad readStream).
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1354
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1355
    "Created: / 29-12-2011 / 14:27:00 / cg"
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1356
!
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1357
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1358
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
  1359
    |moduleName directoryName containerName|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1360
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1361
    moduleName := module allBold.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1362
    directoryName := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1363
    containerName := containerFileName allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1364
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1365
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1366
    "/ check for the container
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1367
    "/
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1368
    (mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1369
        allowCreate ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1370
            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
  1371
                                   with:containerName with:moduleName with:directoryName) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1372
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1373
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1374
        (Dialog 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1375
            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
  1376
                                 with:containerName with:moduleName with:directoryName) withCRs
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1377
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1378
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1379
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1380
        ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1381
        (mgr createContainerForText:'' inModule:module package:directory container:containerFileName) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1382
            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
  1383
                                 with:containerName with:moduleName with:directoryName).
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1384
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1385
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1386
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1387
    ^ true.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1388
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1389
    "Modified: / 13-09-2006 / 18:24:57 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1390
    "Created: / 29-12-2011 / 14:35:36 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1391
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1392
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1393
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
  1394
    |moduleNameBold directoryNameBold|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1395
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1396
    moduleNameBold := module allBold.
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1397
    directoryNameBold := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1398
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1399
    "/
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1400
    "/ check for the directory
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1401
    "/
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1402
    (mgr checkForExistingModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1403
        allowCreate ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1404
            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
  1405
                                   with:directoryNameBold with:moduleNameBold) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1406
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1407
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1408
        (Dialog 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1409
            confirm:(resources stringWithCRs:'''%1'' is a new directory in module ''%2''.\\Create it in %3?' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1410
                                with:directoryNameBold 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1411
                                with:moduleNameBold
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1412
                                with:mgr managerTypeName)
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1413
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1414
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1415
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1416
        ].
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1417
        (mgr createModule:module directory:directory) ifFalse:[
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1418
            self warn:(resources stringWithCRs:'Cannot create new directory: ''%1'' in module ''%2'' in %3' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1419
                                 with:directoryNameBold 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1420
                                 with:moduleNameBold
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1421
                                 with:mgr managerTypeName).
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1422
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1423
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1424
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1425
    ^ true.
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1426
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1427
    "Modified: / 21-12-2011 / 18:46:11 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1428
    "Created: / 29-12-2011 / 14:35:20 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1429
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1430
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1431
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
  1432
    |moduleName answer|
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1433
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1434
    (mgr checkForExistingModule:module) ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1435
        moduleName := module allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1436
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1437
        allowCreate ifFalse:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1438
            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
  1439
                                  with:moduleName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1440
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1441
        ].
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  1442
        AbortAllOperationWantedQuery query ifTrue:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1443
            answer := Dialog 
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1444
                confirmWithCancel:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName)
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1445
                labels:(resources array:#('Cancel All' 'Cancel' 'Yes' )).
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1446
            answer isNil ifTrue:[ AbortAllOperationRequest raise ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1447
        ] ifFalse:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1448
            answer := Dialog 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1449
                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
  1450
                noLabel:'Cancel'
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1451
        ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1452
        answer ifFalse:[ ^ false].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1453
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1454
        (mgr createModule:module) ifFalse:[
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1455
            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
  1456
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1457
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1458
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1459
    ^ true.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  1460
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1461
    "Modified: / 21-12-2011 / 18:42:03 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1462
    "Created: / 29-12-2011 / 14:35:06 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1463
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1464
3534
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1465
checkOutPackages: packages askForRevision: askForRevision
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1466
    "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
  1467
     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
  1468
     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
  1469
     revision. 
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1470
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1471
     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
  1472
     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
  1473
     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
  1474
     newest she wants.
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1475
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1476
     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
  1477
     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
  1478
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1479
    ^ self subclassResponsibility.
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1480
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1481
    "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
  1482
!
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1483
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1484
checkinClass:aClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1485
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1486
     Asks interactively for a log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1487
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1488
    ^ self checkinClass:aClass withInfo:nil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1489
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1490
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1491
checkinClass:aClass withInfo:aLogInfoOrNil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1492
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1493
     If the argument, aLogInfoOrNil isNil, ask interactively for a log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1494
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1495
    ^ self checkinClass:aClass withInfo:aLogInfoOrNil withCheck:true
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1496
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1497
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1498
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1499
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1500
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1501
     If doCheckClass is true, the class is checked for send of halts etc."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1502
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1503
    ^ self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1504
        checkinClass:aClass 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1505
        withInfo:aLogInfoOrNil 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1506
        withCheck:doCheckClass 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1507
        usingManager:(self sourceCodeManagerFor:aClass)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1508
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1509
    "Modified: / 21-12-2011 / 18:19:55 / cg"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1510
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1511
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1512
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClassHolder usingManager:managerOrNil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1513
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1514
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1515
     If doCheckClass is true, the class is checked for send of halts etc."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1516
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1517
    ^ self
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1518
        checkinClass:aClass 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1519
        withInfo:aLogInfoOrNil withCheck:doCheckClassHolder 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1520
        usingManager:managerOrNil 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1521
        confirmNewContainer:confirmNewFiles
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1522
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1523
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1524
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClassHolder usingManager:managerOrNil confirmNewContainer:confirmNewContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1525
    "check a class into the source repository.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1526
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1527
     If doCheckClass is true, the class is checked for send of halts etc."
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1528
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1529
    |logMessage checkinInfo mgr pri|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1530
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1531
    aClass isLoaded ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1532
        self information:(resources string:'Cannot checkin unloaded classes (%1)' with:aClass name).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1533
        ^ false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1534
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1535
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1536
    mgr := managerOrNil.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1537
    mgr isNil ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1538
        mgr := self sourceCodeManagerFor:aClass.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1539
        mgr isNil ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1540
            ^ false
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1541
        ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1542
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1543
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1544
    self ensureCorrectVersionMethodsInClass:aClass usingManager:mgr.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1545
    mgr supportsCheckinLogMessages ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1546
        (self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1547
            getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1548
            forClass:aClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1549
            valuesInto:[:logMessageRet :checkinInfoRet |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1550
                logMessage := logMessageRet.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1551
                checkinInfo := checkinInfoRet.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1552
            ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1553
        ) ifFalse:[^ false].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1554
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1555
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1556
    (self classIsNotYetInRepository:aClass withManager:mgr) ifTrue:[
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1557
        (self createSourceContainerForClass:aClass usingManager:mgr confirmNewContainer:confirmNewContainer) ifFalse:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1558
"/            self warn:'did not create a container for ''' , aClass name , ''''.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1559
            ^ false
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1560
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1561
        ^ true.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1562
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1563
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1564
    self activityNotification:(resources string:'checking in %1' with:aClass name).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1565
    pri := Processor activePriority.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1566
    Processor activeProcess withPriority:pri-1 to:pri
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1567
    do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1568
        |revision aborted freshCreated|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1569
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1570
        freshCreated := false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1571
        revision := aClass revision.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1572
        revision isNil ifTrue:[ 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1573
            mgr isContainerBased ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1574
                "/ mhmh - check if it has a container.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1575
                (mgr checkForExistingContainerForClass:aClass) ifFalse:[
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1576
                    (self createSourceContainerForClass:aClass usingManager:mgr confirmNewContainer:confirmNewContainer) ifFalse:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1577
                        self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1578
                        ^ false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1579
                    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1580
                    freshCreated := true.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1581
                ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1582
            ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1583
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1584
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1585
        doCheckClassHolder value ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1586
            "/ check if the class contains halts, error-sends etc.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1587
            (self checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:doCheckClassHolder) ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1588
                ^ false
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1589
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1590
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1591
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1592
        freshCreated ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1593
            aborted := false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1594
            AbortOperationRequest handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1595
                aborted := true.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1596
                ex return.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1597
            ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1598
                |checkinState cause|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1599
                checkinState := false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1600
                cause := ''.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1601
                [
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1602
                    checkinState := mgr checkinClass:aClass logMessage:logMessage
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1603
                ] on:SourceCodeManagerError do:[:ex| 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1604
                    cause := ex description.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1605
                    "/ ex proceed.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1606
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1607
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1608
                checkinState ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1609
                    Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1610
                    self warn:(resources stringWithCRs:'Checkin of "%1" failed\\' with:aClass name allBold),cause.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1611
                    AbortOperationRequest raise.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1612
                    "/ ^ false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1613
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1614
                checkinInfo notNil ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1615
                    checkinInfo isStable ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1616
                        "set stable tag for class that has been checked in"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1617
                        self tagClass:aClass as:#stable.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1618
                    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1619
                    checkinInfo tagIt ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1620
                        "set any additional tags for the class that has been checked in"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1621
                        (checkinInfo tag asCollectionOfSubstringsSeparatedByAny:',;') do:[:eachTag |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1622
                            self tagClass:aClass as:eachTag withoutSeparators.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1623
                        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1624
                    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1625
                    CVSSourceCodeManager recentTag:checkinInfo tag.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1626
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1627
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1628
            aborted ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1629
                Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1630
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1631
                AbortAllOperationWantedQuery query ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1632
                    (Dialog 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1633
                        confirm:(resources stringWithCRs:'Checkin of "%1" aborted.\\Cancel all ?' with:aClass name)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1634
                        default:false)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1635
                    ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1636
                        AbortAllOperationRequest raise.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1637
                    ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1638
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1639
                ^ false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1640
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1641
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1642
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1643
    ^ true
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1644
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1645
    "Created: / 21-12-2011 / 18:19:14 / cg"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1646
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1647
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1648
checkinClasses:aCollectionOfClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1649
    "check a collection of classes into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1650
     Asks interactively for log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1651
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1652
    ^ self checkinClasses:aCollectionOfClass withInfo:nil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1653
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1654
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1655
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1656
    "check a bunch of classes into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1657
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1658
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1659
    |checkClassWhenCheckingInHolder|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1660
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1661
    checkClassWhenCheckingInHolder := ValueHolder with:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1662
    checkClassWhenCheckingInHolder 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1663
        onChangeEvaluate:[ UserPreferences current at:#checkClassesWhenCheckingIn put:checkClassWhenCheckingInHolder value ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1664
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1665
    ^ self
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1666
        checkinClasses:aCollectionOfClasses 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1667
        withInfo:aLogInfoOrNil 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1668
        withCheck:checkClassWhenCheckingInHolder
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1669
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1670
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1671
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1672
    "check a bunch of classes into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1673
     If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1674
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1675
    self checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder usingManager:nil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1676
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1677
    "Modified: / 21-12-2011 / 18:24:47 / cg"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1678
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1679
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1680
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder usingManager:aManagerOrNil
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1681
    "check a bunch of classes into the source repository.
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1682
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1683
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1684
    ^ self
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1685
        checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1686
        usingManager:aManagerOrNil 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1687
        confirmNewContainer:confirmNewFiles
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1688
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1689
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1690
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1691
    usingManager:aManagerOrNil confirmNewContainer:confirmNewContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1692
    "check a bunch of classes into the source repository.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1693
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1694
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1695
    |classes allClasses checkinInfoOrString yesOrNoToAll unchangedClasses|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1696
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1697
    "/ ignore private classes
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1698
    classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1699
    classes isEmpty ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1700
        self information:'Only private classes given - nothing checked in.'.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1701
        ^ self
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1702
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1703
    classes := classes select:[:aClass | aClass isLoaded].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1704
    classes isEmpty ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1705
        self information:'Only unloaded classes given - nothing checked in.'.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1706
        ^ self
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1707
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1708
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1709
    classes size == 1 ifTrue:[
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1710
        self 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1711
            checkinClass:classes first 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1712
            withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1713
            usingManager:aManagerOrNil
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1714
            confirmNewContainer:confirmNewContainer.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1715
        ^ self
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1716
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1717
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1718
    "ask once, for all classes"
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1719
    aLogInfoOrStringOrNil isNil ifTrue:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1720
        checkinInfoOrString := self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1721
                        getCheckinInfoFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1722
                        initialAnswer:nil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1723
                        withQuickOption:true.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1724
        checkinInfoOrString isNil ifTrue:[^ self].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1725
    ] ifFalse:[
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1726
        checkinInfoOrString := aLogInfoOrStringOrNil.
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1727
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1728
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1729
    allClasses := classes.    
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1730
    (checkinInfoOrString isString not and:[checkinInfoOrString quickCheckIn]) ifTrue:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1731
        "/ not only the one's in the changeSet;
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1732
        "/ also those which have not been checked in before.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1733
        classes := classes select:[:each | each hasUnsavedChanges or:[ (each revisionOfManager:aManagerOrNil) isNil ]].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1734
        classes isEmpty ifTrue:[ Dialog information:'no changes to checkin (quickCheckIn)' ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1735
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1736
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1737
    "abortAll is handled, and also asked for here!!"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1738
    AbortAllOperationRequest handleAndAnswerQueryIn:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1739
        classes notEmpty ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1740
            self yesToAllNotification handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1741
                yesOrNoToAll := ex parameter.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1742
                ex proceed
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1743
            ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1744
                self yesToAllQuery handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1745
                    ex proceedWith:yesOrNoToAll
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1746
                ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1747
                    classes do:[:aClass |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1748
                        self activityNotification:(resources string:'checking in %1' with:aClass name).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1749
                        "/ ca does not want boxes to pop up all over ...
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1750
                        UserInformation handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1751
                            Transcript showCR:ex description.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1752
                            ex proceed.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1753
                        ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1754
                            AbortOperationRequest catch:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1755
                                self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1756
                                    checkinClass:aClass 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1757
                                    withInfo:checkinInfoOrString 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1758
                                    withCheck:doCheckClassesHolder
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1759
                                    usingManager:aManagerOrNil
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1760
                                    confirmNewContainer:confirmNewContainer
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1761
                            ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1762
                        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1763
                    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1764
                ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1765
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1766
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1767
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1768
        (checkinInfoOrString isString not and:[ (checkinInfoOrString isStable or:[checkinInfoOrString tagIt]) ])
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1769
        ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1770
            "/mhmh - but tag should be set on all (even unchanged ones)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1771
            "/ the other onces have already been tagged
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1772
            unchangedClasses := allClasses reject:[:eachClass | (classes includes:eachClass)].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1773
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1774
            "mhmh - could still have to tag them"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1775
            checkinInfoOrString isStable ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1776
                unchangedClasses do:[:eachClass |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1777
                    self tagClass:eachClass as:#stable.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1778
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1779
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1780
            checkinInfoOrString tagIt ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1781
                unchangedClasses do:[:eachClass |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1782
                    self tagClass:eachClass as:(checkinInfoOrString tag).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1783
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1784
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1785
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1786
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1787
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1788
    "Created: / 21-12-2011 / 18:24:25 / cg"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1789
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1790
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1791
checkoutClass:aClass askForMerge:askForMerge
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1792
    "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
  1793
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1794
    self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1795
        checkoutClass:aClass 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1796
        askForRevision:true
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1797
        askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1798
!
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1799
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1800
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1801
    "check-out a class from the source repository.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1802
     If askForRevision is false, check-out the newest version."
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1803
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1804
    self
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1805
        checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge 
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1806
        askForConfirmation:true
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1807
!
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1808
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1809
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge askForConfirmation:askForConfirmation
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1810
    "check-out a class from the source repository.
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1811
     If askForRevision is false, check-out the newest version."
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1812
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1813
    |mgr sourceInfo
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1814
     currentClass inChangeSet
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1815
     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
  1816
     nm msg rev2 newestRev
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1817
     containerModule containerPackage containerFile rslt
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1818
     pkg listHere listRep diffSet 
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  1819
     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
  1820
     changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1821
     wasInChangeSetBefore|
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1822
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1823
    aClass isNil ifTrue:[self error:'nil class'].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1824
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1825
    currentClass := aClass theNonMetaclass.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1826
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1827
    nm := currentClass name.
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1828
    mgr := self sourceCodeManagerFor:currentClass.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1829
    mgr isNil ifTrue:[
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1830
        ^ self
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1831
    ].
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1832
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1833
    sourceInfo := mgr sourceInfoOfClass:currentClass.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1834
    sourceInfo notNil ifTrue:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  1835
        currentClass package ~= PackageId noProjectID ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1836
            containerPackage := mgr directoryFromSourceInfo:sourceInfo.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1837
            containerModule := mgr moduleFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1838
        ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1839
        containerFile := mgr containerFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1840
    ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1841
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1842
    currentClass isLoaded ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1843
        rev := currentClass binaryRevision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1844
        rev2 := currentClass revision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1845
        rev isNil ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1846
            rev := rev2
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1847
        ].
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1848
        rev isNil ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1849
            pkg := currentClass package.
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  1850
            (pkg notNil and:[pkg ~= PackageId noProjectID]) ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1851
                containerModule := pkg upTo:$:.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1852
                containerPackage := pkg copyFrom:(containerModule size + 2).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1853
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1854
            containerModule size == 0 ifTrue:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1855
                containerModule := (self class lastModule ) ? Project current repositoryModule.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1856
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1857
            containerPackage size == 0 ifTrue:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1858
                containerPackage := (self class lastPackage ) ? Project current package.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1859
            ].
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1860
            answer := self confirmWithCancel:(resources 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  1861
                                                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
  1862
                                                with:containerModule allBold 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  1863
                                                with:containerPackage allBold
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1864
                                                with:currentClass name allBold) withCRs.
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1865
            answer isNil ifTrue:[^ self "cancelled"].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1866
            answer ifFalse:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1867
                rslt := self
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1868
                    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
  1869
                    title:'Container to load from' note:nil 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1870
                    initialModule:containerModule 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1871
                    initialPackage:containerPackage 
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1872
                    initialFileName:(currentClass nameWithoutPrefix , '.st')
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1873
                    forNewContainer:false.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1874
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1875
                rslt isNil ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1876
                    "/ canel
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1877
                    ^ self
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1878
                ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1879
                containerModule := "lastModule :=" rslt at:#module.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1880
                containerPackage := "lastPackage :=" rslt at:#package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1881
                containerFile := rslt at:#fileName.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1882
            ].
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1883
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1884
"/            rslt := self
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1885
"/                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
  1886
"/                title:'Container to checkOut' note:nil 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1887
"/                initialModule:containerModule 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1888
"/                initialPackage:containerPackage
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1889
"/                initialFileName:(currentClass name , '.st').
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1890
"/                forNewContainer:false.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1891
"/            rslt isNil ifTrue:[^ self].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1892
            "/ 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
  1893
            "/ ^ self
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1894
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1895
    ].
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1896
1966
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1897
    containerFile isNil ifTrue:[
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1898
        containerFile := currentClass classFilename.
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1899
    ].
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1900
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1901
    "/
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1902
    "/ 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
  1903
    "/
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1904
    containerModule isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1905
        containerModule := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1906
                                        stringWithCRs:'Missing Module Information for CheckOut of "%1".\\Module:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1907
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1908
        containerModule isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1909
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1910
    containerPackage isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1911
        containerPackage := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1912
                                        stringWithCRs:'Missing Package Information for CheckOut of "%1".\\Package:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  1913
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1914
        containerPackage isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1915
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  1916
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1917
    newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1918
    askForRevision ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1919
        rev := newestRev ? ''
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1920
    ] ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1921
        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
  1922
        rev notNil ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1923
            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
  1924
                                           with:nm allBold with:rev).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1925
            (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
2539
abce5c41eef8 comment/format in: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1926
                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
  1927
            ]
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1928
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1929
        newestRev notNil ifTrue:[
2539
abce5c41eef8 comment/format in: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1930
            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
  1931
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1932
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1933
        rev := self
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1934
                    askForExistingRevision:msg 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1935
                    title:'CheckOut from repository' 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1936
                    class:currentClass.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1937
        rev isNil ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1938
            ^ self   "/ canceled
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1939
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1940
    ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1941
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1942
    rev withoutSpaces isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1943
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1944
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1945
        aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1946
        revString := '(newest: ' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1947
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1948
        msg := 'extracting previous %1'.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1949
"/        aStream := mgr getSourceStreamFor:currentClass revision:rev.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1950
"/        revString := rev
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1951
        aStream := mgr  
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1952
            streamForClass:currentClass
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1953
            fileName:containerFile 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1954
            revision:rev 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1955
            directory:containerPackage 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1956
            module:containerModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1957
            cache:true.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1958
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  1959
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1960
    aStream isNil ifTrue:[
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1961
        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
  1962
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1963
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1964
    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
  1965
        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
  1966
        aStream close.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1967
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1968
    ] do:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1969
        sourceToLoad := aStream contents asString.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1970
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1971
    aStream close.
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  1972
1919
8d30ac5be40f *** empty log message ***
boris
parents: 1913
diff changeset
  1973
    wasInChangeSetBefore := ChangeSet current includesChangeForClassOrMetaclass:currentClass.
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1974
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1975
    currentClass isLoaded ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1976
        rev = newestRev ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1977
            currentClass autoload.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  1978
        ] ifFalse:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1979
            sourceToLoad readStream fileIn.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  1980
        ].
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1981
        wasInChangeSetBefore ifFalse:[
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1982
            ChangeSet current condenseChangesForClass:currentClass.
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1983
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1984
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1985
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1986
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  1987
    inChangeSet := aClass hasUnsavedChanges.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  1988
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1989
    Error handle:[:ex |
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1990
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1991
            confirm:(resources 
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1992
                        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
  1993
                        with:ex description 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1994
                        with:currentClass name allBold) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1995
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  1996
        ifFalse:[
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  1997
            AbortOperationRequest raise
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1998
        ].
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1999
        sourceToLoad readStream fileIn.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2000
        ^ self.
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2001
    ] do:[
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2002
        self activityNotification:'generating current source...'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2003
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2004
        currentSource := self sourceCodeOfClass:currentClass.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2005
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2006
        self activityNotification:'comparing...'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2007
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2008
        sourceToLoad = currentSource ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2009
            "/ make all methods belong to the classes project
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2010
            self setPackageOfAllMethodsIn:aClass to:aClass package.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2011
            inChangeSet ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2012
                rev = newestRev ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2013
                    (askForConfirmation not
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2014
                    or:[ wasInChangeSetBefore not
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2015
                    or:[ self confirm:(resources 
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2016
                                    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
  2017
                                    with:aClass name)]]) 
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2018
                    ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2019
                        ChangeSet current condenseChangesForClass:aClass.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2020
                    ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2021
                ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2022
            ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2023
            self activityNotification:'... nothing changed in repository'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2024
            ^ self.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2025
        ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2026
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2027
        self activityNotification:'generating diffSet...'.
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2028
        listHere := ChangeSet fromStream:(currentSource readStream).
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2029
    ].
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2030
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2031
    listRep := ChangeSet fromStream:(sourceToLoad readStream).
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
  2032
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2033
    Error handle:[:ex |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2034
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2035
            confirm:(resources 
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2036
                        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
  2037
                        with:ex description
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2038
                    ) 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2039
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2040
        ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2041
            ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2042
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2043
        sourceToLoad readStream fileIn.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2044
        ^ self.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2045
    ] do:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2046
        versionMethodsHere := listHere select:[:change | (change isMethodChange 
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  2047
                                               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
  2048
                                               and:[change changeClass isMeta]])].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2049
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2050
        versionMethodsRep := listRep select:[:change | (change isMethodChange 
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  2051
                                               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
  2052
                                               and:[change changeClass isMeta]])].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2053
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2054
        "/ compare all but the version methods
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2055
        listHere := listHere reject:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  2056
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2057
                                               and:[change changeClass isMeta]])].
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2058
        listRep := listRep reject:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  2059
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2060
                                               and:[change changeClass isMeta]])].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2061
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2062
        diffSet := listHere diffSetsAgainst:listRep.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2063
        changed := diffSet changed.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2064
        onlyHere := diffSet onlyInReceiver.
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2065
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2066
        "/ reject extensions
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2067
        onlyHere := onlyHere reject:[:eachDiff|  
2774
46c3fee4b485 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2719
diff changeset
  2068
                        |method methodsPackage|
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2069
3272
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2070
                        eachDiff isMethodChange  
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2071
                        and:[ eachDiff changeClass notNil
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2072
                        and:[ (method := (eachDiff changeClass compiledMethodAt:eachDiff selector)) notNil 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2073
                        and:[ (methodsPackage := method package) ~= containerPackage
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2074
                        and:[ methodsPackage ~= PackageId noProjectID  ]]]]
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2075
                    ]. 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2076
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2077
        onlyInRep := diffSet onlyInArg.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2078
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2079
        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
  2080
        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
  2081
        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
  2082
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2083
        labels := #('Cancel' 'Merge' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2084
        values := #(nil #merge #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2085
        default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2086
                        ifTrue:[3. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2087
                        ifFalse:[2. "i.e. merge"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2088
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2089
        msg := 'About to load ''%4''.\\'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2090
        onlyInRep size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2091
            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
  2092
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2093
        onlyHere size > 0 ifTrue:[
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2094
            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
  2095
            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
  2096
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2097
        changed size > 0 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2098
            changed size == 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2099
                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
  2100
                singleChangeSelector := changed first first selector allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2101
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2102
                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
  2103
            ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2104
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2105
        changedClassDefinitions size > 0 ifTrue:[
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2106
            msg := msg , (changedClassDefinitions size == 1 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2107
                            ifTrue:['The class definition is different.\\'] 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2108
                            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
  2109
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2110
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2111
        onlyHere isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2112
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2113
                (changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[
2605
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  2114
                    versionMethodsRep notEmpty ifTrue:[
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  2115
                        (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
  2116
                            versionMethodsRep do:[:each | each apply].
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  2117
                        ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2118
                    ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2119
                    "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2120
                    "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2121
                    self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
2605
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  2122
                    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
  2123
                    ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2124
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2125
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2126
                    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
  2127
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2128
                labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2129
                values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2130
                default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2131
                                ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2132
                                ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2133
                default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2134
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2135
                changed isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2136
                    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
  2137
                    labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2138
                    values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2139
                    default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2140
                                    ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2141
                                    ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2142
                    default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2143
                ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2144
                    inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2145
                        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
  2146
                    ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2147
                    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
  2148
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2149
            ]
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2150
        ] ifFalse:[
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2151
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2152
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2153
                    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
  2154
                    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
  2155
                ].
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  2156
                labels := #('Cancel' 'Load'). 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2157
                values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  2158
                default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  2159
                                ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  2160
                                ifFalse:[1. "i.e. cancel"].
1907
30ca5aea5a7a dialogs defaults
fm
parents: 1886
diff changeset
  2161
                default := 2. 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2162
            ] ifFalse:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  2163
                inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  2164
                    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
  2165
                    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
  2166
                ]
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  2167
            ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2168
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2169
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2170
        msg := msg bindWith:onlyInRep size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2171
                   with:onlyHere size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2172
                   with:changed size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2173
                   with:aClass name allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2174
                   with:changedClassDefinitions size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2175
                   with:singleChangeSelector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2176
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2177
        askForConfirmation ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2178
            answer := #load           
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2179
        ] ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2180
            answer := (Dialog confirmWithCancel:msg withCRs
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2181
                   labels:(resources array:labels)
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2182
                   values:values 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2183
                   default:default).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2184
            answer isNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2185
                self activityNotification:'...cancelled'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2186
                ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2187
            ].
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  2188
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2189
        self activityNotification:'updating...'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2190
        changedClasses := IdentitySet new.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2191
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2192
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2193
            "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
  2194
             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
  2195
            onlyHere do:[:eachChange |   
3272
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2196
                "remove this change (method not present in repository version)"
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2197
                |cClass|
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2198
                eachChange isMethodChange ifTrue:[
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2199
                    cClass := eachChange changeClass.
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2200
                    cClass notNil ifTrue:[ 
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2201
                       cClass basicRemoveSelector:eachChange selector 
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2202
                    ].
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2203
                ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2204
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2205
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2206
            changedClassDefinitions do:[:eachChangeArr | 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2207
                |cHere eachChangedClass| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2208
                cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2209
                eachChangedClass := cHere changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2210
                eachChangedClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2211
                    changedClasses add:eachChangedClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2212
                    eachChangedClass := eachChangedClass theNonMetaclass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2213
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2214
                    "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
  2215
                    changed do:[:eachChangeArr|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2216
                        |eachChange eachClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2217
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2218
                        eachChange := eachChangeArr first.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2219
                        eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2220
                            eachClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2221
                            eachClass theNonMetaclass == eachChangedClass ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2222
                                eachClass basicRemoveSelector:eachChange selector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2223
                            ].
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  2224
                        ].
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  2225
                    ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2226
                ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2227
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2228
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2229
           "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
  2230
           changedClassDefinitions do:[:eachChangeArr |    
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2231
                |cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2232
                cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2233
                cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2234
            ].
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  2235
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2236
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2237
        onlyInRep do:[:eachChange |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2238
            |changeClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2239
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2240
            "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
  2241
             eachChange apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2242
             eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2243
                 changeClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2244
                 changeClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2245
                     eachChange changeMethod setPackage:(changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2246
                     changedClasses add:changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2247
                 ]
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  2248
             ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2249
        ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2250
    .
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2251
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2252
            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
  2253
                 |cHere cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2254
                 cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2255
                 cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2256
                 cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2257
                 cRep isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2258
                     cRep changeMethod setPackage:(cRep changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2259
                     changedClasses add:cRep changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2260
                 ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2261
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2262
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2263
            versionMethodsRep size >= 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2264
                versionMethodsRep last apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2265
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2266
                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
  2267
            ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2268
            "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2269
            "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2270
            self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  2271
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2272
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2273
        answer == #load ifTrue:[
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  2274
            inChangeSet := aClass hasUnsavedChanges.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2275
            inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2276
                rev = newestRev ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2277
                    (wasInChangeSetBefore not
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2278
                     or:[ self confirm:(resources 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2279
                                    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
  2280
                                    with:aClass name)]) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2281
                    ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2282
                        ChangeSet current condenseChangesForClass:aClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2283
                    ].
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2284
                ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2285
            ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2286
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2287
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2288
        changedClasses do:[:eachClass |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2289
             eachClass changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2290
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2291
        Smalltalk changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2292
        self activityNotification:'... done'.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2293
    ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2294
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2295
    "Modified: / 07-02-2001 / 18:18:32 / ps"
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  2296
    "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
  2297
!
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2298
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2299
checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge usingManager:aSourceCodeManager
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2300
    "check-out a class from the source repository.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2301
     If askForRevision is false, check-out the newest version."
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2302
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2303
    |inChangeSet extensionMethods msg
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2304
     listHere listRep diffSet 
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2305
     changed onlyHere onlyInRep answer labels values singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2306
     changedClasses default |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2307
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2308
    listRep := self changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager.
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  2309
    listRep isNil ifTrue:[ ^self ].
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2310
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2311
    self activityNotification:'generating diffSet...'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2312
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2313
    extensionMethods := OrderedCollection new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2314
    Smalltalk allClassesDo:[:aClass | |owner classPackage|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2315
        "/ individual methods ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2316
        aClass isMeta ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2317
            (aClass package ~= packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2318
                aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2319
                    "/ methods in this project ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2320
                    (mthd package = packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2321
                        "/ ... whose class is not in the ckechIn-set
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2322
                        extensionMethods add:mthd
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2323
                    ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2324
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2325
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2326
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2327
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2328
    listHere := ChangeSet forExistingMethods:extensionMethods.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2329
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2330
    inChangeSet := listRep contains:[:someChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2331
                            |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2332
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2333
                            someChange isMethodChange ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2334
                                cClass := someChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2335
                                cSel := someChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2336
                                ChangeSet current includesChangeForClass:cClass selector:cSel
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2337
                            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2338
                    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2339
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2340
    diffSet := listHere diffSetsAgainst:listRep.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2341
    changed := diffSet changed.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2342
    onlyHere := diffSet onlyInReceiver.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2343
    onlyInRep := diffSet onlyInArg.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2344
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2345
    labels := #('Cancel' 'Merge' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2346
    values := #(nil #merge #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2347
    default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2348
                    ifTrue:[3. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2349
                    ifFalse:[2. "i.e. merge"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2350
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2351
    msg := 'About to load extensions for ''%5''.\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2352
    onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2353
        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
  2354
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2355
    onlyHere size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2356
        onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2357
            msg := msg , 'And there '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2358
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2359
            msg := msg , 'There '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2360
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2361
        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
  2362
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2363
    changed size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2364
        changed size == 1 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2365
            msg := msg , 'The ''%5''-method is different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2366
            singleChangeSelector := changed first first selector allBold
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2367
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2368
            msg := msg , '%3 methods are different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2369
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2370
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2371
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2372
    onlyHere isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2373
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2374
            (changed isEmpty) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2375
                listRep do:[:eachChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2376
                    eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2377
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2378
                ^ self
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2379
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2380
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2381
                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
  2382
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2383
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2384
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2385
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2386
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2387
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2388
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2389
            changed isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2390
                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
  2391
                labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2392
                values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2393
                default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2394
                                ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2395
                                ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2396
            ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2397
                inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2398
                    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
  2399
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2400
                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
  2401
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2402
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2403
    ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2404
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2405
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2406
                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
  2407
                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
  2408
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2409
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2410
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2411
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2412
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2413
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2414
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2415
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2416
                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
  2417
                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
  2418
            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2419
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2420
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2421
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2422
    msg := msg bindWith:onlyInRep size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2423
               with:onlyHere size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2424
               with:changed size printString
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2425
               with:singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2426
               with:packageToCheckOut allBold.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2427
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2428
    answer := (Dialog confirmWithCancel:msg withCRs
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2429
           labels:(resources array:labels)
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2430
           values:values 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2431
           default:default).
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2432
    answer isNil ifTrue:[^ self].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2433
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2434
    self activityNotification:'updating...'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2435
    changedClasses := IdentitySet new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2436
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2437
"/    Class withoutUpdatingChangesDo:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2438
        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
  2439
                                     Class withoutUpdatingChangeSetDo:[ eachChange apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2440
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2441
                                     eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2442
                                     changedClasses add:eachChange changeClass.   
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2443
                     ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2444
        answer == #load ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2445
            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
  2446
                                         |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2447
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2448
                                         cClass := eachChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2449
                                         cSel := eachChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2450
                                         Class withoutUpdatingChangeSetDo:[ cClass removeSelector:cSel ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2451
                        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2452
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2453
                                         |cHere cRep| 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2454
                                         cHere := eachChangeArr at:1.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2455
                                         cRep := eachChangeArr at:2.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2456
                                         Class withoutUpdatingChangeSetDo:[ cRep apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2457
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2458
                                         cRep changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2459
                                         changedClasses add:cRep changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2460
                       ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2461
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2462
"/    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2463
    changedClasses do:[:eachClass |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2464
         eachClass changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2465
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2466
    Smalltalk changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2467
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2468
    "Modified: / 07-02-2001 / 18:18:32 / ps"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2469
    "Created: / 29-12-2011 / 14:34:12 / cg"
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2470
!
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2471
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2472
compareClassWithRepository:aClass
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2473
    "open a diff-textView comparing the current (in-image) version
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2474
     against its orgiginal version found in the repository."
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2475
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2476
    self compareClassWithRepository:aClass askForRevision:true
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2477
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2478
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2479
      self compareClassWithRepository:Array
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2480
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2481
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2482
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2483
compareClassWithRepository:aClass askForRevision:askForRevision
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2484
    "open a diff-textView comparing the current (in-image) version
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2485
     against the newest or an asked-for version found in the repository."
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2486
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2487
    |classToCompare brwsr comparedSource currentSource rev revString thisRevString 
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2488
     scmManager revisionInClass versionsAreTheSame revInfo revAuthor revDate revLabel |
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2489
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2490
    classToCompare := aClass theNonMetaclass.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2491
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2492
    comparedSource := self 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2493
                        fetchSourceOf:classToCompare askForRevision:askForRevision 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2494
                        into:[:revStringArg :revisionInClassArg :scmManagerArg| 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2495
                            revString := revStringArg.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2496
                            revisionInClass := revisionInClassArg.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2497
                            scmManager := scmManagerArg.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2498
                        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2499
    comparedSource isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2500
        ^ self
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2501
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2502
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2503
"/    classToCompare := aClass theNonMetaclass.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2504
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2505
"/    nm := classToCompare name.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2506
"/    (mgr := manager) isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2507
"/        mgr := self sourceCodeManagerFor:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2508
"/        mgr isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2509
"/            self error:'oops - no sourcecode manager' mayProceed:true.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2510
"/            ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2511
"/        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2512
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2513
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2514
"/    rev := classToCompare revisionInfoOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2515
"/"/    rev := classToCompare binaryRevision.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2516
"/    revisionInClass := classToCompare revisionOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2517
"/    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2518
"/        rev := revisionInClass
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2519
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2520
"/    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2521
"/        (Dialog confirm:'Class seems to be not yet in the repository (or classes revision info is missing or corrupted)\\Proceed ?' withCRs)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2522
"/        ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2523
"/            ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2524
"/        ]
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2525
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2526
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2527
"/    "/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2528
"/    "/ class in repository - ask for revision
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2529
"/    "/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2530
"/    SourceCodeManagerError handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2531
"/        Dialog warn:(resources 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2532
"/                                stringWithCRs:'Could not fetch revision info of "%1".\\Please check your sourcecode manager settings of %2 for package: "%3".\(and possibly the network for reachability of the repository)'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2533
"/                                with:classToCompare name
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2534
"/                                with:classToCompare sourceCodeManager managerTypeName
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2535
"/                                with:classToCompare package).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2536
"/        ^ self.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2537
"/    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2538
"/        newestRev := mgr newestRevisionOf:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2539
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2540
"/    askForRevision ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2541
"/        msg := resources string:'Compare to revision: (empty for newest)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2542
"/        rev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2543
"/            msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2544
"/                                           with:nm allBold with:rev).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2545
"/            (revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2546
"/                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2547
"/                                               with:revisionInClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2548
"/            ]
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2549
"/        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2550
"/        newestRev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2551
"/            msg := msg , '\' , (resources string:'Newest in repository is %1.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2552
"/                                           with:newestRev)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2553
"/        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2554
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2555
"/        rev := self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2556
"/                    askForExistingRevision:msg 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2557
"/                    title:'Compare with repository' 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2558
"/                    class:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2559
"/    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2560
"/        rev := newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2561
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2562
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2563
"/    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2564
"/        mgr = classToCompare sourceCodeManager ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2565
"/            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)'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2566
"/        ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2567
"/            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)'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2568
"/        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2569
"/        Dialog warn:(resources 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2570
"/                                stringWithCRs:msg
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2571
"/                                with:classToCompare name
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2572
"/                                with:mgr managerTypeName
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2573
"/                                with:classToCompare package
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2574
"/                                with:(classToCompare sourceCodeManager managerTypeName)).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2575
"/        ^ self.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2576
"/        
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2577
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2578
"/    rev withoutSpaces isEmpty ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2579
"/        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2580
"/        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2581
"/        aStream := mgr getSourceStreamFor:classToCompare revision:newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2582
"/        revString := '(newest: ' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2583
"/    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2584
"/        msg := 'extracting previous %1'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2585
"/        aStream := mgr getSourceStreamFor:classToCompare revision:rev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2586
"/        revString := rev
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2587
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2588
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2589
"/    aStream isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2590
"/        self warn:'Could not extract source from repository (check repository settings / network)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2591
"/        ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2592
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2593
"/    aStream class readErrorSignal handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2594
"/        self warn:('Read error while reading extracted source\\' , ex description) withCRs.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2595
"/        aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2596
"/        ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2597
"/    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2598
"/        comparedSource := aStream contents asString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2599
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2600
"/    aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2601
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2602
    self activityNotification:'generating current source...'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2603
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2604
    currentSource := self sourceCodeOfClass:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2605
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2606
    self activityNotification:'comparing...'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2607
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2608
    versionsAreTheSame := false.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2609
    "/ a quick smoke test, if code is exactly the same
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2610
    comparedSource = currentSource ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2611
        versionsAreTheSame := true.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2612
    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2613
        "/ this branch generates chunks and compares individual methods.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2614
        "/ this is a litle more expensive, but will deal with reordered methods in the source,
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2615
        "/ additional whitespace, empty lines etc.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2616
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2617
        thisRevString := revisionInClass ? 'no revision'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2618
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2619
        revString = '(newest)' ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2620
            |newestRev|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2621
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2622
            (newestRev := scmManager newestRevisionOf:classToCompare) notNil ifTrue:[
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2623
                revString := '(newest is ' , newestRev , ')'.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2624
                rev := newestRev.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2625
            ]
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2626
        ] ifFalse:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2627
            rev := revString
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2628
        ].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2629
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2630
        revLabel := revString.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2631
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2632
        rev notNil ifTrue:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2633
            revInfo := scmManager revisionLogOf:classToCompare fromRevision:rev toRevision:rev.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2634
            revInfo notNil ifTrue:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2635
                revInfo := (revInfo at:#revisions) first.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2636
                revAuthor := revInfo at:#author ifAbsent:[nil].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2637
                revDate := revInfo at:#date ifAbsent:[nil].
3993
209a7d800ea0 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3992
diff changeset
  2638
                revDate isString ifTrue:[
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2639
                    revDate := Timestamp readFrom:revDate onError:nil.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2640
                ].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2641
                revLabel := revString , ' ('.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2642
                revDate notNil ifTrue:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2643
                    revLabel := revLabel , revDate asDate printString.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2644
                ].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2645
                revLabel := revLabel , ' by ', revAuthor.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2646
                revLabel := revLabel , ')'.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2647
            ].
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2648
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2649
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2650
        self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2651
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2652
        ChangeSet invalidChangeChunkError handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2653
            |answer|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2654
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2655
            answer := Dialog 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2656
                        confirm:(resources 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2657
                            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?'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2658
                            with:aClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2659
                        yesLabel:(resources string:'Debug')
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2660
                        noLabel:(resources string:'Cancel')
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2661
                        initialAnswer:false.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2662
            answer ifTrue:[ex reject].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2663
            AbortOperationRequest raise.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2664
        ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2665
            brwsr := (UserPreferences versionDiffViewerClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2666
                  openOnClass:classToCompare
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2667
                  labelA:('Repository: ' , revLabel)
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2668
                  sourceA:comparedSource
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2669
                  labelB:('Current: (based on: ' , thisRevString , ')')
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2670
                  sourceB:currentSource
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2671
                  title:('Comparing ' , classToCompare name)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2672
                  ifSame:[versionsAreTheSame := true].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2673
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2674
        versionsAreTheSame ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2675
            brwsr classChangeSet 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2676
                classBeingCompared:classToCompare;
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2677
                versionA:revString;
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2678
                versionB:thisRevString , 'mod'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2679
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2680
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2681
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2682
    versionsAreTheSame ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2683
        (classToCompare hasUnsavedChanges) ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2684
            (self confirm:(resources 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2685
                            stringWithCRs:'Versions of %1 are identical.\\Remove entries from changeSet ?'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2686
                            with:classToCompare name allBold)) ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2687
                ChangeSet current condenseChangesForClass:classToCompare.
3579
d175474155c8 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  2688
            ].
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2689
        ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2690
            self information:'Versions are identical.'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2691
            ChangeSet current unrememberChangedClasses.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2692
        ].
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2693
        revisionInClass isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2694
            (Dialog confirm:'Update (Fix) the classes Revision Info ?' withCRs)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2695
            ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2696
                |newString root|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2697
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2698
                newString := scmManager updatedRevisionStringOf:aClass forRevision:rev with:aClass revisionString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2699
                newString isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2700
                    root := scmManager getCVSROOTForModule:(aClass package upTo:$:).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2701
                    root := scmManager repositoryTopDirectoryFromCVSRoot:root.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2702
                    newString := '$', 'Header: ',(root copyReplaceAll: $: with:$/ ),'/'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2703
                                 ,(Smalltalk fileNameForClass:aClass),'.st,v ',rev,' '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2704
                                 ,(Date today printStringFormat:'%y-%m-%d'),' '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2705
                                 ,(Time now printStringFormat:'%h:%m:%s'),' '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2706
                                 ,'+0000 '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2707
                                 ,(OperatingSystem getLoginName),' Exp $'.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2708
                ].
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2709
                scmManager updateVersionMethodOf:aClass for:newString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2710
            ]
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2711
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2712
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2713
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2714
    "
997
c55b39b6c7a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2715
      self compareClassWithRepository:Array
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2716
    "
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2717
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2718
    "Modified: / 24-07-2012 / 18:11:27 / cg"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2719
!
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2720
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2721
comparePackages:packages askForRevision:askForRevision
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2722
    "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
  2723
     and opens a diff browser on differences.
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2724
     
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2725
     If `askForRevision` is true, then user is asked to specify to which revision to
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2726
     update. If `askForRevision` is false, then packages are updated to a 'newest'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2727
     revision.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2728
     
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2729
     NOTE: Definition of `newest` revision may vary. For SCMs which allows for multiple
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2730
     heads, it is not clear which one it is. In that case, even if `askForRevision` is
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2731
     false, this method may result in user interaction, asking user to select which of the
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2732
     newest she wants."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2733
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2734
    self comparePackages:packages askForRevision:askForRevision extensionsOnly:false
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2735
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2736
    "Created: / 04-04-2014 / 15:29:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2737
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2738
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2739
comparePackages:packages askForRevision:askForRevision extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2740
    "Compares code of given packages (loaded in the image) against a specific revision
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2741
     and opens a diff browser on differences.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2742
     
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2743
     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
  2744
     update. If `askForRevision` is false, then packages are updated to a 'newest'
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2745
     revision.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2746
     
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2747
     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
  2748
     heads, it is not clear which one it is. In that case, even if `askForRevision` is
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2749
     false, this method may result in user interaction, asking user to select which of the
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2750
     newest she wants."
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2751
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2752
    |string dateOrNil symbolicNameOrNil knownTags includeSubProjectsHolder
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2753
     packagesIn packagesCompared|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2754
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2755
    packagesIn := packages value.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2756
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2757
    knownTags := self knownTagsInPackages:packagesIn.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2758
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2759
    includeSubProjectsHolder := true asValue.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2760
    string := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2761
                askForPackageVersion:'Compare with version from date (%1) or tag (any other format) (empty for newest):'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2762
                with:includeSubProjectsHolder 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2763
                knownTags:knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2764
                into:[:dateOrNilArg :symbolicNameOrNilArg |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2765
                    dateOrNil := dateOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2766
                    symbolicNameOrNil := symbolicNameOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2767
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2768
                    LastComparedTag := symbolicNameOrNil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2769
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2770
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2771
    string isNil ifTrue:[^ self].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2772
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2773
    packagesCompared := packagesIn.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2774
    includeSubProjectsHolder value ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2775
        packagesCompared := Smalltalk allPackageIDs
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2776
                        select:[:eachPackage |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2777
                            packagesIn contains:[:p | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2778
                                eachPackage = p 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2779
                                or:[ (eachPackage startsWith:(p,'-'))
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2780
                                or:[ (eachPackage startsWith:(p,':')) ]]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2781
                            ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2782
                        ]    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2783
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2784
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2785
    packagesCompared value do:[:eachProject |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2786
        dateOrNil notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2787
            self compareProject:eachProject withRepositoryVersionFrom:dateOrNil extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2788
        ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2789
            self compareProject:eachProject withRepositoryVersionTaggedAs:symbolicNameOrNil extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2790
        ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2791
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2792
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2793
    "Created: / 04-04-2014 / 15:29:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2794
    "Modified: / 05-02-2017 / 04:24:39 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2795
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2796
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2797
compareProject:aProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2798
        repositoryVersionFrom:dateOrNilV1 orTag:symbolicNameOrNilV1 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2799
        againstRepositoryVersionFrom:dateOrNilV2 orTag:symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2800
        extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2801
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2802
    |diffSet|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2803
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2804
    diffSet := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2805
                    diffSetOfProject:aProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2806
                    repositoryVersionFrom:dateOrNilV1 orTag:symbolicNameOrNilV1
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2807
                    againstRepositoryVersionFrom:dateOrNilV2 orTag:symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2808
                    extensionsOnly:extensionsOnly.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2809
    VersionDiffBrowser 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2810
        openOnDiffSet:diffSet 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2811
        labelA:(dateOrNilV1 ? symbolicNameOrNilV1) 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2812
        labelB:(dateOrNilV2 ? symbolicNameOrNilV2) 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2813
        title:('Differences of %1' bindWith:aProject)
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2814
        ignoreExtensions:true
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2815
        ignoreVersionMethods:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2816
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2817
    "Created: / 05-02-2017 / 04:21:15 / cg"
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2818
!
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2819
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2820
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2821
    ^ self compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2822
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2823
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2824
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2825
    |diffSet|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2826
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2827
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly.
1875
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2828
    VersionDiffBrowser 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2829
        openOnDiffSet:diffSet 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2830
        labelA:'Repository' 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2831
        labelB:'Image' 
2522
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  2832
        title:('Differences of %1' bindWith:aProject)
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2833
        ignoreExtensions:true
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2834
        ignoreVersionMethods:true.
2522
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  2835
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  2836
    "Modified: / 12-09-2011 / 11:56:01 / cg"
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2837
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2838
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2839
compareProject:aProject withRepositoryVersionTaggedAs:aSymbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2840
    |diffSet|
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2841
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2842
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionTaggedAs:aSymbolicName.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2843
    VersionDiffBrowser 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2844
        openOnDiffSet:diffSet 
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2845
        labelA:'Repository ("',(aSymbolicName?'newest'),'")' 
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2846
        labelB:'Image' 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2847
        title:('Differences of %1' bindWith:aProject)
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2848
        ignoreExtensions:true
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2849
        ignoreVersionMethods:true.
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2850
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2851
    "Modified: / 12-09-2011 / 11:56:01 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2852
    "Modified (format): / 04-02-2017 / 18:54:02 / cg"
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2853
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  2854
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2855
compareProject:aProject withRepositoryVersionTaggedAs:aTagOrNil extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2856
    "if aTagOrNil is nil, compare against the newest version in the repositry"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2857
    
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2858
    |diffSet|
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2859
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2860
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionTaggedAs:aTagOrNil extensionsOnly:extensionsOnly.
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2861
    VersionDiffBrowser 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2862
        openOnDiffSet:diffSet 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2863
        labelA:'Repository' 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2864
        labelB:'Image' 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2865
        title:('Differences of %1' bindWith:aProject)
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2866
        ignoreExtensions:true
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2867
        ignoreVersionMethods:true.
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2868
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2869
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2870
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2871
     CVSSourceCodeManager utilities
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2872
            compareProject:'stx:libbasic2'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2873
            withRepositoryVersionTaggedAs:nil 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2874
            extensionsOnly:false.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2875
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2876
     CVSSourceCodeManager utilities
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2877
            compareProject:'stx:libbasic2'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2878
            withRepositoryVersionTaggedAs:'expecco_2_10_0' 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2879
            extensionsOnly:false.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2880
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2881
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2882
    "Created: / 12-11-2016 / 03:39:48 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2883
    "Modified (comment): / 04-02-2017 / 18:46:49 / cg"
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2884
!
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  2885
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2886
compareProjectWithRepository:aProject
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2887
    ^ self compareProject:aProject withRepositoryVersionFrom:nil
1875
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2888
!
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2889
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2890
compareTwoPackageVersions:packages
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2891
    "Compares two versions of given packages."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2892
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2893
    self compareTwoPackageVersions:packages extensionsOnly:false
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2894
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2895
    "Created: / 04-02-2017 / 17:33:02 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2896
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2897
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2898
compareTwoPackageVersions:packagesIn extensionsOnly:extensionsOnly 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2899
    "Compares two versions of given packages
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2900
     and opens a diff browser on differences."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2901
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2902
    |string includeSubProjectsHolder knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2903
     dateOrNilV1 dateOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2904
     symbolicNameOrNilV1 symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2905
     packagesCompared|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2906
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2907
    knownTags := self knownTagsInPackages:packagesIn first.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2908
    includeSubProjectsHolder := true asValue.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2909
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2910
    string := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2911
                askForPackageVersion:'First version''s date (%1) or tag (any other format):'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2912
                with:includeSubProjectsHolder 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2913
                knownTags:knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2914
                into:[:dateOrNilArg :symbolicNameOrNilArg |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2915
                    dateOrNilV1 := dateOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2916
                    symbolicNameOrNilV1 := symbolicNameOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2917
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2918
    string isNil ifTrue:[^ self].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2919
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2920
    string := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2921
                askForPackageVersion:'Second version''s date (%1) or tag (any other format):'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2922
                with:nil 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2923
                knownTags:knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2924
                into:[:dateOrNilArg :symbolicNameOrNilArg |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2925
                    dateOrNilV2 := dateOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2926
                    symbolicNameOrNilV2 := symbolicNameOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2927
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2928
    string isNil ifTrue:[^ self].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2929
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2930
    LastComparedTag := symbolicNameOrNilV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2931
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2932
    packagesCompared := packagesIn.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2933
    includeSubProjectsHolder value ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2934
        packagesCompared := 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2935
            Smalltalk allPackageIDs
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2936
                select:[:eachPackage |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2937
                    packagesIn contains:[:p | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2938
                        eachPackage = p 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2939
                        or:[ (eachPackage startsWith:(p,'-'))
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2940
                        or:[ (eachPackage startsWith:(p,':')) ]]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2941
                    ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2942
                ]    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2943
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2944
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2945
    packagesCompared value do:[:eachProject |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2946
        self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2947
            compareProject:eachProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2948
            repositoryVersionFrom:dateOrNilV1 orTag:symbolicNameOrNilV1 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2949
            againstRepositoryVersionFrom:dateOrNilV2 orTag:symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2950
            extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2951
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2952
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2953
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2954
     CVSSourceCodeManager utilities
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2955
        compareTwoPackageVersions:#('stx:libbasic') extensionsOnly:true   
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2956
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2957
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2958
    "Created: / 04-02-2017 / 17:51:09 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2959
    "Modified: / 05-02-2017 / 04:23:07 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2960
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2961
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2962
createSourceContainerForClass:aClass
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2963
    "let user specify the source-repository values for aClass.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2964
     Return false, if failed."
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2965
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2966
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2967
        createSourceContainerForClass:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2968
        usingManager:(self sourceCodeManagerFor:aClass).
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2969
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2970
    "Modified: / 21-12-2011 / 18:31:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2971
!
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2972
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2973
createSourceContainerForClass:aClass usingManager:aManager
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2974
    "let user specify the source-repository values for aClass.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2975
     Return false, if failed."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2976
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2977
    ^ self
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2978
        createSourceContainerForClass:aClass usingManager:aManager
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2979
        confirmNewContainer:confirmNewFiles   
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2980
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2981
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2982
createSourceContainerForClass:aClass usingManager:aManager confirmNewContainer:confirmNewContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2983
    "let user specify the source-repository values for aClass.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2984
     Return false, if failed."
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2985
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2986
    aManager isNil ifTrue:[^ false].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2987
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2988
    ^ self 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2989
        defineSourceContainerForClass:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2990
        usingManager:aManager
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2991
        title:(resources string:'Repository information for %1' with:aClass name)
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2992
        text:(resources string:'Create new %1-repository container for ''%2''' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2993
                            with:aManager managerTypeName
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2994
                            with:aClass name allBold)
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  2995
        createDirectories:true
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2996
        createContainer:true
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  2997
        confirmNewContainer:confirmNewContainer.
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2998
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  2999
    "Created: / 21-12-2011 / 18:31:23 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3000
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3001
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3002
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
  3003
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3004
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3005
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3006
        defineSourceContainerForClass:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3007
        usingManager:(self sourceCodeManagerFor:aClass)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3008
        title:title 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3009
        text:boxText 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3010
        createDirectories:createDirs 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3011
        createContainer:createContainer
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3012
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3013
    "Modified: / 21-12-2011 / 18:34:44 / cg"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3014
!
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3015
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3016
defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText createDirectories:createDirs createContainer:createContainer
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3017
    "let user specify the source-repository values for aClass"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3018
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3019
    ^ self
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3020
        defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3021
        createDirectories:createDirs createContainer:createContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3022
        confirmNewContainer:confirmNewFiles
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3023
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3024
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3025
defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3026
    createDirectories:createDirs createContainer:createContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3027
    confirmNewContainer:confirmNewContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3028
    "let user specify the source-repository values for aClass"
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3029
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3030
    |className
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3031
     "oldModule oldPackage" oldFileName
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3032
     module directory fileName nameSpace nameSpacePrefix
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3033
     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
  3034
     answer doCheckinWithoutAsking forceCheckIn rslt note
3276
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3035
     requiredPackage classPackage|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3036
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3037
    mgr isNil ifTrue:[^  false].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3038
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3039
    aClass isLoaded ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3040
        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
  3041
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3042
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3043
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3044
    className := aClass name.
3276
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3045
    classPackage := aClass package.
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3046
    classPackage ~= PackageId noProjectID ifTrue:[
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3047
        module := classPackage asPackageId module.
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3048
        directory := classPackage asPackageId directory.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3049
    ] ifFalse:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3050
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3051
        "/ defaults, if nothing at all is known
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3052
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3053
        (module := LastModule) isNil ifTrue:[
3919
1373d06bbd50 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3906
diff changeset
  3054
            module := (UserPreferences current usersModuleName "OperatingSystem getLoginName").
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3055
        ].
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3056
        (directory := LastPackage) isNil ifTrue:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3057
            directory := 'private'.
3153
c2bca6dbe3a7 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3146
diff changeset
  3058
        ]. 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3059
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3060
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3061
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3062
    "/ 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
  3063
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3064
    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3065
        directory isNil ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3066
            (nm := project repositoryDirectory) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3067
                nm := project name
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3068
            ].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3069
            directory := nm.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3070
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3071
        module isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3072
            (nm := project repositoryModule) notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3073
                module := nm
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3074
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3075
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3076
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3077
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3078
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3079
    "/ 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
  3080
    "/ if so, take that as a default.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3081
    "/
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  3082
    info := mgr sourceInfoOfClass:aClass.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3083
    info notNil ifTrue:[
1368
20cde03a3cd6 defineSource - fixed package & module extraction
martin
parents: 1347
diff changeset
  3084
        true "module ~= LastModule" ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3085
            (info includesKey:#module) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3086
                module := (info at:#module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3087
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3088
        ].
1401
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3089
"/        true "package ~= LastPackage" ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3090
"/            (info includesKey:#directory) ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3091
"/                package := (info at:#directory).
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3092
"/            ].
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3093
"/        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3094
        fileName := mgr containerFromSourceInfo:info.
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  3095
        fileName isNil ifTrue:[ fileName := aClass classFilename ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3096
        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3097
            nameSpacePrefix := nameSpace name , '::'.
3259
5eb58e78257e refactored
Claus Gittinger <cg@exept.de>
parents: 3227
diff changeset
  3098
            fileName := fileName withoutPrefix:nameSpacePrefix.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3099
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3100
"/        (info includesKey:#fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3101
"/            fileName := (info at:#fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3102
"/        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3103
"/            (info includesKey:#expectedFileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3104
"/                fileName := (info at:#expectedFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3105
"/            ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3106
"/                (info includesKey:#classFileNameBase) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3107
"/                    fileName := (info at:#classFileNameBase) , '.st'.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3108
"/                ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3109
"/            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3110
"/        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3111
    ].
4058
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3112
    directory isNil ifTrue:[
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3113
        Dialog information:('Using %1 as last package-folder' bindWith:LastPackage).
3514
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3114
        directory := LastPackage.
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3115
    ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3116
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3117
    fileName isNil ifTrue:[
1338
bad5961fbff1 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 1323
diff changeset
  3118
        fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3119
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3120
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3121
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3122
        module replaceAll:$\ with:$/.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3123
        directory replaceAll:$\ with:$/.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3124
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3125
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3126
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3127
    "/ 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
  3128
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3129
    doCheckinWithoutAsking := false.
1831
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3130
"/false ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3131
"/    (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
  3132
"/        answer := Dialog confirmWithCancel:(resources 
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3133
"/                            string:'About to change the source container.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3134
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3135
"/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
  3136
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3137
"/    %2 / %3 / %4
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3138
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3139
"/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
  3140
"/                            with:className
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3141
"/                            with:module
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3142
"/                            with:directory
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3143
"/                            with:fileName)
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3144
"/                labels:(resources array:#('Cancel' 'Check in' 'Change')).
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  3145
"/        answer isNil ifTrue:[AbortOperationRequest raise].
1831
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3146
"/        answer ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3147
"/            doCheckinWithoutAsking := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3148
"/            oldModule := module.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3149
"/            oldPackage := directory.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3150
"/            oldFileName := fileName
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3151
"/        ] ifFalse:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3152
"/            doCheckinWithoutAsking := true.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3153
"/            creatingNew := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3154
"/        ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3155
"/    ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3156
"/].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3157
    mgr isContainerBased ifTrue:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3158
        doCheckinWithoutAsking ifFalse:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3159
            "/
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3160
            "/ open a dialog for this
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3161
            "/
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3162
            (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
  3163
                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
  3164
                creatingNew := true.
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3165
            ] ifTrue:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3166
                creatingNew := false.
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3167
            ].
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3168
            confirmNewContainer ifTrue:[
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3169
                rslt := self 
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3170
                            askForContainer:boxText title:title note:note
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3171
                            initialModule:module initialPackage:directory initialFileName:fileName
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3172
                            forNewContainer:true.        
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3173
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3174
                rslt isNil ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3175
                    ^ false
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3176
                ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3177
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3178
                module := rslt at:#module.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3179
                directory := rslt at:#package.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3180
                fileName := rslt at:#fileName.
4058
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3181
                (module isEmptyOrNil or:[fileName isEmptyOrNil]) ifTrue:[
3514
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3182
                    ^ false
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3183
                ].
4058
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3184
                (directory isEmptyOrNil) ifTrue:[
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3185
                    "/ only one special case allowed - the module-folder description itself.
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3186
                    aClass name = module ifFalse:[^ false].
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3187
                ]
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3188
            ]
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3189
        ].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3190
        (fileName endsWith:',v') ifTrue:[
3227
bcaec3eb2d97 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3202
diff changeset
  3191
            fileName := fileName copyButLast:2
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3192
        ].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3193
        (fileName endsWith:'.st') ifFalse:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3194
            fileName := fileName , '.st'
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3195
        ].
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3196
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3197
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3198
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3199
    "/ 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
  3200
    "/ check for this ...
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3201
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3202
    requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol.
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3203
    requiredPackage ~= aClass package ifTrue:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3204
"/        doCheckinWithoutAsking ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3205
"/            (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
  3206
"/            ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3207
"/                ^ false
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3208
"/            ]
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3209
"/        ].
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  3210
        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
  3211
        aClass package:requiredPackage.
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3212
    ].
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3213
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3214
    info := aClass revisionInfo.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3215
    info notNil ifTrue:[
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3216
        (info repositoryPathName isNil) ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3217
            info := nil
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3218
        ].
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3219
"/        (info includesKey:#repositoryPathName) ifFalse:[
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3220
"/            info := nil
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3221
"/        ]
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3222
    ].
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  3223
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3224
    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
  3225
        true "doCheckinWithoutAsking" ifFalse:[
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3226
            answer := Dialog 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3227
                 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
  3228
                 labels:(resources array:#( 'Cancel' 'No' 'Yes')).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3229
            answer isNil ifTrue:[^ false].
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3230
        ] ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3231
            answer := true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3232
        ].
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3233
        answer ifTrue:[
2637
dbfb2ef410bd changed:
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  3234
            mgr
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3235
                updateVersionMethodOf:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3236
                for:(mgr initialRevisionStringFor:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3237
                         inModule:module 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3238
                         directory:directory 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3239
                         container:fileName).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3240
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3241
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3242
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3243
    (self checkForExistingModule:module usingManager:mgr allowCreate:(createDirs or:[creatingNew]))
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3244
        ifFalse:[^ false].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3245
    LastModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3246
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3247
    (self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:(createDirs or:[creatingNew]))
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3248
        ifFalse:[^ false].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3249
    LastPackage := directory.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3250
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3251
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3252
    "/ check for the container itself
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3253
    "/
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3254
    (mgr isContainerBased not
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3255
    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
  3256
"/            (oldModule notNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3257
"/            and:[(oldModule ~= module)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3258
"/                 or:[oldPackage ~= package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3259
"/                 or:[oldFileName ~= fileName]]])
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3260
"/            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3261
"/                self warn:(resources string:'no change').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3262
"/                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3263
"/            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3264
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3265
        mgr isContainerBased ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3266
            creatingNew ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3267
                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
  3268
            ].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3269
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3270
            doCheckinWithoutAsking ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3271
                (Dialog 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3272
                    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
  3273
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3274
    %2 / %3 / %4  ?'
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3275
                                    with:className
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3276
                                    with:module 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3277
                                    with:directory 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3278
                                    with:fileName) withCRs
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3279
                    noLabel:'Cancel') 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3280
                ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3281
                    ^ false.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3282
                ].  
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3283
            ].  
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3284
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3285
2637
dbfb2ef410bd changed:
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  3286
        mgr 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3287
            updateVersionMethodOf:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3288
            for:('$' , 'Header' , '$'). "/ concatenated to avoid RCS-expansion
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3289
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3290
        oldFileName notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3291
            msg := ('forced checkin / source container change from ' , oldFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3292
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3293
            msg := 'defined source container'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3294
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3295
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3296
        (forceCheckIn := doCheckinWithoutAsking) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3297
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3298
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3299
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3300
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3301
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3302
                logMessage:msg)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3303
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3304
                doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3305
                    (Dialog 
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3306
                        confirm:'No easy merge seems possible; force checkin (no merge) ?'
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3307
                        noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3308
                    ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3309
                        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3310
                    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3311
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3312
                forceCheckIn := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3313
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3314
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3315
        forceCheckIn ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3316
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3317
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3318
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3319
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3320
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3321
                logMessage:msg
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3322
                force:true)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3323
            ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3324
                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
  3325
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3326
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3327
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3328
        ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3329
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3330
        (createContainer or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3331
            (Dialog
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3332
                 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
  3333
                                      with:fileName with:module with:directory) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3334
                 noLabel:'Cancel') ifFalse:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3335
                ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3336
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3337
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3338
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3339
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3340
    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
  3341
    aClass package:requiredPackage.
1913
d87c1ed5bf1f oops - halt
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3342
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3343
    [ mgr
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3344
        createContainerFor:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3345
        inModule:module
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3346
        package:directory
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3347
        container:fileName
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3348
    ] whileFalse:[
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3349
        (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
  3350
            ^ false.
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3351
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3352
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3353
    ^ true
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3354
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3355
    "Created: / 21-12-2011 / 18:34:02 / cg"
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  3356
    "Modified: / 30-04-2016 / 11:58:11 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3357
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3358
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3359
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3360
    ^ self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3361
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3362
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3363
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3364
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3365
        diffSetOfProject:aProject 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3366
        againstRepositoryVersionFrom:aDateOrNilForNewest
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3367
        orTag:nil
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3368
        extensionsOnly:extensionsOnly
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3369
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3370
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3371
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest orTag:aTagOrNil
2950
cd6dc0f1d994 comment/format in: #diffSetOfProject:againstRepositoryVersionFrom:orTag:
Claus Gittinger <cg@exept.de>
parents: 2949
diff changeset
  3372
    "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
  3373
     or a the version with a particular tag."
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3374
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3375
    ^ self
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3376
        diffSetOfProject:aProject 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3377
        againstRepositoryVersionFrom:aDateOrNilForNewest 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3378
        orTag:aTagOrNil 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3379
        extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3380
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3381
    "Modified: / 01-11-2010 / 21:02:52 / cg"
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3382
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3383
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3384
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest orTag:aTagOrNil extensionsOnly:extensionsOnly
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3385
    "return a diffset against the version at a particular date (if not nil),
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3386
     or a the version with a particular tag (if not nil),
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3387
     or the newest (head) (if both are nil)."
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3388
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3389
    |classesInImage filesInImage module directory perProjectInfo 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3390
     classesNotInRepository filesNotInImage classesDeletedInRepository
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3391
     classesModifiedInImage classesNotReallyModified classesReallyModified classesNewerInRepository 
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3392
     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
  3393
     box doCleanup diffSet def autoloadedFilesNotInImage 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3394
     autoloadedClassesInImage autoloadedFilesInImage versionMethodsAndDoitsRejected|
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3395
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3396
    module := aProject asPackageId module.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3397
    directory := aProject asPackageId directory.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3398
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3399
    (aDateOrNilForNewest isNil and:[ aTagOrNil notNil ]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3400
        perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aTagOrNil.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3401
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3402
        perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilForNewest.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3403
    ].
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3404
    perProjectInfo := perProjectInfo ? #().
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3405
    perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3406
    perProjectInfo := Dictionary withAssociations:perProjectInfo.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3407
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3408
    "/ to ignore version_xxx methods
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3409
    versionMethodsAndDoitsRejected := 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3410
        [:aChangeSet | 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3411
            aChangeSet reject:[:chg | 
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  3412
                false "chg isMethodChangeForVersionMethod" 
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  3413
                or:[false "chg isMethodChangeForExtensionsVersionMethod"
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3414
                or:[chg isDoIt]]]
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3415
        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3416
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3417
    classesInImage := Smalltalk allClassesInPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3418
    autoloadedClassesInImage := classesInImage reject:[:cls | cls isLoaded].
2903
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  3419
    classesInImage := classesInImage select:[:cls | cls isLoaded and:[cls isPrivate not]].
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  3420
    filesInImage := classesInImage collect:[:cls | cls classBaseFilename] as:Set.
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  3421
    autoloadedFilesInImage := autoloadedClassesInImage collect:[:cls | cls classBaseFilename] as:Set.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3422
    "/ any differences ?
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3423
    classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3424
    classesDeletedInRepository := classesInImage select:[:cls | (perProjectInfo at:cls classBaseFilename ifAbsent:nil) == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3425
    perProjectInfo := perProjectInfo reject:[:v | v == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3426
    filesNotInImage := perProjectInfo keys reject:[:file | (filesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3427
    filesNotInImage := filesNotInImage reject:[:file | (autoloadedFilesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3428
    filesNotInImage remove:'extensions.st' ifAbsent:[].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3429
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3430
    "/ if comparing against the newest, only look for chaged stuff
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3431
    classesModifiedInImage := classesInImage select:[:cls | ChangeSet current includesChangeForClassOrMetaclass:cls].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3432
    classesModifiedInImage := classesModifiedInImage \ classesNotInRepository.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3433
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3434
    classesNewerInRepository := classesInImage 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3435
                                    select:[:cls | 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3436
                                        |v clsRevision|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3437
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3438
                                        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
  3439
                                        v notNil 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3440
                                            and:[ cls isLoaded 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3441
                                            and:[ (clsRevision := cls revision) notNil 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3442
                                            and:[ v > clsRevision ]]]
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3443
                                    ].
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3444
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3445
    "/ stupid: as we do not have any revision information for extensions (sigh);
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3446
    "/ 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
  3447
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3448
    extensionMethods := Smalltalk allExtensionsForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3449
    extensionsInImage := ChangeSet forExistingMethods:extensionMethods.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3450
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3451
    [
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3452
        |s extensionsRevision|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3453
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3454
        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
  3455
        [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3456
            s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3457
                    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
  3458
                    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
  3459
            s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3460
                extensionsInRepository := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3461
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3462
        ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3463
            s notNil ifTrue:[s close]
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3464
        ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3465
        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
  3466
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3467
        "/ 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
  3468
        extensionsInRepository := versionMethodsAndDoitsRejected value:extensionsInRepository.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3469
    ] value.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3470
    extensionDiffs := extensionsInRepository diffSetsAgainst:extensionsInImage.
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3471
    extensionsOnly ifTrue:[
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3472
        ^ extensionDiffs
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3473
    ].
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3474
    
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3475
    diffSet := extensionDiffs copy.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3476
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3477
    (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
  3478
        "/ we could do the same as below for each class.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3479
        "/ however - as we do have change-info and revision info, we can avoid checking out
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3480
        "/ for all classes which are not changed and which have the same version info.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3481
        classesModifiedInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3482
            classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3483
                classesModifiedInImage select:[:eachChangedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3484
                    |currentVersion repositoryVersion s stFile diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3485
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3486
                    stFile := eachChangedClass classBaseFilename.
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3487
                    [    
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3488
                        s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3489
                                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
  3490
                                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
  3491
                        s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3492
                            repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3493
                        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3494
                    ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3495
                        s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3496
                    ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3497
                    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
  3498
                    repositoryVersion := versionMethodsAndDoitsRejected value:repositoryVersion.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3499
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3500
                    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
  3501
                    currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3502
                    diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3503
                    diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3504
                    diffs notEmpty
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3505
                ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3506
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3507
            classesNotReallyModified := classesModifiedInImage \ classesReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3508
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3509
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3510
        classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3511
            classesInImage select:[:eachClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3512
                |currentVersion repositoryVersion s stFile stRevision diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3513
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3514
                stFile := eachClass classBaseFilename.
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3515
                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
  3516
                stRevision notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3517
                    [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3518
                        s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3519
                                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
  3520
                                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
  3521
                        s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3522
                            repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3523
                        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3524
                    ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3525
                        s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3526
                    ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3527
                ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3528
                repositoryVersion isNil ifTrue:[
2295
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  3529
                    repositoryVersion := ChangeSet new.
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  3530
                ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3531
                repositoryVersion := versionMethodsAndDoitsRejected value:repositoryVersion.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3532
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3533
                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
  3534
                currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3535
                diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3536
                diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3537
                diffs notEmpty
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3538
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3539
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3540
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3541
    filesNotInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3542
        "/ first, check if these are autoloaded classes which have NOT been installed
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3543
        "/ (for example, due to a --quick argument during startup)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3544
        autoloadedFilesNotInImage := OrderedCollection new.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3545
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3546
        def := ProjectDefinition definitionClassForPackage:aProject createIfAbsent:false projectType:nil.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3547
        def notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3548
            def classNamesAndAttributesDo:[:eachClassname :eachAttributes | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3549
                |cls eachFileName isAutoload|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3550
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3551
                cls := Smalltalk classNamed:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3552
                cls isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3553
                    isAutoload := eachAttributes includes:#autoload.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3554
                    isAutoload ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3555
                        eachFileName := Smalltalk fileNameForClass:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3556
                        autoloadedFilesNotInImage add:(eachFileName , '.st')
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3557
                    ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3558
                ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3559
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3560
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3561
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3562
        (filesNotInImage \ autoloadedFilesNotInImage) do:[:eachSTFile |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3563
            |s chgSet classDefinitions|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3564
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3565
            [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3566
                s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3567
                        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
  3568
                s isNil ifTrue:[
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3569
                    chgSet := ChangeSet new
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3570
                ] ifFalse:[
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3571
                    chgSet := ChangeSet fromStream:s.
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3572
                ]
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3573
            ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3574
                s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3575
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3576
            chgSet := versionMethodsAndDoitsRejected value:chgSet.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3577
            diffSet onlyInReceiver addAll:chgSet
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3578
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3579
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3580
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3581
    classesNewerInRepository notEmpty ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3582
        classesNewerInRepository do:[:eachClass|
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3583
            |s diffs repositoryVersion currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3584
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3585
            [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3586
                s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3587
                        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
  3588
                repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3589
            ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3590
                s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3591
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3592
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3593
            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
  3594
            currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3595
            diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3596
            diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3597
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3598
    ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3599
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3600
    classesDeletedInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3601
"/ self halt.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3602
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3603
    classesNotInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3604
        "/ if there are no changeSet entries for those classes, they seem to be
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3605
        "/ no longer in the repository (possibly moved ?)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3606
        "/ 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
  3607
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3608
        classesAddedInImage := classesNotInRepository \ classesDeletedInRepository.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3609
        classesAddedInImage do:[:eachAddedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3610
            |currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3611
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3612
            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
  3613
            currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3614
            diffSet onlyInArg addAll:currentVersion.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3615
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3616
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3617
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3618
    diffSet isEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3619
        "/ Dialog information:(resources string:'%1 is up-to-date.' with:eachProject allBold).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3620
        Transcript showCR:('%1 is up-to-date.' bindWith:aProject allBold).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3621
        (ChangeSet current includesChangeForPackage:aProject) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3622
            (Dialog confirm:('%1 is up-to-date.\\Cleanup ChangeSet ?' bindWith:aProject allBold) withCRs) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3623
                ChangeSet current condenseChangesForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3624
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3625
        ].
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3626
        ^ diffSet.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3627
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3628
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  3629
    diffSet sortByClassName.
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  3630
    
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3631
    "/ 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
  3632
    "/ give user a chance to cleanup the changeSet here.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3633
    aDateOrNilForNewest isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3634
        classesNotReallyModified notEmptyOrNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3635
            doCleanup := false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3636
            box := Dialog
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3637
                forRequestText:(resources 
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3638
                                    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
  3639
                                    with:aProject allBold) 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3640
                editViewClass:ListView
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3641
                lines:10 columns:20 
3199
830195868b71 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  3642
                initialAnswer:nil 
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3643
                setupWith:
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3644
                   [:v :d | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3645
                            |removeButton|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3646
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3647
                            v list:classesNotReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3648
                            removeButton := Button label:(resources string:'Cleanup ChangeSet').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3649
                            removeButton action:[ doCleanup := true. box okPressed. ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3650
                            d addButton:removeButton after:(d okButton).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3651
                            d okButton label:(resources string:'Continue').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3652
                            d okButton isReturnButton:false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3653
                            removeButton isReturnButton:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3654
                   ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3655
            box open.
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3656
            box accepted ifTrue:[
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3657
                doCleanup ifTrue:[
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3658
                    classesNotReallyModified do:[:class |
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3659
                        ChangeSet current condenseChangesForClass:class.
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3660
                    ]
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3661
                ].
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3662
            ]
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3663
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3664
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3665
    ^ diffSet
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3666
2295
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  3667
    "Modified: / 01-11-2010 / 21:02:52 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3668
    "Modified (comment): / 04-02-2017 / 18:49:12 / cg"
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3669
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3670
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3671
diffSetOfProject:aProject againstRepositoryVersionTaggedAs:symbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3672
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3673
        diffSetOfProject:aProject 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3674
        againstRepositoryVersionFrom:nil
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3675
        orTag:symbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3676
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3677
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3678
diffSetOfProject:aProject againstRepositoryVersionTaggedAs:aTag extensionsOnly:extensionsOnly
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3679
    ^ self
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3680
        diffSetOfProject:aProject 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3681
        againstRepositoryVersionFrom:nil
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3682
        orTag:aTag
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3683
        extensionsOnly:extensionsOnly
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3684
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3685
    "Created: / 12-11-2016 / 03:41:23 / cg"
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3686
!
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3687
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3688
diffSetOfProject:aProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3689
    repositoryVersionFrom:aDateOrNilV1 orTag:aTagOrNilV1
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3690
    againstRepositoryVersionFrom:aDateOrNilV2 orTag:aTagOrNilV2 extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3691
    "return a diffset of two repository versions,
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3692
     each specified by either a version at a particular date,
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3693
     or a the version with a particular tag."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3694
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3695
    |"classesInImage filesInImage" module directory 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3696
     perProjectInfoV1 perProjectInfoV2 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3697
     filesInRepositoryV1 filesInRepositoryV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3698
     filesAddedInV2 filesDeletedInV2 filesModified filesReallyModified
4204
5291c8e8c732 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  3699
     unchanged "filesNotInImage" "classesAddedInImage extensionMethods"  
5291c8e8c732 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  3700
     extensionsInRepositoryV1 extensionsInRepositoryV2 extensionDiffs diffSet "autoloadedClassesInImage autoloadedFilesInImage" versionMethodsAndDoitsRejected|
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3701
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3702
    module := aProject asPackageId module.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3703
    directory := aProject asPackageId directory.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3704
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3705
    (aDateOrNilV1 isNil and:[ aTagOrNilV1 isNil ]) ifTrue:[ self error:'must specify either date or tag'].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3706
    (aDateOrNilV2 isNil and:[ aTagOrNilV2 isNil ]) ifTrue:[ self error:'must specify either date or tag'].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3707
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3708
    aDateOrNilV1 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3709
        perProjectInfoV1 := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aTagOrNilV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3710
    ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3711
        perProjectInfoV1 := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3712
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3713
    perProjectInfoV1 := perProjectInfoV1 ? #().
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3714
    perProjectInfoV1 := perProjectInfoV1 select:[:info | info key asFilename hasSuffix:'st'].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3715
    perProjectInfoV1 := Dictionary withAssociations:perProjectInfoV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3716
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3717
    aDateOrNilV2 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3718
        perProjectInfoV2 := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aTagOrNilV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3719
    ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3720
        perProjectInfoV2 := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3721
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3722
    perProjectInfoV2 := perProjectInfoV2 ? #().
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3723
    perProjectInfoV2 := perProjectInfoV2 select:[:info | info key asFilename hasSuffix:'st'].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3724
    perProjectInfoV2 := Dictionary withAssociations:perProjectInfoV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3725
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3726
    filesInRepositoryV1 := perProjectInfoV1 keys.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3727
    filesInRepositoryV2 := perProjectInfoV2 keys.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3728
    filesInRepositoryV1 := filesInRepositoryV1 reject:[:fileName | (perProjectInfoV1 at:fileName) == #deleted].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3729
    filesInRepositoryV2 := filesInRepositoryV2 reject:[:fileName | (perProjectInfoV2 at:fileName) == #deleted].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3730
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3731
    "/ first remove classes which have the same version
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3732
    unchanged := filesInRepositoryV1 select:[:fileName |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3733
                    (filesInRepositoryV2 includes:fileName)
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3734
                    and:[ (perProjectInfoV1 at:fileName) = (perProjectInfoV2 at:fileName) ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3735
                 ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3736
    filesInRepositoryV1 removeAll:unchanged.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3737
    filesInRepositoryV2 removeAll:unchanged.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3738
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3739
    filesAddedInV2   := filesInRepositoryV2 select:[:fileName | (filesInRepositoryV1 includes:fileName) not].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3740
    filesDeletedInV2 := filesInRepositoryV1 select:[:fileName | (filesInRepositoryV2 includes:fileName) not].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3741
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3742
    filesModified    := filesInRepositoryV1 select:[:fileName | filesInRepositoryV2 includes:fileName].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3743
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3744
    "/ to ignore version_xxx methods
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3745
    versionMethodsAndDoitsRejected := 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3746
        [:aChangeSet | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3747
            aChangeSet reject:[:chg | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3748
                false "chg isMethodChangeForVersionMethod" 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3749
                or:[false "chg isMethodChangeForExtensionsVersionMethod"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3750
                or:[chg isDoIt]]]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3751
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3752
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3753
    "/ stupid: as we do not have any revision information for extensions (sigh);
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3754
    "/ we must checkout and look at the extension.st contents, to see if it has changed.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3755
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3756
    [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3757
        |s extensionsRevisionV1 extensionsRevisionV2|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3758
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3759
        extensionsRevisionV1 := perProjectInfoV1 at:'extensions.st' ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3760
        extensionsRevisionV1 notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3761
            [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3762
                s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3763
                        streamForClass:nil fileName:'extensions.st' revision:extensionsRevisionV1 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3764
                        directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3765
                s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3766
                    extensionsInRepositoryV1 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3767
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3768
            ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3769
                s notNil ifTrue:[s close]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3770
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3771
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3772
        extensionsInRepositoryV1 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3773
            extensionsInRepositoryV1 := ChangeSet new
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3774
        ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3775
            "/ ignore package doIts and all extensionVersion_xxx methods
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3776
            extensionsInRepositoryV1 := versionMethodsAndDoitsRejected value:extensionsInRepositoryV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3777
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3778
        
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3779
        "/ ------
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3780
        extensionsRevisionV2 := perProjectInfoV2 at:'extensions.st' ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3781
        extensionsRevisionV2 notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3782
            [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3783
                s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3784
                        streamForClass:nil fileName:'extensions.st' revision:extensionsRevisionV2 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3785
                        directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3786
                s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3787
                    extensionsInRepositoryV1 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3788
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3789
            ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3790
                s notNil ifTrue:[s close]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3791
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3792
        ].    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3793
        extensionsInRepositoryV2 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3794
            extensionsInRepositoryV2 := ChangeSet new
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3795
        ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3796
            "/ ignore package doIts and all extensionVersion_xxx methods
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3797
            extensionsInRepositoryV2 := versionMethodsAndDoitsRejected value:extensionsInRepositoryV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3798
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3799
    ] value.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3800
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3801
    extensionDiffs := extensionsInRepositoryV1 diffSetsAgainst:extensionsInRepositoryV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3802
    extensionsOnly ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3803
        ^ extensionDiffs
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3804
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3805
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3806
    diffSet := extensionDiffs copy.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3807
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3808
    filesReallyModified :=
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3809
        filesInRepositoryV2 select:[:eachFile |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3810
            |repositoryVersion1 repositoryVersion2 s stRevision diffs|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3811
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3812
            stRevision := perProjectInfoV1 at:eachFile ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3813
            stRevision notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3814
                [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3815
                    s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3816
                            streamForClass:nil fileName:eachFile revision:stRevision 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3817
                            directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3818
                    s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3819
                        repositoryVersion1 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3820
                    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3821
                ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3822
                    s notNil ifTrue:[s close].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3823
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3824
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3825
            repositoryVersion1 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3826
                repositoryVersion1 := ChangeSet new.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3827
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3828
            repositoryVersion1 := versionMethodsAndDoitsRejected value:repositoryVersion1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3829
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3830
            stRevision := perProjectInfoV2 at:eachFile ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3831
            stRevision notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3832
                [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3833
                    s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3834
                            streamForClass:nil fileName:eachFile revision:stRevision 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3835
                            directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3836
                    s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3837
                        repositoryVersion2 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3838
                    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3839
                ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3840
                    s notNil ifTrue:[s close].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3841
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3842
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3843
            repositoryVersion2 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3844
                repositoryVersion2 := ChangeSet new.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3845
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3846
            repositoryVersion2 := versionMethodsAndDoitsRejected value:repositoryVersion2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3847
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3848
            diffs := repositoryVersion1 diffSetsAgainst:repositoryVersion2 .
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3849
            diffSet addDiffSet:diffs.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3850
            diffs notEmpty
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3851
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3852
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3853
    diffSet isEmpty ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3854
        "/ Dialog information:(resources string:'%1 is up-to-date.' with:eachProject allBold).
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3855
        Transcript showCR:('%1 not changed between %2 and %3.' 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3856
                            bindWith:aProject allBold 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3857
                            with:(aDateOrNilV1 ? aTagOrNilV1) 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3858
                            with:(aDateOrNilV2 ? aTagOrNilV2)).
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3859
        ^ diffSet.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3860
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3861
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3862
    diffSet sortByClassName.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3863
    ^ diffSet
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3864
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3865
    "Created: / 04-02-2017 / 17:27:47 / cg"
4204
5291c8e8c732 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  3866
    "Modified: / 05-02-2017 / 10:04:50 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3867
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3868
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3869
ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
3674
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3870
    |theMetaclass versionMthd src newSrc versionMethodName oldVersionMethodName|
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3871
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3872
    theMetaclass := aClass theMetaclass.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3873
    versionMethodName := aManager nameOfVersionMethodInClasses.
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  3874
    oldVersionMethodName := aClass nameOfOldVersionMethod.
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3875
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3876
    (theMetaclass includesSelector:versionMethodName) ifTrue:[
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  3877
"/        (theMetaclass includesSelector:oldVersionMethodName) ifTrue:[
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  3878
"/            theMetaclass removeSelector:oldVersionMethodName.   
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  3879
"/        ].
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3880
        "/ ensure that my version method is parsable (contains $'s)
3674
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3881
        versionMthd := theMetaclass compiledMethodAt:versionMethodName.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3882
        versionMthd notNil ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3883
            src := versionMthd source.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3884
            src notNil ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3885
                newSrc := aManager ensureDollarsInVersionMethod:src.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3886
                newSrc ~= src ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3887
                    theMetaclass compile:newSrc categorized:#documentation.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3888
                ]
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3889
            ].
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3890
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3891
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3892
        (theMetaclass includesSelector:oldVersionMethodName) ifTrue:[
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3893
            "/ but make sure, it is a version method for this sourcecodemanager...
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3894
            (theMetaclass methodDictionary keys count:[:sel | sel startsWith:'version']) size == 1 ifTrue:[
3674
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3895
                versionMthd := theMetaclass compiledMethodAt:oldVersionMethodName.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3896
                versionMthd notNil ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3897
                    src := versionMthd source.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3898
                    (src startsWith:oldVersionMethodName) ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3899
                        newSrc := versionMethodName , (src copyFrom:(oldVersionMethodName size + 1))
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3900
                    ].
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3901
                    theMetaclass compile:newSrc categorized:#documentation.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  3902
                ]
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3903
            ]
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3904
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3905
    ].
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  3906
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3907
    "Modified: / 20-08-2011 / 14:40:27 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3908
    "Created: / 29-12-2011 / 14:33:46 / cg"
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3909
!
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  3910
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3911
fetchSourceOf:aClass askForRevision:askForRevision into:aBlockToReturnMultipleValues
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3912
    "fetch the source of either the newest version or the revision being asked for,
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3913
     or nil, if there are any problems.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3914
     Helper method"
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3915
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3916
    |classToCompare aStream comparedSource rev revString mgr
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3917
     nm msg revisionInClass newestRev|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3918
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3919
    classToCompare := aClass theNonMetaclass.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3920
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3921
    nm := classToCompare name.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3922
    (mgr := manager) isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3923
        mgr := self sourceCodeManagerFor:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3924
        mgr isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3925
            self error:'oops - no sourcecode manager' mayProceed:true.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3926
            ^ nil
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3927
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3928
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3929
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3930
    rev := classToCompare revisionInfoOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3931
"/    rev := classToCompare binaryRevision.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3932
    revisionInClass := classToCompare revisionOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3933
    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3934
        rev := revisionInClass
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3935
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3936
    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3937
        (Dialog confirm:'Class seems to be not yet in the repository (or classes revision info is missing or corrupted)\\Proceed ?' withCRs)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3938
        ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3939
            ^ nil
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3940
        ]
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3941
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3942
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3943
    "/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3944
    "/ class in repository - ask for revision
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3945
    "/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3946
    SourceCodeManagerError handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3947
        Dialog warn:(resources 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3948
                                stringWithCRs:'Could not fetch revision info of "%1".\\Please check your sourcecode manager settings of %2 for package: "%3".\(and possibly the network for reachability of the repository)'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3949
                                with:classToCompare name
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3950
                                with:classToCompare sourceCodeManager managerTypeName
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3951
                                with:classToCompare package).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3952
        ^ nil.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3953
    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3954
        newestRev := mgr newestRevisionOf:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3955
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3956
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3957
    askForRevision ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3958
        msg := resources string:'Compare to revision: (empty for newest)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3959
        rev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3960
            msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3961
                                           with:nm allBold with:rev).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3962
            (revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3963
                msg := msg , '\' , (resources string:'And has been checked into the repository as %1.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3964
                                               with:revisionInClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3965
            ]
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3966
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3967
        newestRev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3968
            msg := msg , '\' , (resources string:'Newest in repository is %1.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3969
                                           with:newestRev)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3970
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3971
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3972
        rev := self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3973
                    askForExistingRevision:msg 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3974
                    title:'Compare with repository' 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3975
                    class:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3976
    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3977
        rev := newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3978
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3979
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3980
    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3981
        mgr = classToCompare sourceCodeManager ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3982
            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)'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3983
        ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3984
            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)'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3985
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3986
        Dialog warn:(resources 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3987
                                stringWithCRs:msg
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3988
                                with:classToCompare name
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3989
                                with:mgr managerTypeName
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3990
                                with:classToCompare package
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3991
                                with:(classToCompare sourceCodeManager managerTypeName)).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3992
        ^ nil.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3993
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3994
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3995
    rev withoutSpaces isEmpty ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3996
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3997
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3998
        aStream := mgr getSourceStreamFor:classToCompare revision:newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  3999
        revString := '(newest: ' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4000
    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4001
        msg := 'extracting previous %1'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4002
        aStream := mgr getSourceStreamFor:classToCompare revision:rev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4003
        revString := rev
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4004
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4005
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4006
    aStream isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4007
        self warn:'Could not extract source from repository (check repository settings / network)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4008
        ^ nil
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4009
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4010
    aStream class readErrorSignal handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4011
        self warn:('Read error while reading extracted source\\' , ex description) withCRs.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4012
        aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4013
        ^ nil
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4014
    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4015
        comparedSource := aStream contents asString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4016
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4017
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4018
    aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4019
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4020
    aBlockToReturnMultipleValues 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4021
        value:revString 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4022
        value:revisionInClass
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4023
        value:mgr. 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4024
    ^ comparedSource
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4025
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4026
    "
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4027
      self compareClassWithRepository:Array
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4028
    "
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4029
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4030
    "Modified: / 24-07-2012 / 18:11:27 / cg"
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4031
!
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4032
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4033
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil forClass:aClass valuesInto:aBlock
3325
944f6a6e66ff class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3313
diff changeset
  4034
    "open a dialog, asking for commit/checkin log info.
944f6a6e66ff class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3313
diff changeset
  4035
     Returns 2 values: a log message and additional checkinInfo (containing things like
944f6a6e66ff class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3313
diff changeset
  4036
     markAsStable, etc,)"
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4037
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4038
    |initialLogMessage checkinInfo reasonLine logMessage|
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4039
    
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4040
    "/ heuristics for a useful initial log message...
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4041
    aLogInfoOrNil isNil ifTrue:[
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
  4042
        initialLogMessage := (self class goodInitialLogMessageForCheckinClassOfClass:aClass) ? ''.
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4043
        "/ initial checkin ?
3657
2de3a610d07c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3642
diff changeset
  4044
        (aClass package isNil or:[(aClass revisionOfManager:manager) "revision" isNil]) ifTrue:[ 
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4045
            initialLogMessage := 'initial checkin\\' withCRs , initialLogMessage
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4046
        ].
4079
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4047
        aClass isProjectDefinition ifTrue:[
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4048
            checkinInfo := self 
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4049
                            getCheckinInfoFor:aClass name 
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4050
                            initialAnswer:initialLogMessage
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4051
                            withQuickOption:false
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4052
                            withValidateConsistencyOption:true
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4053
        ] ifFalse:[
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4054
            checkinInfo := self 
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4055
                            getCheckinInfoFor:aClass name 
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4056
                            initialAnswer:initialLogMessage.
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4057
        ].
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4058
        checkinInfo isNil ifTrue:[^ false].
4079
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4059
4080
d36f01795eb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4079
diff changeset
  4060
        (aClass isProjectDefinition and:[checkinInfo validateConsistency]) ifTrue:[
4079
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4061
            self validateConsistencyOfPackage:aClass package doClasses:false doExtensions:false.
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4062
        ].
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4063
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4064
        logMessage := checkinInfo logMessage.
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4065
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4066
        reasonLine := '#OTHER'. 
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4067
        checkinInfo checkinReason == Tools::CheckinInfoDialog reasonBugfix ifTrue:[
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4068
            reasonLine := '#BUGFIX' 
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4069
        ] ifFalse:[ 
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4070
            checkinInfo checkinReason == Tools::CheckinInfoDialog reasonFeature ifTrue:[
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4071
                reasonLine := '#FEATURE' 
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4072
            ] ifFalse:[ 
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4073
                checkinInfo checkinReason == Tools::CheckinInfoDialog reasonRefactoring ifTrue:[
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4074
                    reasonLine := '#REFACTORING' 
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4075
                ] ifFalse:[ 
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4076
                    checkinInfo checkinReason == Tools::CheckinInfoDialog reasonDocumentation ifTrue:[
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4077
                        reasonLine := '#DOCUMENTATION' 
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4078
                    ] ifFalse:[ 
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4079
                        checkinInfo checkinReason == Tools::CheckinInfoDialog reasonUIEnhancement ifTrue:[
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4080
                            reasonLine := '#UI_ENHANCEMENT' 
3971
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4081
                        ] ifFalse:[ 
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4082
                            checkinInfo checkinReason == Tools::CheckinInfoDialog reasonQuality ifTrue:[
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4083
                                reasonLine := '#QUALITY' 
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4084
                            ] ifFalse:[ 
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4085
                                checkinInfo checkinReason == Tools::CheckinInfoDialog reasonTuning ifTrue:[
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4086
                                    reasonLine := '#TUNING' 
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4087
                                ]
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4088
                            ]
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4089
                        ]
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4090
                    ]
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4091
                ]
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4092
            ]
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4093
        ]
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4094
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4095
        aLogInfoOrNil isString ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4096
            "soon obsolete..."    
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4097
            logMessage := aLogInfoOrNil
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4098
        ] ifFalse:[ 
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4099
            checkinInfo := aLogInfoOrNil.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4100
            logMessage := checkinInfo logMessage.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4101
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4102
    ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4103
    logMessage notNil ifTrue:[  
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4104
        logMessage := logMessage asSingleByteStringReplaceInvalidWith:$?
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4105
    ].
3974
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4106
    reasonLine isNil ifTrue:[
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4107
        reasonLine := '#OTHER'. 
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4108
    ].
3974
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4109
    logMessage := reasonLine , ' by ',OperatingSystem getLoginName,'\' withCRs 
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4110
                  , (logMessage ? '').
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4111
    aBlock value:logMessage value:checkinInfo.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4112
    ^ true
3971
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4113
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4114
    "Modified: / 31-03-2016 / 17:58:11 / cg"
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
  4115
    "Modified: / 17-03-2017 / 18:00:12 / stefan"
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4116
!
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4117
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4118
knownTagsInPackages:packages
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4119
    "return the symbolic names given to any version in packages.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4120
     Being lazy, assume tags are persistent across packages (which they are not required to be...)
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4121
     and only fetch the tag names from the first given package.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4122
     May raise an error, if the repository cannot be accessed"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4123
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4124
    |someDfnClass|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4125
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4126
    someDfnClass := ProjectDefinition definitionClassForPackage:packages first.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4127
    someDfnClass isNil ifTrue:[ someDfnClass := Object projectDefinitionClass ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4128
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4129
    ^ (manager knownTagsFor:someDfnClass) asOrderedCollection sort.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4130
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4131
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4132
     CVSSourceCodeManager utilities knownTagsInPackages:#( 'stx:libbasic' 'stc:libbasic2' )
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4133
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4134
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4135
    "Created: / 04-02-2017 / 18:55:16 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4136
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4137
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4138
removeSourceContainerForClass:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4139
    "show container & let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4140
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4141
    ^ self removeSourceContainerForClass:aClass confirm:true warn:true
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4142
!
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4143
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4144
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4145
    "show container & optionally let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4146
3814
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4147
    |info mgr|
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4148
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4149
    aClass isLoaded ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4150
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4151
            self warn:(resources string:'Please load the class first.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4152
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4153
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4154
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4155
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4156
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4157
    "/ 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
  4158
    "/ if so, take that as a default.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4159
    "/
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4160
    mgr := self sourceCodeManagerFor:aClass.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4161
    mgr isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4162
        ^ false
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4163
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4164
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4165
    info := mgr sourceInfoOfClass:aClass.
3814
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4166
    ^ self removeSourceContainerForClass:aClass usingSourceInfo:info confirm:doConfirm warn:doWarn
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4167
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4168
    "Modified: / 16-07-2013 / 19:46:50 / cg"
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4169
!
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4170
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4171
removeSourceContainerForClass:aClass usingSourceInfo:info confirm:doConfirm warn:doWarn
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4172
    "show container & optionally let user confirm twice."
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4173
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4174
    |module directory fileName mgr|
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4175
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4176
    aClass isLoaded ifFalse:[
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4177
        doWarn ifTrue:[
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4178
            self warn:(resources string:'Please load the class first.').
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4179
        ].
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4180
        ^ false.
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4181
    ].
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4182
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4183
    "/
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4184
    "/ ask the sourceCodeManager if it knows anything about that class
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4185
    "/ if so, take that as a default.
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4186
    "/
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4187
    mgr := self sourceCodeManagerFor:aClass.
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4188
    mgr isNil ifTrue:[
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4189
        ^ false
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4190
    ].
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4191
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4192
    info notNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4193
        (info includesKey:#module) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4194
            module := (info at:#module).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4195
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4196
        (info includesKey:#directory) ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4197
            directory := (info at:#directory).
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4198
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4199
        fileName := mgr containerFromSourceInfo:info.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4200
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4201
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4202
    module isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4203
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  4204
            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
  4205
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4206
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4207
    ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4208
    directory isNil ifTrue:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4209
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  4210
            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
  4211
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4212
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4213
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4214
    fileName isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4215
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  4216
            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
  4217
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4218
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4219
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4220
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4221
    OperatingSystem isMSDOSlike ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4222
        "cvs expects unix-filenames"
3591
d86841bb0d5c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3579
diff changeset
  4223
        module := module asUnixFilenameString.
d86841bb0d5c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3579
diff changeset
  4224
        directory := directory asUnixFilenameString.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4225
    ].
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  4226
    (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4227
        doWarn ifTrue:[
2830
f5204449764a changed: #removeSourceContainerForClass:confirm:warn:
Claus Gittinger <cg@exept.de>
parents: 2818
diff changeset
  4228
            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
  4229
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4230
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4231
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4232
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4233
    doConfirm ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4234
        (Dialog
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4235
            choose:(resources 
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  4236
                        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
  4237
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4238
container:    %2 / %3 / %4
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4239
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4240
Really remove ?' 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4241
                        with:aClass name 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4242
                        with:module 
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4243
                        with:directory 
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4244
                        with:fileName) 
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4245
            labels:(Array 
1129
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  4246
                        with:(resources string:'No') 
89049988e8d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  4247
                        with:(resources string:'Remove'))
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4248
            values:#(false true)
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4249
            default:false) ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4250
            ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4251
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4252
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4253
3814
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4254
    (mgr removeContainer:fileName inModule:module directory:directory) 
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4255
    ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4256
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4257
            self warn:(resources string:'failed to remove container.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4258
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4259
        ^ true.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4260
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4261
    ^ false
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4262
3351
68989ed1137f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3344
diff changeset
  4263
    "Modified: / 16-07-2013 / 19:46:50 / cg"
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4264
!
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4265
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4266
repositoryLogOf:aClass onto:aStream
2050
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4267
    self repositoryLogOf:aClass short:false onto:aStream
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4268
!
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4269
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4270
repositoryLogOf:aClass short:shortOrNot onto:aStream
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4271
    |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
  4272
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4273
    info := aClass revisionInfo.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4274
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4275
    rv := aClass binaryRevision.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4276
    rv notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4277
        aStream nextPutLine:'**** Loaded classes binary information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4278
        aStream nextPutLine:'  Binary based upon : ' , rv.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4279
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4280
    ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4281
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4282
    "/ old
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4283
"/    info isNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4284
"/        aStream nextPutLine:'No revision info found'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4285
"/        aClass isLoaded ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4286
"/            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
  4287
"/        ] ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4288
"/            fn := aClass classFilename.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4289
"/            aClass wasAutoloaded ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4290
"/                msg := 'This class was autoloaded.'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4291
"/                msg := msg , ' (from ''' , fn , ''')'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4292
"/            ] ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4293
"/                msg := 'This class was loaded from ''' , fn , '''.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4294
"/            ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4295
"/            msg notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4296
"/                aStream cr; nextPutAll:msg.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4297
"/            ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4298
"/        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4299
"/        ^ self
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4300
"/    ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4301
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4302
    info isNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4303
        aClass isLoaded ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4304
            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
  4305
        ] ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4306
            fn := aClass classFilename.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4307
            aClass wasAutoloaded ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4308
                msg := 'This class was autoloaded.'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4309
                msg := msg , ' (from ''' , fn , ''')'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4310
            ] ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4311
                msg := 'This class was loaded from ''' , fn , '''.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4312
            ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4313
            msg notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4314
                aStream nextPutLine:msg.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4315
            ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4316
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4317
        aStream cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4318
    ] ifFalse:[
2041
fb85bf748dbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  4319
        (info revision notNil) ifFalse:[
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4320
            aStream nextPutLine:'WARNING:'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4321
            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
  4322
            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
  4323
            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
  4324
            aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4325
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4326
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4327
        aStream nextPutLine:'**** Classes source information ****'; cr.
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  4328
        s := info repositoryPathName.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4329
        s notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4330
            aStream nextPutLine:'  Source repository : ' , s
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4331
        ].
3676
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4332
        aStream nextPutLine:('  Filename ........ : %1' bindWith: (info fileName ? '?')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4333
        info symbolicVersionName ~= info revision ifTrue:[
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4334
            aStream nextPutLine:('  Symbolic Version  : %1' bindWith: (info symbolicVersionName ? '?')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4335
        ].
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4336
        aStream nextPutLine:('  Revision ........ : %1' bindWith: (info revision ? '?')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4337
        aStream nextPutLine:('  Checkin date .... : %1 %2 %3' bindWith: (info date  ? '?') 
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4338
                                                              with:(info time ? '?') 
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4339
                                                              with:(info timezone ? '')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4340
        aStream nextPutLine:('  Checkin user .... : %1' bindWith: (info user ? '?')).
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4341
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4342
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4343
    (info2 := aClass packageSourceCodeInfo) notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4344
        aStream nextPutLine:'  Repository: ..... : ' , (info2 at:#module ifAbsent:'?').
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4345
        aStream nextPutLine:'  Directory: ...... : ' , (info2 at:#directory ifAbsent:'?').
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4346
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4347
    info notNil ifTrue:[
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  4348
        aStream nextPutLine:'  Container ....... : ' , (info repositoryPathName ? '?').
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4349
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4350
    aStream cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4351
    mgr := self sourceCodeManagerFor:aClass.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4352
    mgr notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4353
        aStream nextPutLine:'**** Repository information ****'; cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4354
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4355
        module := nil.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4356
        info2 notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4357
            module := info2 at:#module ifAbsent:nil.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4358
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4359
        module notNil ifTrue:[
3632
c39f5d147a8b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3602
diff changeset
  4360
            aStream nextPutLine:('  Repository URL ......: %1' bindWith: 
3633
abe27fb2c473 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4361
                                ((mgr repositoryNameForPackage:aClass package) ifNil:[mgr repositoryName , ' (default)']) asString).
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4362
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4363
        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
  4364
    ]
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4365
2836
91e9be94d80b changed: #repositoryLogOf:short:onto:
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  4366
    "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
  4367
    "Modified: / 11-07-2012 / 13:50:59 / cg"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4368
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4369
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4370
tagClass:aClass as:tag
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4371
    |mgr|
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4372
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4373
    mgr := self sourceCodeManagerFor:aClass.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4374
    mgr
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4375
        setSymbolicName:tag 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4376
        revision:nil 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4377
        overWrite:true 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4378
        class:aClass.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4379
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4380
    "Modified: / 12-09-2006 / 13:03:59 / cg"
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4381
!
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4382
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4383
tagClasses:aCollectionOfClasses as:tag
3847
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4384
    ^ self tagClasses:aCollectionOfClasses as:tag revision:nil
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4385
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4386
    "Created: / 12-09-2006 / 13:04:29 / cg"
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4387
!
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4388
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4389
tagClasses:aCollectionOfClasses as:tag revision:revision
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4390
    |classesPerManager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4391
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4392
    classesPerManager := Dictionary new.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4393
    aCollectionOfClasses 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4394
        do:[:eachClass | 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4395
            |manager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4396
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4397
            manager := self sourceCodeManagerFor:eachClass.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4398
            (classesPerManager at:manager ifAbsentPut:[Set new]) add:eachClass
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4399
        ].
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4400
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4401
    classesPerManager keysAndValuesDo:[:manager :classesPerManager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4402
        manager
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4403
            setSymbolicName:tag 
3847
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4404
            revision:revision 
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4405
            overWrite:true 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4406
            classes:classesPerManager.
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4407
    ].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4408
    ^ true
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4409
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4410
2602
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4411
tagPackage: package as:tag
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4412
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4413
    self tagClasses:(Smalltalk allClassesInPackage:package) as:tag.
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4414
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4415
    "Created: / 12-09-2006 / 13:04:29 / cg"
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4416
    "Created: / 15-10-2011 / 22:47:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4417
!
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4418
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  4419
tagPath:aPath as:tag usingManager:aManager
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4420
    aManager 
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4421
        setSymbolicName:tag 
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4422
        revision:nil 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4423
        overWrite:true 
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4424
        path:aPath.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4425
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4426
    "Modified: / 12-09-2006 / 12:04:44 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  4427
    "Created: / 29-12-2011 / 14:32:38 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4428
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4429
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  4430
!SourceCodeManagerUtilities methodsFor:'utilities-scm-helpers'!
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4431
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4432
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4433
    "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
  4434
     Return a dictionary associating revision with a changeList entries for that method.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4435
     Unfinished - need a GUI for that."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4436
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4437
    |mgr theClass revisionLog revisions items s entriesPerRevision previousVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4438
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4439
    theClass := aClass theNonMetaclass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4440
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4441
    mgr := self sourceCodeManagerFor:theClass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4442
    mgr isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4443
        self error:'no sourceCodeManager'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4444
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4445
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4446
    revisionLog := mgr
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4447
                        revisionLogOf:theClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4448
                        numberOfRevisions:numberOfRevisionsOrNil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4449
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4450
    revisions := revisionLog at:#revisions.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4451
    items := revisions collect:[:each | |rev date who|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4452
                                    rev := each at:#revision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4453
                                    date := each at:#date.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4454
                                    who := each at:#author.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4455
                                    rev allBold , ' [' , date , ' by ' , who , ']'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4456
                               ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4457
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4458
    revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4459
    revisions addFirst:#current.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4460
    entriesPerRevision := Dictionary new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4461
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4462
    previousVersion := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4463
    revisions reverseDo:[:eachRevision |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4464
        |srcStream entries thisVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4465
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4466
        eachRevision == #current ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4467
            s := '' writeStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4468
            theClass fileOutOn:s withTimeStamp:false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4469
            srcStream := s contents readStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4470
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4471
            self activityNotification:('checking out revision ' , eachRevision , '...').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4472
            srcStream := mgr getSourceStreamFor:theClass revision:eachRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4473
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4474
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4475
        entries := ChangeSet fromStream:srcStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4476
        srcStream close.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4477
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4478
        "/ remove all definitions       
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4479
        entries := entries select:[:each | each isMethodChange].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4480
        "/ remove all methods which are for other selectors      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4481
        entries := entries select:[:each | each selector == selector].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4482
        "/ remove all methods which are for private subclasses      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4483
        entries := entries select:[:each | each className = aClass name].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4484
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4485
        entries size == 1 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4486
            "/ the method is there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4487
            thisVersion := entries first.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4488
            (previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4489
                "/ no change
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4490
            ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4491
                entriesPerRevision at:eachRevision put:thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4492
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4493
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4494
            "/ the method is not there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4495
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4496
        previousVersion := thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4497
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4498
    self error:'unfinished code'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4499
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4500
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4501
     self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4502
     self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4503
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4504
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4505
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  4506
!SourceCodeManagerUtilities methodsFor:'utilities-scm-user interaction'!
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4507
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4508
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4509
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4510
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4511
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4512
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4513
    ^ self
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4514
        askForContainer:boxText title:title note:notice 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4515
        initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4516
        forNewContainer:true
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4517
!
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4518
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4519
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
  4520
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4521
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4522
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4523
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  4524
    |box y component answer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4525
     moduleHolder packageHolder fileNameHolder
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4526
     module package fileName 
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4527
     allPackageIDs knownContainers knownPackages packageUpdater
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4528
     packageBoxComponent fileNameBoxComponent fileNameUpdater|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4529
3967
5bfee3208fb3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  4530
    allPackageIDs := Smalltalk allPackageIDs.
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4531
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4532
    knownContainers := allPackageIDs collect:[:package | (package upTo:$:)] as:Set.
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4533
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4534
    knownContainers := knownContainers asOrderedCollection reject:[:module | module isBlank].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4535
    knownContainers sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4536
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4537
    packageUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4538
        |theModulePrefix|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4539
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4540
        theModulePrefix := moduleHolder value , ':'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4541
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4542
        Cursor wait showWhile:[
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4543
            knownPackages := 
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4544
                allPackageIDs
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4545
                    select:[:package | (package startsWith:theModulePrefix)]
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4546
                    thenCollect:[:package | |idx|
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4547
                        idx := package indexOf:$:.
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4548
                        (package copyFrom:idx + 1)].
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4549
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4550
            knownPackages := knownPackages asSet asOrderedCollection.
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  4551
            knownPackages := knownPackages reject:[:package | package isBlank].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4552
            knownPackages sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4553
            packageBoxComponent list:knownPackages.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4554
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4555
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4556
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4557
    fileNameUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4558
        |module package files|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4559
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4560
        Cursor read showWhile:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  4561
            module := moduleHolder value ? (PackageId noProjectID).
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  4562
            package := packageHolder value ? (PackageId noProjectID).
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4563
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4564
            files := SourceCodeManager getExistingContainersInModule:module directory:package.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4565
            files := files asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4566
            files := files select:[:eachFile | eachFile asFilename hasSuffix:'st'].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4567
            files sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4568
            fileNameBoxComponent list:files.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4569
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4570
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4571
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4572
    moduleHolder := initialModule asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4573
    packageHolder := initialPackage asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4574
    fileNameHolder := initialFileName asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4575
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4576
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4577
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4578
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4579
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4580
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4581
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4582
    component := box addTextLabel:boxText withCRs adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4583
    component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4584
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4585
    box addVerticalSpace.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4586
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4587
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4588
    component := box addTextLabel:(resources string:'Module:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4589
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4590
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4591
    component := box addComboBoxOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4592
    component list:knownContainers.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4593
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4594
"/    component := box addInputFieldOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4595
    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
  4596
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4597
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4598
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4599
    component := box addTextLabel:(resources string:'Package:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4600
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4601
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4602
    packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4603
"/    component := box addInputFieldOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4604
    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
  4605
    packageUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4606
    moduleHolder onChangeEvaluate:packageUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4607
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4608
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4609
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4610
    component := box addTextLabel:(resources string:'Filename:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4611
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4612
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4613
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4614
    forNewContainer ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4615
        component := box addInputFieldOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4616
        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
  4617
    ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4618
        fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4619
        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
  4620
        fileNameUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4621
        packageHolder onChangeEvaluate:fileNameUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4622
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4623
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4624
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4625
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4626
    notice notNil ifTrue:[
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4627
        component := box addTextLabel:notice adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4628
        component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4629
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4630
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4631
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4632
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4633
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4634
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
3683
fb6ad154b94d class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3679
diff changeset
  4635
        component := Button label:(resources string:'Yes to All').
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4636
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4637
                            YesToAllNotification queryWith:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4638
                            box doAccept.
2253
7d7b0d2d1fe7 changed: #askForContainer:title:note:initialModule:initialPackage:initialFileName:forNewContainer:
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  4639
                            box okPressed.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4640
                         ].
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4641
        box addButton:component.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4642
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4643
    (AbortAllSignal isHandled) ifTrue:[
3683
fb6ad154b94d class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3679
diff changeset
  4644
        component := Button label:(resources string:'Cancel All').
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4645
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4646
                            box hide.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4647
                            AbortAllSignal raiseSignal.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4648
                         ].
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4649
        box addButton:component before:nil.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4650
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4651
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4652
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4653
        answer := YesToAllQuery query.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4654
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4655
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4656
    answer isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4657
        box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4658
        answer := box accepted
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4659
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4660
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4661
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4662
    answer ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4663
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4664
    ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4665
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4666
    module := moduleHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4667
    package := packageHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4668
    fileName := fileNameHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4669
    ^ Dictionary new
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4670
        at:#module put:module;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4671
        at:#package put:package;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4672
        at:#fileName put:fileName;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4673
        yourself
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4674
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4675
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4676
     self 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4677
        askForContainer:'enter container' title:'container' note:'some note'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4678
        initialModule:'foo' initialPackage:'bar' initialFileName:'baz'        
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4679
    "
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4680
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4681
    "Modified: / 29-08-2013 / 12:26:04 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4682
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4683
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4684
askForExistingRevision:boxText title:title class:aClass
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4685
    "open a dialog asking for a containers revision;
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4686
     return a revision number, or nil if canceled."
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4687
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4688
    |mgr sourceInfo module package fileName|
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4689
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4690
    mgr := self sourceCodeManagerFor:aClass.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4691
    sourceInfo := mgr sourceInfoOfClass:aClass.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4692
    sourceInfo isNil ifTrue:[^ nil].
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4693
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4694
    package := mgr directoryFromSourceInfo:sourceInfo.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4695
    module := mgr moduleFromSourceInfo:sourceInfo.  
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4696
    fileName := mgr containerFromSourceInfo:sourceInfo.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4697
    ^ self
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4698
        askForExistingRevision:boxText 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4699
        title:title 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4700
        class:aClass 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4701
        manager:mgr 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4702
        module:module package:package 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4703
        fileName:fileName
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4704
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4705
    "
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4706
     SourceCodeManagerUtilities
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4707
        askForRevisionToCompare:'enter revision'
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4708
        title:'revision'
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4709
        class:Array
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4710
    "
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4711
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4712
    "Modified: / 12-09-2006 / 14:17:04 / cg"
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4713
!
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4714
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4715
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
  4716
    "open a dialog asking for a containers revision;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4717
     return a revision number, or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4718
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4719
    |partialLog revisions items newestRev
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  4720
     box y component revisionHolder symbolicNames stableRevision releasedRevision
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4721
     tagHolder tagList lockChange|
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4722
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4723
    partialLog := aSourceCodeManager
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4724
        revisionLogOf:clsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4725
        numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4726
        fileName:fileName
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4727
        directory:directory 
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4728
        module:module.
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  4729
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4730
    partialLog notNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4731
        newestRev := partialLog at:#newestRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4732
        revisions := partialLog at:#revisions.
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  4733
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  4734
        symbolicNames notNil ifTrue:[
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  4735
            stableRevision := symbolicNames at:'stable' ifAbsent:[].
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  4736
            releasedRevision := symbolicNames at:'released' ifAbsent:[].
3332
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  4737
            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
  4738
                         collect:[:assoc | assoc key]) reverse.
3332
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  4739
            tagList remove:'stable' ifAbsent:[].
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  4740
            tagList notEmpty ifTrue:[tagList addFirst:'-'].
bc7ab41bb5bb class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3327
diff changeset
  4741
            tagList addFirst:'stable'.
4174
3b55c406664f #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4160
diff changeset
  4742
            LastTag notNil ifTrue:[
3b55c406664f #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4160
diff changeset
  4743
                tagList addFirst:LastTag.
3b55c406664f #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4160
diff changeset
  4744
            ].    
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  4745
        ].
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4746
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4747
        "/ fill in timestamps
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4748
        revisions do:[:each |
4160
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4749
            |dateOrDateString timeOrTimeString timestampString timestamp|
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4750
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4751
            dateOrDateString := each at:#date ifAbsent:nil.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4752
            timeOrTimeString := each at:#time ifAbsent:nil.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4753
            dateOrDateString notNil ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4754
                dateOrDateString isString ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4755
                    timestamp := Timestamp readFrom:dateOrDateString onError:nil.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4756
                    timestamp notNil ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4757
                        each at:#timestamp put:timestamp.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4758
                        each at:#day put:timestamp asDate.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4759
                    ].
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4760
                ] ifFalse:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4761
                    timeOrTimeString isString ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4762
                    self halt.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4763
    
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4764
                    ] ifFalse:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4765
                        (dateOrDateString notNil and:[timeOrTimeString notNil]) ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4766
                            timestamp := Timestamp fromDate:dateOrDateString andTime:timeOrTimeString.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4767
                            each at:#timestamp put:timestamp.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4768
                        ] ifFalse:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4769
                            self halt
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4770
                        ]    
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4771
                    ]
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4772
                ].    
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4773
            ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4774
        ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4775
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4776
        items := revisions 
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4777
                    collectWithIndex:[:each :idx| 
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4778
                        |rev timestamp date time dateAndTimeString who flag 
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4779
                         prevInfo prevDate nextInfo nextDate dateDifferentToPrev dateDifferentToNext|
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4780
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4781
                        rev := each at:#revision.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4782
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4783
                        timestamp := each at:#timestamp.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4784
                        timestamp notNil ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4785
                            date := each at:#day.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4786
                            date = Date today ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4787
                                dateAndTimeString := timestamp asTime printString.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4788
                            ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4789
                                "/ if date is different to both previous AND next,
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4790
                                "/ only show the date
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4791
                                dateDifferentToPrev := dateDifferentToNext := false.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4792
                                (idx > 1) ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4793
                                    prevInfo := revisions at:idx-1.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4794
                                    prevDate := prevInfo at:#day ifAbsent:nil.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4795
                                    dateDifferentToPrev := (prevDate notNil and:[prevDate ~= date]).
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4796
                                ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4797
                                (idx < revisions size) ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4798
                                    nextInfo := revisions at:idx+1.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4799
                                    nextDate := nextInfo at:#day ifAbsent:nil.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4800
                                    dateDifferentToNext := (nextDate notNil and:[nextDate ~= date]).
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4801
                                ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4802
                                (dateDifferentToPrev and:[dateDifferentToPrev]) ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4803
                                    dateAndTimeString := date printString.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4804
                                ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4805
                                    dateAndTimeString := date printString,' ',(timestamp asTime printString).
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4806
                                ]
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4807
                            ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4808
                        ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4809
                            dateAndTimeString := (each at:#date ifAbsent:nil) ? '(unknown time)'.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4810
                        ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4811
                        who := (each at:#author ifAbsent:nil) ? '?'.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4812
                        rev = stableRevision ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4813
                            flag := ' Stable' allBold.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4814
                        ] ifFalse:[rev = releasedRevision ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4815
                            flag := ' Released' allBold.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4816
                        ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4817
                            flag := ''
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4818
                        ]].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4819
                        '%1%2 [%3 by %4]' bindWith:rev allBold with:flag with:dateAndTimeString with:who 
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4820
                   ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4821
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4822
        revisions := revisions collect:[:each | each at:#revision].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4823
    ] ifFalse:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4824
        newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4825
        revisions := items := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4826
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4827
        newestRev isNil ifTrue:[
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  4828
            (aSourceCodeManager checkForExistingContainer:fileName inModule:module directory:directory warn:true)
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4829
            ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4830
                ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4831
            ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4832
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4833
    ].
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4834
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4835
    lockChange := false.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4836
    revisionHolder := newestRev asValue.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4837
    revisionHolder onChangeEvaluate:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4838
        "/ cut off everything after revision
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4839
        |s first words tag|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4840
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4841
        s := revisionHolder value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4842
        words := s asCollectionOfWords.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4843
        words size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4844
            first := words first string.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4845
            first ~= s ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4846
                revisionHolder value:first
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4847
            ]
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4848
        ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4849
        lockChange ifFalse:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4850
            tagHolder value:''
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4851
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4852
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4853
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4854
    tagHolder := '' asValue.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4855
    tagHolder 
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4856
        onChangeEvaluate:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4857
            |tag rev|
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4858
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4859
            (tag := tagHolder value) notEmptyOrNil ifTrue:[
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  4860
                "/ LastTag := tag.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4861
                rev := symbolicNames at:tag.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4862
                rev ~= revisionHolder value ifTrue:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4863
                    lockChange := true.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4864
                    revisionHolder value:rev.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4865
                    lockChange := false.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4866
                ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4867
            ]
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4868
        ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4869
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4870
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4871
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4872
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4873
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4874
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4875
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4876
    component := box addTextLabel:boxText withCRs adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4877
    component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4878
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4879
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4880
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4881
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4882
    component := box addTextLabel:(resources string:'Revision:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4883
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4884
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4885
    component := box addComboBoxOn:revisionHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4886
    component list:items.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4887
    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
  4888
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4889
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4890
    component := box addTextLabel:(resources string:'or Tag:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4891
    component width:0.4.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4892
    box yPosition:y.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4893
    component := box addComboListOn:tagHolder tabable:true.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4894
    component list:tagList.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4895
    component width:0.6; left:0.4.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4896
    tagList isNil ifTrue:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4897
        component disable
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4898
    ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4899
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4900
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4901
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4902
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4903
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4904
    AbortAllOperationWantedQuery query ifTrue:[
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4905
        (box addAbortButtonLabelled:'Cancel all') action:[AbortAllSignal raise].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4906
    ].
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  4907
    LastTag notEmptyOrNil ifTrue:[
4193
6a4b646749ea #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4192
diff changeset
  4908
        (symbolicNames notNil and:[symbolicNames includesKey:LastTag]) ifTrue:[
6a4b646749ea #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4192
diff changeset
  4909
            tagHolder value:LastTag.
6a4b646749ea #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4192
diff changeset
  4910
        ].
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  4911
    ].
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  4912
    
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4913
    box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4914
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4915
    box accepted ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4916
        box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4917
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4918
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4919
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4920
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  4921
    LastTag := tagHolder value.
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  4922
    
3865
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4923
    "/ it is not a good idea to return the tag-name here,
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4924
    "/ because it may get cached later when the source is fetched,
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4925
    "/ and the tag could move to another version (making the cached file invalid)
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4926
    "/ without me knowing about that fact.
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4927
    "/ Therefore, we should return the real revision number.
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4928
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4929
    "/ ouch: however, checkout of a branch seems to not work the same way
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4930
    "/ so we DO return the tag, but suppress caching it. sigh.
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  4931
    ^ (tagHolder value notEmptyOrNil ifTrue:[tagHolder] ifFalse:[revisionHolder]) value withoutSpaces.
3865
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  4932
    "/ ^ revisionHolder value withoutSpaces.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4933
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4934
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4935
     SourceCodeManagerUtilities
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4936
        askForRevisionToCompare:'enter revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4937
        title:'revision'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4938
        class:nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4939
        manager:SourceCodeManager 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4940
        module:'stx'
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4941
        directory:'libbasic'
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4942
        fileName:'Array.st'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4943
    "
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  4944
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  4945
    "Modified: / 24-02-2017 / 11:38:39 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4946
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4947
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  4948
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4949
    "check if a class contains message-sends to:
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4950
        #halt , #halt:
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4951
        #error
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4952
        #todo , #todo:
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4953
        (and maybe more in the future)
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4954
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4955
     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
  4956
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4957
    |badStuff whatIsBad msg answer labels values defaultAnswer dontShowAgain
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  4958
     methodsWithBadStuff|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4959
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4960
    badStuff := #(
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4961
        ( 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
  4962
        ( 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
  4963
        ( 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
  4964
        ( todo         'send of #todo - unfinished code present?' )
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4965
        ( todo:        'send of #todo:- unfinished code present?' )
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4966
    ).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4967
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4968
    methodsWithBadStuff := Set new.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4969
    whatIsBad := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4970
    aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4971
        |setOfLiterals setOfSentMessages|
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4972
2977
e5bfe652373f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
  4973
        mthd isExtension ifFalse:[
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4974
            setOfLiterals := mthd literals.  "/ try without parsing first.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4975
            (badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4976
                setOfSentMessages := mthd messagesSent.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4977
                badStuff do:[:eachEntry | 
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4978
                    (setOfSentMessages includes:eachEntry first) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4979
                        whatIsBad add:eachEntry second.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4980
                        methodsWithBadStuff add:mthd.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4981
                    ]
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  4982
                ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4983
            ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4984
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4985
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4986
    whatIsBad isEmpty ifTrue:[^ true].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4987
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4988
    (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
  4989
        answer := YesToAllQuery query.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4990
        answer notNil ifTrue:[ ^ answer ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4991
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4992
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4993
    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
  4994
    msg := msg , '\\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4995
    whatIsBad do:[:each |
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4996
        msg := msg , '   ' , each , '\'
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4997
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4998
    msg := msg , '\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  4999
    methodsWithBadStuff size == 1 ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5000
        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
  5001
                        with:methodsWithBadStuff anElement whoString allBold).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5002
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5003
        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
  5004
                        with:methodsWithBadStuff anElement whoString allBold 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5005
                        with:methodsWithBadStuff size-1).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5006
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5007
    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
  5008
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5009
    (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
  5010
        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
  5011
        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
  5012
        defaultAnswer := #yesToAll.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5013
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5014
        labels := #('No' 'No, Browse' 'Yes').
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5015
        values := #(false #noBrowse true).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5016
        defaultAnswer := true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5017
    ].
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5018
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  5019
"/        AbortAllOperationRequest isHandled ifTrue:[
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5020
"/            labels := #('Cancel All') , labels.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5021
"/            values := #(#cancelAll) , values.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5022
"/        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5023
3812
173678af0074 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3692
diff changeset
  5024
    Dialog modifyingBoxWith:[:box |
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5025
        checkAgainHolder isValueModel ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5026
            dontShowAgain := checkAgainHolder value not asValue.
3812
173678af0074 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3692
diff changeset
  5027
            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
  5028
                on:dontShowAgain.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5029
        ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5030
    ] do:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5031
        answer := OptionBox 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5032
                      request:msg withCRs
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5033
                      label:(resources string:'Really CheckIn ?')
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5034
                      image:(InfoBox iconBitmap)
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  5035
                      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
  5036
                      values:values
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5037
                      default:defaultAnswer
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5038
                      onCancel:nil.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5039
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5040
    answer isNil ifTrue:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  5041
        AbortOperationRequest raise.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5042
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5043
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5044
    dontShowAgain notNil ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5045
        checkAgainHolder value:dontShowAgain value not 
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  5046
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5047
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5048
    answer == #noBrowse ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5049
        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
  5050
        self yesToAllNotification queryWith:false.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5051
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5052
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5053
    answer == #cancelAll ifTrue:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  5054
        AbortOperationRequest raise.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5055
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5056
    answer == #yesToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5057
        YesToAllNotification queryWith:true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5058
        ^ true
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5059
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5060
    answer == #noToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5061
        YesToAllNotification queryWith:false.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5062
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5063
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5064
    ^ answer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5065
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5066
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5067
     self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities)  
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5068
    "
2775
d1908ae4aed8 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2774
diff changeset
  5069
d1908ae4aed8 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2774
diff changeset
  5070
    "Modified: / 28-02-2012 / 10:41:38 / cg"
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5071
!
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5072
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5073
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5074
    "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
  5075
     and other info (mark as stable, for example).
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5076
     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
  5077
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5078
    ^ self
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5079
        getCheckinInfoFor:aClassNameOrPackageNameString 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5080
        initialAnswer:initialAnswerOrNil
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5081
        withQuickOption:false
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5082
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5083
    "
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5084
     SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5085
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5086
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5087
    "Modified: / 06-07-2010 / 11:22:15 / cg"
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5088
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5089
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5090
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5091
    "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
  5092
     and other info (mark as stable, for example).
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5093
     Return the info-object (actually: the dialog) or nil if aborted."
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5094
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5095
    ^  self 
4079
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  5096
        getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil 
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  5097
        withQuickOption:withQuickOption
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5098
        withValidateConsistencyOption:false
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5099
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5100
    "
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5101
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5102
    "
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5103
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5104
    "Modified: / 12-03-2012 / 13:12:40 / cg"
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5105
!
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5106
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5107
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption withValidateConsistencyOption:withValidateConsistencyOption
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5108
    "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
  5109
     and other info (mark as stable, for example).
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5110
     Return the info-object (actually: the dialog) or nil if aborted."
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5111
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5112
    |logMsg infoDialog|
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5113
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5114
    infoDialog := Tools::CheckinInfoDialog 
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5115
                    getCheckinInfoFor:aClassNameOrPackageNameString 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5116
                    initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage)
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5117
                    withQuickOption:withQuickOption
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5118
                    logHistory:(LastSourceLogMessages ? #())
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5119
                    withValidateConsistencyOption:withValidateConsistencyOption.
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5120
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5121
    infoDialog notNil ifTrue:[
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5122
        logMsg := infoDialog logMessage.
2284
624993d61344 comment
Claus Gittinger <cg@exept.de>
parents: 2283
diff changeset
  5123
        logMsg notEmptyOrNil ifTrue:[
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5124
            LastSourceLogMessage := logMsg.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5125
            LastSourceLogMessages isNil ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5126
                LastSourceLogMessages := OrderedCollection new.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5127
            ].
2796
78401b160a28 changed: #getCheckinInfoFor:initialAnswer:withQuickOption:
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  5128
            LastSourceLogMessages remove:logMsg ifAbsent:[].
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5129
            LastSourceLogMessages addFirst:logMsg.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5130
            LastSourceLogMessages size > 10 ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5131
                LastSourceLogMessages removeLast
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5132
            ].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5133
        ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5134
    ].
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5135
    ^ infoDialog
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5136
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5137
    "
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5138
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5139
    "
1501
6bb154127b0f CheckInDialog class moved
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
  5140
2796
78401b160a28 changed: #getCheckinInfoFor:initialAnswer:withQuickOption:
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  5141
    "Modified: / 12-03-2012 / 13:12:40 / cg"
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5142
!
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5143
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5144
revisionForSymbolicName:tag class:cls fileName:classFileName directory:packageDir module:moduleDir manager:aSourceCodeManager
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5145
    "given a tag, return the corresponding revision"
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5146
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5147
    |partialLog symbolicNames|
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5148
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5149
    partialLog := aSourceCodeManager
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5150
        revisionLogOf:cls
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5151
        numberOfRevisions:20
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5152
        fileName:classFileName
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5153
        directory:packageDir 
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5154
        module:moduleDir.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5155
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5156
    partialLog notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5157
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5158
        symbolicNames notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5159
            ^ symbolicNames at:tag ifAbsent:nil
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5160
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5161
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5162
    ^ nil
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5163
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5164
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5165
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5166
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  5167
version
3892
3e7000585011 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
  5168
    ^ '$Header$'
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  5169
!
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  5170
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  5171
version_CVS
3892
3e7000585011 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
  5172
    ^ '$Header$'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5173
! !
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  5174