SourceCodeManagerUtilities.st
author Claus Gittinger <cg@exept.de>
Mon, 16 Dec 2019 11:37:59 +0100
changeset 4529 c8d82fe47b03
parent 4528 fbb7b72cedbe
child 4537 4a2fd1c625fc
permissions -rw-r--r--
#BUGFIX by cg class: AbstractSourceCodeManager class changed: #knownTagsFor:
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
4448
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
    20
		LastTag LastComparedTag AlwaysUpdateVersionMethodsIfNoOtherChange
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
    21
		DoNotAskForCondenseIfSameAsRepository'
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    22
	poolDictionaries:''
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    23
	category:'System-SourceCodeManagement'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    28
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    29
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    30
 COPYRIGHT (c) 2000 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    31
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    32
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    33
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    34
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    36
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    37
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    38
 hereby transferred.
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
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 893
diff changeset
    42
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
documentation
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    utility code which is useful at more than one place
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    (extracted from the browser)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    [author:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        Claus Gittinger (cg@exept)
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [see also:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    [instance variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    [class variables:]
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
"
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
! !
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    59
!SourceCodeManagerUtilities class methodsFor:'instance creation'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    60
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    61
forManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    62
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    63
    ^self new setManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    64
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    65
    "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
    66
!
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    67
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    68
new
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    69
    "return an initialized instance"
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    70
2969
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    71
    self == SourceCodeManagerUtilities ifTrue:[ 
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    72
        self abstractClassInstantiationError
3549ac095c10 changed: #new
Claus Gittinger <cg@exept.de>
parents: 2950
diff changeset
    73
    ].
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
    74
    ^ self basicNew initialize.
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    75
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
    76
    "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
    77
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    78
992
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    79
!SourceCodeManagerUtilities class methodsFor:'Signal constants'!
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    80
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    81
yesToAllNotification
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    82
    YesToAllNotification isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    83
        YesToAllNotification := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    84
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    85
    ^ YesToAllNotification
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
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    88
yesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    89
    YesToAllQuery isNil ifTrue:[
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    90
        YesToAllQuery := QuerySignal new.
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    91
    ].
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    92
    ^ YesToAllQuery
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    93
! !
83f257a4fa0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    94
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    95
!SourceCodeManagerUtilities class methodsFor:'accessing'!
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    96
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    97
default
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
    98
3635
765b567f596a oops - a global variable named "Default" was introduced
Claus Gittinger <cg@exept.de>
parents: 3633
diff changeset
    99
    DefaultUtilities isNil ifTrue:[DefaultUtilities := SourceCodeManagerUtilitiesForContainerBasedManagers new].
3642
28683778b9c3 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3635
diff changeset
   100
    ^ DefaultUtilities
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   101
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   102
    "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
   103
    "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
   104
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   105
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   106
lastModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   107
    "return the value of the static variable 'LastModule' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   108
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   109
    ^ LastModule
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
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   112
lastModule:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   113
    "set the value of the static variable 'LastModule' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   114
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   115
    LastModule := something.
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
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   118
lastPackage
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   119
    "return the value of the static variable 'LastPackage' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   120
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   121
    ^ LastPackage
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
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   124
lastPackage:something
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   125
    "set the value of the static variable 'LastPackage' (automatically generated)"
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   126
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   127
    LastPackage := something.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   128
! !
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   129
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   130
!SourceCodeManagerUtilities class methodsFor:'error handling'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   131
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   132
doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   133
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   134
    (self default respondsTo: aMessage selector) ifTrue:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   135
        "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
   136
        self breakPoint: #jv.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   137
        self breakPoint: #cg.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   138
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   139
        ^aMessage sendTo: self default
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   140
    ] ifFalse:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   141
        ^super doesNotUnderstand: aMessage
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   144
    "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
   145
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   146
2569
vrany
parents: 2556
diff changeset
   147
!SourceCodeManagerUtilities class methodsFor:'private-migration'!
vrany
parents: 2556
diff changeset
   148
vrany
parents: 2556
diff changeset
   149
compileForwarders
vrany
parents: 2556
diff changeset
   150
vrany
parents: 2556
diff changeset
   151
    "Utility method"
vrany
parents: 2556
diff changeset
   152
vrany
parents: 2556
diff changeset
   153
    "
vrany
parents: 2556
diff changeset
   154
        SourceCodeManagerUtilities compileForwarders.
vrany
parents: 2556
diff changeset
   155
    "
vrany
parents: 2556
diff changeset
   156
vrany
parents: 2556
diff changeset
   157
    self methodsDo:[:m|
vrany
parents: 2556
diff changeset
   158
        | sel |
vrany
parents: 2556
diff changeset
   159
        sel := m selector.
vrany
parents: 2556
diff changeset
   160
        ((self class includesSelector: sel) and: [(self class >> sel) source = m source]) ifTrue:[
vrany
parents: 2556
diff changeset
   161
            | source header |
vrany
parents: 2556
diff changeset
   162
vrany
parents: 2556
diff changeset
   163
            header := m source asStringCollection first.
vrany
parents: 2556
diff changeset
   164
            source := '%1
vrany
parents: 2556
diff changeset
   165
vrany
parents: 2556
diff changeset
   166
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   167
vrany
parents: 2556
diff changeset
   168
    self obsoleteMethodWarning: ''Please use instance protocol (SourceCodeManagerUtilities default doSomething)''.
vrany
parents: 2556
diff changeset
   169
vrany
parents: 2556
diff changeset
   170
    ^self default %1' bindWith: header with: header.
vrany
parents: 2556
diff changeset
   171
vrany
parents: 2556
diff changeset
   172
            self halt: 'Inspect source'.
vrany
parents: 2556
diff changeset
   173
            self class compile: source classified: m category.    
vrany
parents: 2556
diff changeset
   174
        ].
vrany
parents: 2556
diff changeset
   175
            
vrany
parents: 2556
diff changeset
   176
    ]
vrany
parents: 2556
diff changeset
   177
vrany
parents: 2556
diff changeset
   178
    "Created: / 11-10-2011 / 10:55:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2556
diff changeset
   179
! !
vrany
parents: 2556
diff changeset
   180
1806
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   181
!SourceCodeManagerUtilities class methodsFor:'resources'!
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   182
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   183
resourcePackage
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   184
    ^ #'stx:libtool'
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   185
! !
fdcaa790756a resources from libtool
Claus Gittinger <cg@exept.de>
parents: 1800
diff changeset
   186
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
!SourceCodeManagerUtilities class methodsFor:'utilities'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   189
classIsNotYetInRepository:aClass withManager:mgr
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   190
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   191
    <resource: #obsolete>
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   192
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   193
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   194
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   195
    ^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
   196
!
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
   197
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
   198
nameOfExtensionsContainer
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   199
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   200
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   201
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   202
    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
   203
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   204
    ^self default nameOfExtensionsContainer
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   207
setPackageOfAllMethodsIn:aClass to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   208
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   209
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   210
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   211
    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
   212
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   213
    ^self default setPackageOfAllMethodsIn:aClass to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   214
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   215
    "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
   216
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   217
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   218
setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   219
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   220
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   221
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   222
    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
   223
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   224
    ^self default setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   225
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   226
    "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
   227
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   228
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   229
sourceCodeManagerFor:aClass
3370
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   230
    |mgr assumption|
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   231
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   232
    mgr := aClass theNonMetaclass sourceCodeManager.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   233
    mgr isNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   234
        SourceCodeManager isNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   235
            "/ 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
   236
            ^ nil.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   237
        ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   238
        assumption := AbstractSourceCodeManager defaultManager ? CVSSourceCodeManager.
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   239
        assumption notNil ifTrue:[
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   240
            (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
   241
                ^ nil
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   242
            ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   243
            mgr := assumption.
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
    ].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
   246
    ^ mgr
2556
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   249
sourceCodeOfClass:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   250
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   251
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   252
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   253
    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
   254
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   255
    ^self default sourceCodeOfClass:aClass
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   258
versionString:a isLessThan:b
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   259
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   260
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   261
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   262
    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
   263
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   264
    ^self default versionString:a isLessThan:b
4436
63490a8e62a7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4421
diff changeset
   265
63490a8e62a7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4421
diff changeset
   266
    "
63490a8e62a7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4421
diff changeset
   267
     SourceCodeManagerUtilities default versionString:'1.10.2' isLessThan:'1.100.1'
63490a8e62a7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4421
diff changeset
   268
    "
63490a8e62a7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4421
diff changeset
   269
63490a8e62a7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4421
diff changeset
   270
    "Modified (comment): / 28-05-2019 / 15:47:35 / Claus Gittinger"
2556
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   273
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   274
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   275
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   276
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   277
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   278
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   279
    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
   280
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   281
    ^self default changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   282
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   283
    "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
   284
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   285
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   286
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
   287
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   288
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   289
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   290
    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
   291
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   292
    ^self default 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   293
        changeSetForExtensionMethodsForPackage:packageToCheckOut 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   294
        revision:revisionOrNil 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   295
        orAskForRevision:askForRevision 
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   296
        usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   297
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   298
    "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
   299
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   300
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   301
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
   302
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   303
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   304
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   305
    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
   306
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   307
    ^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
   308
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   309
    "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
   310
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   311
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   312
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
   313
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   314
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   315
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   316
    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
   317
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   318
    ^self default checkForExistingModule:module directory:directory usingManager:mgr allowCreate:allowCreate
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   319
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   320
    "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
   321
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   322
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   323
checkForExistingModule:module usingManager:mgr allowCreate:allowCreate
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   324
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   325
    <resource: #obsolete>
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
    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
   328
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   329
    ^self default checkForExistingModule:module usingManager:mgr allowCreate:allowCreate
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   330
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   331
    "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
   332
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   333
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   334
checkinClass:aClass
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
    <resource: #obsolete>
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
    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
   339
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   340
    ^self default checkinClass:aClass
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   343
checkinClass:aClass withInfo:aLogInfoOrNil
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
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   346
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   347
    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
   348
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   349
    ^self default checkinClass:aClass withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   350
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   351
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   352
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass
2569
vrany
parents: 2556
diff changeset
   353
vrany
parents: 2556
diff changeset
   354
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   355
vrany
parents: 2556
diff changeset
   356
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   357
vrany
parents: 2556
diff changeset
   358
    ^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
   359
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   360
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   361
checkinClasses:aCollectionOfClass
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
    <resource: #obsolete>
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
    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
   366
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   367
    ^self default checkinClasses:aCollectionOfClass
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   370
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
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
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   373
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   374
    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
   375
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   376
    ^self default checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   377
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   378
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   379
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   380
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   381
    <resource: #obsolete>
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   382
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   383
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   384
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   385
    ^self default checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   386
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   387
    "Created: / 05-12-2017 / 20:15:04 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   388
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   389
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   390
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses
2569
vrany
parents: 2556
diff changeset
   391
vrany
parents: 2556
diff changeset
   392
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   393
vrany
parents: 2556
diff changeset
   394
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   395
vrany
parents: 2556
diff changeset
   396
    ^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
   397
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   398
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   399
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   400
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   401
    <resource: #obsolete>
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   402
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   403
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   404
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   405
    ^self default checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   406
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   407
    "Created: / 05-12-2017 / 20:15:55 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   408
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   409
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   410
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
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
    <resource: #obsolete>
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 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
   415
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   416
    ^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
   417
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   418
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   419
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   420
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   421
    <resource: #obsolete>
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   422
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   423
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   424
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   425
    ^self default checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   426
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   427
    "Created: / 05-12-2017 / 20:13:44 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   428
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
   429
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   430
checkoutClass:aClass askForMerge:askForMerge
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
    <resource: #obsolete>
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 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
   435
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   436
    ^self default checkoutClass:aClass askForMerge:askForMerge
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   437
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   438
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   439
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
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
    <resource: #obsolete>
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 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
   444
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   445
    ^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
   446
!
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
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
   449
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   450
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   451
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   452
    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
   453
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   454
    ^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
   455
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   456
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   457
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
   458
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   459
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   460
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   461
    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
   462
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   463
    ^self default checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   464
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   465
    "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
   466
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   467
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   468
compareClassWithRepository:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   469
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   470
    <resource: #obsolete>
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
    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
   473
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   474
    ^self default compareClassWithRepository:aClass
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   475
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   476
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   477
compareClassWithRepository:aClass askForRevision:askForRevision
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   478
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   479
    <resource: #obsolete>
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
    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
   482
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   483
    ^self default compareClassWithRepository:aClass askForRevision:askForRevision
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   484
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   485
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   486
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
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
    <resource: #obsolete>
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
    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
   491
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   492
    ^self compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   493
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   494
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   495
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   496
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   497
    <resource: #obsolete>
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   498
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   499
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   500
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   501
    ^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
   502
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   503
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   504
compareProjectWithRepository:aProject
2569
vrany
parents: 2556
diff changeset
   505
vrany
parents: 2556
diff changeset
   506
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   507
vrany
parents: 2556
diff changeset
   508
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   509
vrany
parents: 2556
diff changeset
   510
    ^self default compareProjectWithRepository:aProject
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   511
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   512
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   513
createSourceContainerForClass:aClass
2569
vrany
parents: 2556
diff changeset
   514
vrany
parents: 2556
diff changeset
   515
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   516
vrany
parents: 2556
diff changeset
   517
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   518
vrany
parents: 2556
diff changeset
   519
    ^self default createSourceContainerForClass:aClass
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   520
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   521
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   522
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
   523
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   524
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   525
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   526
    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
   527
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   528
    ^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
   529
!
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
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   532
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   533
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   534
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   535
    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
   536
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   537
    ^self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   538
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   539
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   540
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   541
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   542
    <resource: #obsolete>
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   543
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   544
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   545
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   546
    ^self default 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   547
        diffSetOfProject:aProject 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   548
        againstRepositoryVersionFrom:aDateOrNilForNewest 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   549
        extensionsOnly:extensionsOnly
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   550
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   551
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   552
ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
2556
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
    <resource: #obsolete>
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 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
   557
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   558
    ^self default ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   559
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   560
    "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
   561
!
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
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil forClass:aClass valuesInto:aBlock
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
    <resource: #obsolete>
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
    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
   568
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   569
    ^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
   570
!
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
removeSourceContainerForClass:aClass
2569
vrany
parents: 2556
diff changeset
   573
vrany
parents: 2556
diff changeset
   574
    <resource: #obsolete>
vrany
parents: 2556
diff changeset
   575
vrany
parents: 2556
diff changeset
   576
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
vrany
parents: 2556
diff changeset
   577
vrany
parents: 2556
diff changeset
   578
    ^self default removeSourceContainerForClass:aClass
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   579
!
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
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
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
    <resource: #obsolete>
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
    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
   586
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   587
    ^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
   588
!
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
repositoryLogOf:aClass onto:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   591
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   592
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   593
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   594
    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
   595
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   596
    ^self default repositoryLogOf:aClass onto:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   597
!
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
repositoryLogOf:aClass short:shortOrNot onto:aStream
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 repositoryLogOf:aClass short:shortOrNot onto:aStream
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
tagClass:aClass as:tag
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
    <resource: #obsolete>
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
    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
   613
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   614
    ^self default tagClass:aClass as:tag
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
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   617
tagClasses:aCollectionOfClasses as:tag
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
    <resource: #obsolete>
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
    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
   622
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   623
    ^self default tagClasses:aCollectionOfClasses as:tag
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
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   626
tagPath:aPath as:tag usingManager:aManager
2556
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
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   629
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   630
    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
   631
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   632
    ^self default tagPath:aPath as:tag usingManager:aManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   633
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   634
    "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
   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
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-helpers'!
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
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
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
    <resource: #obsolete>
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 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
   644
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   645
    ^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
   646
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   647
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   648
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-user interaction'!
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
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
   651
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   652
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   653
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   654
    self 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
   655
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   656
    ^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
   657
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   658
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   659
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
   660
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   661
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   662
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   663
    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
   664
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   665
    ^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
   666
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   667
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   668
askForExistingRevision:boxText title:title class:aClass
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   669
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   670
    <resource: #obsolete>
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   671
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   672
    self obsoleteMethodWarning: 'Please use instance protocol (SourceCodeManagerUtilities default doSomething)'.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   673
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
   674
    ^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
   675
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   676
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   677
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
   678
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   679
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   680
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   681
    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
   682
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   683
    ^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
   684
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   685
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   686
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   687
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   688
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   689
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   690
    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
   691
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   692
    ^self default checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   693
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   694
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   695
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   696
    ^self default 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   697
        getCheckinInfoFor:aClassNameOrPackageNameString     
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   698
        initialAnswer:initialAnswerOrNil
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   699
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   700
    "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
   701
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   702
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   703
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   704
    ^self default 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   705
        getCheckinInfoFor:aClassNameOrPackageNameString 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   706
        initialAnswer:initialAnswerOrNil 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   707
        withQuickOption:withQuickOption
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   708
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   709
    "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
   710
!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   711
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   712
goodInitialLogMessageForCheckinClassOfClass:aClass
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   713
    "figure out, if there were any non-comment changes. 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   714
     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
   715
     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
   716
     info line, even if the selector was removed afterwards).
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   717
     So check the outcome."
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   718
4301
14f350f36eea #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   719
    |printSelectors initialLogStream additionalInfoPerChangedSelector changesForThisCheckin changesPerClass|
4230
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
    "/ a helper function
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   722
    printSelectors := 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   723
        [:what :selectors :more |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   724
            |sel moreInfo|
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
            selectors remove:nil ifAbsent:[].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   727
            initialLogStream nextPutAll:(what,':').
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   728
            selectors size < 15 ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   729
                selectors size == 1 ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   730
                    sel := selectors first.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   731
                    initialLogStream nextPutAll: ' #'; nextPutAll:sel.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   732
                    more ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   733
                        (moreInfo := additionalInfoPerChangedSelector at:sel ifAbsent:nil) notNil ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   734
                            initialLogStream space; nextPutAll:moreInfo.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   735
                        ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   736
                    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   737
                    initialLogStream cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   738
                ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   739
                    initialLogStream cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   740
                    selectors asSortedCollection do:[:sel | 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   741
                        initialLogStream tab; nextPutAll:'#'; nextPutAll:sel. 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   742
                        more ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   743
                            (moreInfo := additionalInfoPerChangedSelector at:sel ifAbsent:nil) notNil ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   744
                                initialLogStream space; nextPutAll:moreInfo.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   745
                            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   746
                        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   747
                        initialLogStream cr
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   748
                    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   749
                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   750
            ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   751
                initialLogStream 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   752
                    print: (selectors size); nextPutAll: ' methods'; cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   753
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   754
        ].
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
    changesForThisCheckin := ChangeSet current 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   757
                                select:[:aChange | 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   758
                                    |changeClass|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   759
4241
6aa29eece1bb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   760
                                    aChange isClassChange 
6aa29eece1bb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   761
                                    and:[ aChange changeClass notNil
6aa29eece1bb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   762
                                    and:[
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   763
                                        changeClass := aChange changeClass theNonMetaclass.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   764
                                        changeClass == aClass or:[changeClass topOwningClass == aClass]
4241
6aa29eece1bb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   765
                                    ]].
4230
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
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   768
    changesForThisCheckin sort:[:a :b| a className < b className].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   769
    changesPerClass := changesForThisCheckin asCollectionOfSubCollectionsSeparatedByAnyChange:[:prev :curr| prev className ~= curr className].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   770
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   771
    initialLogStream := '' writeStream.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   772
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   773
    changesPerClass do:[:changesForThisClass|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   774
        |selectorsInChangeSet newSelectors modifiedSelectors definitionChangesForThisClass methodChangesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   775
         allMethodChangesForThisClass modifiedMethodsForThisClass newMethodsForThisClass removedMethodsForThisClass
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   776
         selectorsWithCommentOrFormattingChangeOnly
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   777
         selectorsWithVariableChangeOnly newSelectorsRemoved
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   778
         removedSelectors categoryChanges categoryChangeSelectors|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   779
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   780
        additionalInfoPerChangedSelector := Dictionary new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   781
        definitionChangesForThisClass := changesForThisClass reject:[:aChange | aChange isMethodChange].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   782
        categoryChanges := changesForThisClass select:[:aChange | aChange isMethodCategoryChange]. 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   783
        categoryChangeSelectors := categoryChanges collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   784
        allMethodChangesForThisClass := changesForThisClass select:[:aChange | aChange isMethodCodeChange].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   785
        selectorsInChangeSet := allMethodChangesForThisClass collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   786
        methodChangesForThisClass := selectorsInChangeSet collect:[:eachSelector |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   787
                                            allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector]] as:OrderedCollection.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   788
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   789
        modifiedMethodsForThisClass := methodChangesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   790
                                    select:[:aChange | aChange previousVersion notNil].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   791
        modifiedSelectors := modifiedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
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
        newMethodsForThisClass := allMethodChangesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   794
                                    select:[:aChange | aChange previousVersion isNil].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   795
        newSelectors := newMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   796
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   797
        removedMethodsForThisClass := changesForThisClass 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   798
                                    select:[:aChange | aChange isMethodRemoveChange and:[ aChange changeMethod isNil ]].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   799
        removedSelectors := removedMethodsForThisClass collect:[:aChange | aChange changeSelector] as:Set.
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
        "/ get rid of category changes for new and removed methods
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   802
        categoryChanges := categoryChanges reject:[:chg |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   803
                                |methodWithChangedCat|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   804
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   805
                                (methodWithChangedCat := chg changeMethod) isNil
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   806
                                or:[ newMethodsForThisClass contains:[:newChg | newChg changeMethod = methodWithChangedCat]]].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   807
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   808
        initialLogStream nextPutLine:'class: ', changesForThisClass first className.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   809
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   810
        "/ definition?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   811
        "/ suppress definition-message if initial checkin
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   812
        (aClass package isNil or:[aClass revision isNil]) ifFalse:[ 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   813
            definitionChangesForThisClass notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   814
                "/ self halt.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   815
                initialLogStream nextPutLine:'class definition'.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   816
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   817
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   818
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   819
        "/ added selectors?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   820
        newSelectorsRemoved := newSelectors select:[:sel | removedSelectors includes:sel].
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
        newSelectors removeAllFoundIn:removedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   823
        newSelectors notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   824
            printSelectors value:'added' value:newSelectors value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   825
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   826
        modifiedSelectors removeAllFoundIn:newSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   827
        categoryChangeSelectors removeAllFoundIn:newSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   828
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   829
        "/ removed selectors?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   830
        removedSelectors removeAllFoundIn:newSelectorsRemoved.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   831
        removedSelectors notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   832
            printSelectors value:'removed' value:removedSelectors value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   833
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   834
        modifiedSelectors removeAllFoundIn:removedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   835
        categoryChangeSelectors removeAllFoundIn:removedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   836
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   837
        "/ modifications?
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   838
        modifiedSelectors notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   839
            selectorsWithCommentOrFormattingChangeOnly := Set new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   840
            selectorsWithVariableChangeOnly := Set new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   841
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   842
            "/ check for format/comment change
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   843
            RBParser notNil ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   844
                modifiedSelectors do:[:eachSelector |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   845
                    |oldest newest oldMethod newMethod oldTree newTree 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   846
                     variableMapping selectorMapping unchangedVariables unchangedSelectors|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   847
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   848
                    (newSelectors includes:eachSelector) ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   849
                        oldest := allMethodChangesForThisClass detect:[:change | change changeSelector = eachSelector].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   850
                        newest := allMethodChangesForThisClass detectLast:[:change | change changeSelector = eachSelector].
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
                        oldest := oldest previousVersion notNil ifTrue:[oldest previousVersion] ifFalse:[oldest].
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
                        oldTree := RBParser parseMethod:oldest source onError:[:aString :pos | nil].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   855
                        newTree := RBParser parseMethod:newest source onError:[:aString :pos | nil].
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
                        (oldTree notNil and:[newTree notNil]) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   858
                            variableMapping := Dictionary new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   859
                            (oldTree "semanticallyEqualTo:" equalTo:newTree withMapping: variableMapping) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   860
                                unchangedVariables := variableMapping keys select:[:k | (variableMapping at:k) = k].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   861
                                variableMapping removeAllKeys:unchangedVariables.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   862
4301
14f350f36eea #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   863
                                (((variableMapping at:'self' ifAbsent:'self') = 'self')
14f350f36eea #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   864
                                and:[ (variableMapping keyAtEqualValue:'self' ifAbsent:'self') = 'self']) ifTrue:[
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   865
                                    ((variableMapping associations count:[:assoc | assoc key ~= assoc value]) == 0) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   866
                                        selectorsWithCommentOrFormattingChangeOnly add:eachSelector.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   867
                                    ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   868
                                        "/ check, if a global has changed (aka sends to another global)
4245
97f781d28031 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4241
diff changeset
   869
                                        ((variableMapping keys contains:[:var | var isUppercaseFirst])
97f781d28031 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4241
diff changeset
   870
                                        or:[ (variableMapping values contains:[:var | var isUppercaseFirst]) ]) ifFalse:[
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   871
                                            selectorsWithVariableChangeOnly add:eachSelector.
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
                                    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   874
                                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   875
                            ] ifFalse:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   876
                                selectorMapping := Dictionary new.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   877
                                (oldTree equalTo:newTree withSelectorMapping: selectorMapping) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   878
                                    unchangedSelectors := selectorMapping keys select:[:k | (selectorMapping at:k) = k].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   879
                                    selectorMapping removeAllKeys:unchangedSelectors.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   880
                                    (selectorMapping notEmpty and:[selectorMapping size <= 2]) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   881
                                        additionalInfoPerChangedSelector at:eachSelector put:(
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   882
                                            String streamContents:[:s |
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   883
                                                |first|
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   884
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   885
                                                s nextPutAll:'('.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   886
                                                first := true.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   887
                                                selectorMapping keysAndValuesDo:[:selOld :selNew | 
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   888
                                                    first ifFalse:[s nextPutAll:', '].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   889
                                                    s print:('send #',selNew,' instead of #',selOld).
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   890
                                                    first := false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   891
                                                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   892
                                                s nextPutAll:')'.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   893
                                            ]).
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   894
                                    ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   895
                                ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   896
                            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   897
                        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   898
                    ]
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   899
                ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   900
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   901
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   902
            modifiedSelectors removeAllFoundIn:selectorsWithCommentOrFormattingChangeOnly.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   903
            modifiedSelectors removeAllFoundIn:selectorsWithVariableChangeOnly.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   904
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   905
            (selectorsWithCommentOrFormattingChangeOnly notEmpty) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   906
                printSelectors value:'comment/format in' value:selectorsWithCommentOrFormattingChangeOnly value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   907
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   908
            (selectorsWithVariableChangeOnly notEmpty) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   909
                printSelectors value:'variable renamed in' value:selectorsWithVariableChangeOnly value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   910
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   911
            (modifiedSelectors notEmpty) ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   912
                printSelectors value:'changed' value:modifiedSelectors value:true.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   913
            ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   914
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   915
        categoryChanges notEmpty ifTrue:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   916
            printSelectors value:'category of' value:categoryChangeSelectors value:false.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   917
        ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   918
    ] separatedBy:[
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   919
        initialLogStream cr.
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   920
    ].
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   921
    ^ initialLogStream contents
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   922
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
   923
    "Modified: / 17-03-2017 / 18:39:28 / stefan"
4245
97f781d28031 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4241
diff changeset
   924
    "Modified: / 22-06-2017 / 06:54:44 / cg"
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   925
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   926
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   927
!SourceCodeManagerUtilities class methodsFor:'utilities-encoding'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   928
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   929
guessEncodingOfFile:aFilename
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   930
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   931
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   932
2818
82c73234ac2d changed: #guessEncodingOfFile:
Stefan Vogel <sv@exept.de>
parents: 2817
diff changeset
   933
    self obsoleteMethodWarning:'ask CharacterEncoder'.
82c73234ac2d changed: #guessEncodingOfFile:
Stefan Vogel <sv@exept.de>
parents: 2817
diff changeset
   934
    ^ CharacterEncoder guessEncodingOfFile:aFilename
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   935
!
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
guessEncodingOfStream:aStream
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   938
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   939
    <resource: #obsolete>
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   940
2817
8a836ca902d4 changed: #guessEncodingOfStream:
Stefan Vogel <sv@exept.de>
parents: 2796
diff changeset
   941
    self obsoleteMethodWarning:'ask CharacterEncoder'.
8a836ca902d4 changed: #guessEncodingOfStream:
Stefan Vogel <sv@exept.de>
parents: 2796
diff changeset
   942
    ^ CharacterEncoder guessEncodingOfStream:aStream
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   943
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   944
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   945
!SourceCodeManagerUtilities methodsFor:'accessing'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   946
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   947
confirmNewFiles:aBoolean
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   948
    "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
   949
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   950
    confirmNewFiles := aBoolean.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   951
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   952
    "Modified (comment): / 24-07-2012 / 18:18:34 / cg"
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   953
!
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
   954
4515
811b98a61c23 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4513
diff changeset
   955
defaultManager
811b98a61c23 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4513
diff changeset
   956
    ^ manager
811b98a61c23 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4513
diff changeset
   957
811b98a61c23 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4513
diff changeset
   958
    "Created: / 22-12-2011 / 10:59:28 / cg"
811b98a61c23 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4513
diff changeset
   959
!
811b98a61c23 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4513
diff changeset
   960
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   961
lastSourceLogMessageHeadlines
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   962
    LastSourceLogMessage isNil ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   963
        LastSourceLogMessages := OrderedCollection new.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   964
    ].
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   965
    ^ LastSourceLogMessages 
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   966
        collect:[:msg |
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   967
            msg withoutLeadingSeparators asCollectionOfLines first , '...'
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   968
        ]
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   969
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   970
    "Created: / 12-03-2012 / 12:34:35 / cg"
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   971
!
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
   972
2569
vrany
parents: 2556
diff changeset
   973
yesToAllNotification
vrany
parents: 2556
diff changeset
   974
vrany
parents: 2556
diff changeset
   975
    ^self class yesToAllNotification
vrany
parents: 2556
diff changeset
   976
vrany
parents: 2556
diff changeset
   977
    "Created: / 11-10-2011 / 12:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2556
diff changeset
   978
!
vrany
parents: 2556
diff changeset
   979
vrany
parents: 2556
diff changeset
   980
yesToAllQuery
vrany
parents: 2556
diff changeset
   981
vrany
parents: 2556
diff changeset
   982
    ^self class yesToAllQuery
vrany
parents: 2556
diff changeset
   983
vrany
parents: 2556
diff changeset
   984
    "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
   985
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   986
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   987
!SourceCodeManagerUtilities methodsFor:'error handling'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   988
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   989
doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   990
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   991
    (self class respondsTo: aMessage selector) ifTrue:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   992
        "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
   993
        self breakPoint: #jv.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   994
        self breakPoint: #cg.
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   995
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   996
        ^aMessage sendTo: self class
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   997
    ] ifFalse:[
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   998
        ^super doesNotUnderstand: aMessage
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
   999
    ]
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1000
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1001
    "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
  1002
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1003
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1004
!SourceCodeManagerUtilities methodsFor:'initialization'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1005
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
  1006
initialize
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1007
    confirmNewFiles := true.
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  1008
    resources := self class classResources.
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
  1009
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
  1010
    "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
  1011
    "Modified: / 24-07-2012 / 18:17:57 / cg"
2597
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
  1012
!
fcb5d74b32d2 More code moved from Tools::NewSystemBrowser to SourceCodeManagerUtilities
vrany
parents: 2596
diff changeset
  1013
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1014
setManager: aSourceCodeManager
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1015
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1016
    manager := aSourceCodeManager.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1017
    manager isContainerBased ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1018
        confirmNewFiles isNil "not yet set by user" ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1019
            confirmNewFiles := false.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1020
        ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1021
    ].
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1022
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1023
    "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
  1024
    "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
  1025
! !
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1026
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1027
!SourceCodeManagerUtilities methodsFor:'utilities'!
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1028
2569
vrany
parents: 2556
diff changeset
  1029
classIsNotYetInRepository:aClass withManager:mgr
vrany
parents: 2556
diff changeset
  1030
    |info|
vrany
parents: 2556
diff changeset
  1031
vrany
parents: 2556
diff changeset
  1032
    info := mgr sourceInfoOfClass:aClass.
vrany
parents: 2556
diff changeset
  1033
vrany
parents: 2556
diff changeset
  1034
    ^ (info isNil 
vrany
parents: 2556
diff changeset
  1035
    or:[(info at:#fileName ifAbsent:nil) isNil
vrany
parents: 2556
diff changeset
  1036
    or:[(info at:#module ifAbsent:nil) isNil
vrany
parents: 2556
diff changeset
  1037
    or:[(info at:#directory ifAbsent:nil) isNil]]])
vrany
parents: 2556
diff changeset
  1038
vrany
parents: 2556
diff changeset
  1039
    "Created: / 25-10-2006 / 09:43:00 / cg"
vrany
parents: 2556
diff changeset
  1040
!
vrany
parents: 2556
diff changeset
  1041
2556
7d79bba1a1fa Methods moved to an instance side (with forwarding from class side)
vrany
parents: 2539
diff changeset
  1042
nameOfExtensionsContainer
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1043
    ^ 'extensions.st'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1044
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1045
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1046
setPackageOfAllMethodsIn:aClass to:aPackage
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1047
    "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
  1048
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1049
    |anyChange anyChangeHere|
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1050
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1051
    anyChange := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1052
    aClass withAllPrivateClassesDo:[:eachClass |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1053
        anyChangeHere := false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1054
        eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1055
            mthd package ~= aPackage ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1056
                mthd setPackage:aPackage.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1057
                anyChangeHere := true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1058
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1059
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1060
        anyChangeHere ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1061
            eachClass changed:#projectOrganization
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1062
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1063
        anyChangeHere ifTrue:[anyChange := true].
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1064
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1065
    anyChange ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1066
       Smalltalk changed:#projectOrganization
1185
e86907810d1f handle abortAll in checkIn
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1067
    ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1068
    ^ anyChange
893
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1069
!
09543b968f15 added askFor... utility.
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
  1070
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1071
setPackageOfAllMethodsInChangeSet:aChangeSet to:aPackage
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1072
    "make all methods belong to the classes project"
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1073
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1074
    aChangeSet do:[:eachChange |
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1075
        eachChange isMethodCodeChange ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1076
            eachChange changeMethod package ~= aPackage ifTrue:[
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1077
                Transcript showCR:'change package of ',eachChange changeMethod whoString.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1078
                eachChange changeMethod setPackage:aPackage.        
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1079
            ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1080
        ]
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1081
    ].
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1082
!
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  1083
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1084
sourceCodeForExtensions:aCollectionOfMethods package:aPackageID forManager:scmManagerOrNil
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1085
    |s methodsSortedByName defClass|
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1086
3201
f0993e3fdf02 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3199
diff changeset
  1087
    s := CharacterWriteStream on:(String new:1000).
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1088
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1089
    s nextPutAll:'"{ Package: '''.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1090
    s nextPutAll:aPackageID asString.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1091
    s nextPutAll:''' }"'; nextPutChunkSeparator; cr; cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1092
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1093
    "/ 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
  1094
    "/ s nextPutAll:(Smalltalk timeStamp).
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1095
    "/ s nextPutChunkSeparator. 
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1096
    "/ s cr; cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1097
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1098
    "/ sort them by name (to avoid conflicts due to SCM merge)
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1099
    methodsSortedByName := aCollectionOfMethods asOrderedCollection.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1100
    methodsSortedByName sort:[:a :b |
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1101
                                |clsA clsB|
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1102
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1103
                                clsA := a mclass name.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1104
                                clsB := b mclass name.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1105
                                clsA < clsB ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1106
                                    true
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1107
                                ] ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1108
                                    clsA > clsB ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1109
                                        false
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1110
                                    ] ifFalse:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1111
                                        a selector < b selector
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1112
                                    ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1113
                                ]
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1114
                              ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1115
    methodsSortedByName do:[:aMethod |
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1116
        aMethod mclass fileOutMethod:aMethod on:s.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1117
        s cr.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1118
    ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1119
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1120
    scmManagerOrNil notNil ifTrue:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1121
        defClass := ProjectDefinition definitionClassForPackage:aPackageID.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1122
        defClass notNil ifTrue:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1123
            "/ make sure, an extensionVersion_XXX method is included...
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1124
            "/ (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
  1125
            (methodsSortedByName contains:[:aMethod | aMethod selector == scmManagerOrNil nameOfVersionMethodForExtensions]) ifFalse:[
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1126
                s nextPutLine:('!!%1 class methodsFor:''documentation''!!' bindWith:defClass name).
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1127
                s cr.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1128
                s nextChunkPut:
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1129
                    (scmManagerOrNil versionMethodTemplateForSmalltalkFor:(scmManagerOrNil nameOfVersionMethodForExtensions)).
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1130
                s space; nextPutChunkSeparator; cr.
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  1131
            ].
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1132
        ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1133
    ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1134
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1135
    ^ s contents.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1136
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1137
    "Created: / 25-07-2012 / 18:38:05 / cg"
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1138
!
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  1139
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1140
sourceCodeManagerFor:aClass
3370
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
  1141
    manager notNil ifTrue:[^ manager].
9953065c1ea1 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3354
diff changeset
  1142
    ^ self class sourceCodeManagerFor:aClass.    
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1143
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1144
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1145
sourceCodeOfClass:aClass
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1146
    |stream src|
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1147
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1148
    stream := '' writeStream.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1149
    Method flushSourceStreamCache.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1150
    aClass fileOutOn:stream withTimeStamp:false.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1151
    src := stream contents asString.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1152
    stream close.
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  1153
    ^ src
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1154
!
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1155
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1156
validateConsistencyOfPackage:aPackage
3146
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1157
    ^ self validateConsistencyOfPackage:aPackage doClasses:true  doExtensions:true
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1158
!
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1159
4359
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  1160
validateConsistencyOfPackage:aPackageSymbolOrClass doClasses:doClasses doExtensions:doExtensions
3692
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1161
    |checker report msg answer dialog problems numProblems|
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1162
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1163
    "/ also done by ProjectChecker...
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1164
    "/ defClass := aPackage asPackageId projectDefinitionClass.
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1165
    "/ defClass validateDescription.
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1166
3146
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1167
    checker := ProjectChecker new.
913e76c86499 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1168
    checker checkExtensionsOnly:(doClasses not and:[ doExtensions ]).
4456
df14ee79655a #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
  1169
    checker skipCheckClasses:doClasses not.
4359
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  1170
    report := checker check: aPackageSymbolOrClass.
3692
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1171
    (report notNil and:[(problems := report problems) notEmptyOrNil]) ifTrue:[
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1172
        numProblems := problems size.
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1173
        numProblems == 1 ifTrue:[
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1174
            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
  1175
        ] ifFalse:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1176
            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
  1177
        ].
4402
799e4a103839 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1178
        answer := Dialog confirmWithRaiseAbortOnCancel:
799e4a103839 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1179
                                (msg bindWith:numProblems 
799e4a103839 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1180
                                     with:problems first label) withCRs.
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1181
        answer == true ifTrue:[
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1182
            dialog := Tools::ProjectCheckerBrowser new.
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1183
            dialog
4359
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  1184
                projectChecker: (ProjectChecker forPackage: aPackageSymbolOrClass);
3692
ce00ca02e94a class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
  1185
                problemList:problems;
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1186
                showCancel:true;
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1187
                openModal.
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  1188
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1189
            dialog accepted ifFalse:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  1190
                AbortOperationRequest raiseRequest
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1191
            ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1192
        ].
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1193
    ].
4402
799e4a103839 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1194
799e4a103839 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1195
    "Modified: / 15-02-2019 / 09:27:46 / Claus Gittinger"
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1196
!
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  1197
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1198
versionString:a isLessThan:b
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1199
    "compare two strings of the form: a.b.c..."
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1200
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1201
    |i1 i2 a1 b1 restA restB|
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1202
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1203
    restA := a.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1204
    restB := b.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1205
    [
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1206
        i1 := restA indexOf:$. .
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1207
        i2 := restB indexOf:$. .
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1208
        i1 == 0 ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1209
            i1 := restA size + 1.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1210
        ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1211
        i2 == 0 ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1212
            i2 := restB size + 1.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1213
        ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1214
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1215
        a1 := Integer readFrom:(restA copyTo:i1-1).
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1216
        b1 := Integer readFrom:(restB copyTo:i2-1).
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1217
        a1 < b1 ifTrue:[^ true].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1218
        a1 > b1 ifTrue:[^ false].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1219
        restA := (restA copyFrom:i1+1).
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1220
        restB := (restB copyFrom:i2+1).
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1221
        restA isEmpty ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1222
            ^ restB notEmpty
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1223
        ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1224
        restB isEmpty ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1225
            ^ false
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1226
        ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1227
    ] loop.
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1228
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1229
    "
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1230
     self assert:(self default versionString:'12.34.66' isLessThan:'12.35.66').
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1231
     self assert:(self default versionString:'12.34.66' isLessThan:'12.35.67').
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1232
     self assert:(self default versionString:'11.34.66' isLessThan:'12.34.67').
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1233
     self assert:(self default versionString:'11.35.66' isLessThan:'12.34.67').
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1234
     self assert:(self default versionString:'13.35.66' isLessThan:'12.34.67') not.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1235
     self assert:(self default versionString:'13.35.66' isLessThan:'13.34.67') not.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1236
     self assert:(self default versionString:'13.35.66' isLessThan:'13.35.67').
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1237
     self assert:(self default versionString:'13.35.66' isLessThan:'13.35.65') not.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1238
     self assert:(self default versionString:'13.35.66.1' isLessThan:'13.35.66') not.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1239
     self assert:(self default versionString:'13.35.66' isLessThan:'13.35.66.1').
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1240
     self assert:(self default versionString:'13.35.66.2' isLessThan:'13.35.66.1') not.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1241
     self assert:(self default versionString:'13.35.66.1' isLessThan:'13.35.66.2').
2326
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1242
    "
c0b55d3a8f08 added: #versionString:isLessThan:
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1243
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  1244
    "Modified (comment): / 06-12-2017 / 12:21:56 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  1245
! !
1160
d56159f5a86f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
  1246
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1247
!SourceCodeManagerUtilities methodsFor:'utilities-encoding'!
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1248
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1249
guessEncodingOfFile:aFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1250
    "look for a string
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1251
        encoding #name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1252
     or:
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1253
        encoding: name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1254
     within the given buffer 
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1255
     (which is usually the first few bytes of a textFile).
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1256
     If that's not found, use heuristics (in CharacterArray) to guess."
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1257
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1258
    <resource: #obsolete>
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1259
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1260
    self obsoleteMethodWarning:'ask CharacterEncoder'.
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1261
    ^ CharacterEncoder guessEncodingOfFile:aFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1262
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1263
    "
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1264
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1265
     SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1266
    "
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1267
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1268
    "Modified (comment): / 14-01-2012 / 20:54:35 / cg"
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1269
!
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1270
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1271
guessEncodingOfStream:aStream
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1272
    "look for a string of the form
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1273
            encoding #name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1274
     or:
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1275
            encoding: name
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1276
     in the first few bytes of aStream."
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1277
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1278
    <resource: #obsolete>
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1279
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1280
    self obsoleteMethodWarning:'ask CharacterEncoder'.
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1281
    ^ CharacterEncoder guessEncodingOfStream:aStream
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1282
! !
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1283
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  1284
!SourceCodeManagerUtilities methodsFor:'utilities-scm'!
973
b9004b37290a check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1285
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1286
askForPackageVersion:question with:includeSubProjectsHolderOrNil knownTags:knownTags into:aTwoArgBlock
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1287
    |dateFormat string dateOrNil symbolicNameOrNil|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1288
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1289
    dateFormat := UserPreferences current dateInputFormat.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1290
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1291
    Dialog 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1292
        modifyingBoxWith:[:box |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1293
            includeSubProjectsHolderOrNil notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1294
                box verticalPanel 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1295
                    add:(CheckBox label:(resources string:'Include Subprojects')
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1296
                                  model:includeSubProjectsHolderOrNil).
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1297
            ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1298
        ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1299
        do:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1300
            |suggestion|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1301
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1302
            suggestion := LastComparedTag.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1303
            suggestion isNil ifTrue:[ suggestion := Date today printStringFormat:dateFormat ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1304
            
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1305
            string := Dialog
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1306
                        request:(resources string:question with:dateFormat)
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1307
                        initialAnswer:suggestion
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1308
                        list:knownTags.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1309
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1310
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1311
    string notEmptyOrNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1312
        dateOrNil := Date readFrom:string printFormat:dateFormat onError:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1313
        dateOrNil isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1314
            symbolicNameOrNil := string
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1315
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1316
        aTwoArgBlock value:dateOrNil value:symbolicNameOrNil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1317
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1318
    ^ string
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1319
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1320
    "Created: / 04-02-2017 / 18:39:11 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1321
    "Modified: / 05-02-2017 / 04:24:23 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1322
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  1323
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1324
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager
4266
11f91cdde31c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4255
diff changeset
  1325
    "check-out an extension container from the source repository, 
11f91cdde31c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4255
diff changeset
  1326
     and return the methods there as a change set.
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1327
     If askForRevision is false, check-out the newest version.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1328
     Return a changeSet or nil (if any error occurred)"
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1329
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1330
    ^ self
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1331
        changeSetForExtensionMethodsForPackage:packageToCheckOut 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1332
        revision:nil orAskForRevision:askForRevision 
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1333
        usingManager:aSourceCodeManager
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1334
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1335
    "Created: / 29-12-2011 / 14:26:01 / cg"
4266
11f91cdde31c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4255
diff changeset
  1336
    "Modified (comment): / 21-11-2017 / 13:08:54 / cg"
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1337
!
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1338
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1339
changeSetForExtensionMethodsForPackage:packageToCheckOut revision:revisionOrNil orAskForRevision:askForRevision usingManager:aSourceCodeManager
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1340
    "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
  1341
     If askForRevision is false, check-out the newest version.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1342
     Return a changeSet or nil (if any error occurred)"
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1343
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1344
    |directory module file aStream sourceToLoad rev msg newestRev |
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1345
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1346
    directory := packageToCheckOut asPackageId directory.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1347
    module := packageToCheckOut asPackageId module.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1348
    file := self nameOfExtensionsContainer.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1349
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1350
    "/
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1351
    "/ ask for revision
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1352
    "/
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1353
    (rev := revisionOrNil) isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1354
        newestRev := aSourceCodeManager newestRevisionInFile:file directory:directory module:module.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1355
        askForRevision ifFalse:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1356
            rev := newestRev ? ''
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1357
        ] ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1358
            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
  1359
            newestRev notNil ifTrue:[
3261
7a585999dcef class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3259
diff changeset
  1360
                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
  1361
            ].
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1362
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1363
            rev := self
2242
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1364
                    askForExistingRevision:msg 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1365
                    title:'CheckOut from repository' 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1366
                    class:nil 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1367
                    manager:aSourceCodeManager 
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1368
                    module:module package:directory fileName:file.
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1369
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1370
            rev isNil ifTrue:[
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1371
                ^ nil   "/ canceled
8ea64354212d added: #changeSetForExtensionMethodsForPackage:revision:orAskForRevision:using:
Claus Gittinger <cg@exept.de>
parents: 2237
diff changeset
  1372
            ].
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1373
        ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1374
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1375
    rev withoutSpaces isEmpty ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1376
        rev := #newest.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1377
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1378
    ] ifFalse:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1379
        msg := 'extracting previous %1'.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1380
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1381
    aStream := aSourceCodeManager  
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1382
        streamForClass:nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1383
        fileName:file 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1384
        revision:rev 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1385
        directory:directory 
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1386
        module:module
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1387
        cache:true.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1388
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1389
    aStream isNil ifTrue:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1390
        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
  1391
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1392
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1393
    aStream class readErrorSignal handle:[:ex |
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1394
        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
  1395
        aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1396
        ^ nil
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1397
    ] do:[
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1398
        sourceToLoad := aStream contents asString.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1399
    ].
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1400
    aStream close.
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1401
    ^ ChangeSet fromStream:(sourceToLoad readStream).
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1402
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1403
    "Created: / 29-12-2011 / 14:27:00 / cg"
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1404
!
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  1405
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1406
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
  1407
    |moduleName directoryName containerName|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1408
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1409
    moduleName := module allBold.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1410
    directoryName := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1411
    containerName := containerFileName allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1412
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1413
    "/
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1414
    "/ check for the container
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1415
    "/
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1416
    (mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1417
        allowCreate ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1418
            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
  1419
                                   with:containerName with:moduleName with:directoryName) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1420
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1421
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1422
        (Dialog 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1423
            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
  1424
                                 with:containerName with:moduleName with:directoryName) withCRs
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1425
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1426
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1427
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1428
        ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1429
        (mgr createContainerForText:'' inModule:module package:directory container:containerFileName) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1430
            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
  1431
                                 with:containerName with:moduleName with:directoryName).
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1432
            ^ false.
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
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1435
    ^ true.
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1436
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  1437
    "Modified: / 13-09-2006 / 18:24:57 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1438
    "Created: / 29-12-2011 / 14:35:36 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1439
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1440
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1441
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
  1442
    |moduleNameBold directoryNameBold|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1443
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1444
    moduleNameBold := module allBold.
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1445
    directoryNameBold := directory allBold.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1446
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1447
    "/
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1448
    "/ check for the directory
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1449
    "/
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1450
    (mgr checkForExistingModule:module directory:directory) ifFalse:[
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1451
        allowCreate ifFalse:[
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  1452
            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
  1453
                                   with:directoryNameBold with:moduleNameBold) withCRs.
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1454
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1455
        ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1456
        (Dialog 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1457
            confirm:(resources stringWithCRs:'''%1'' is a new directory in module ''%2''.\\Create it in %3?' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1458
                                with:directoryNameBold 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1459
                                with:moduleNameBold
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1460
                                with:mgr managerTypeName)
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1461
            noLabel:'Cancel') 
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1462
        ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1463
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1464
        ].
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1465
        (mgr createModule:module directory:directory) ifFalse:[
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1466
            self warn:(resources stringWithCRs:'Cannot create new directory: ''%1'' in module ''%2'' in %3' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1467
                                 with:directoryNameBold 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1468
                                 with:moduleNameBold
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1469
                                 with:mgr managerTypeName).
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1470
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1471
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1472
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1473
    ^ true.
1840
c993a1c045cc obsolete method calls
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1474
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1475
    "Modified: / 21-12-2011 / 18:46:11 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1476
    "Created: / 29-12-2011 / 14:35:20 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1477
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1478
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1479
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
  1480
    |moduleName answer|
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1481
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1482
    (mgr checkForExistingModule:module) ifFalse:[
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1483
        moduleName := module allBold.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1484
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1485
        allowCreate ifFalse:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  1486
            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
  1487
                                  with:moduleName) .
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1488
            ^ false
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1489
        ].
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  1490
        AbortAllOperationWantedQuery query ifTrue:[
1483
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1491
            answer := Dialog 
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1492
                confirmWithCancel:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName)
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1493
                labels:(resources array:#('Cancel All' 'Cancel' 'Yes' )).
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1494
            answer isNil ifTrue:[ AbortAllOperationRequest raise ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1495
        ] ifFalse:[
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1496
            answer := Dialog 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1497
                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
  1498
                noLabel:'Cancel'
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1499
        ].
d449fe6f503f cancel all
Claus Gittinger <cg@exept.de>
parents: 1466
diff changeset
  1500
        answer ifFalse:[ ^ false].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1501
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1502
        (mgr createModule:module) ifFalse:[
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1503
            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
  1504
            ^ false.
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1505
        ]
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1506
    ].
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1507
    ^ true.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  1508
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  1509
    "Modified: / 21-12-2011 / 18:42:03 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1510
    "Created: / 29-12-2011 / 14:35:06 / cg"
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1511
!
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1512
3534
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1513
checkOutPackages: packages askForRevision: askForRevision
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1514
    "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
  1515
     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
  1516
     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
  1517
     revision. 
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1518
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1519
     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
  1520
     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
  1521
     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
  1522
     newest she wants.
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1523
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1524
     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
  1525
     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
  1526
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1527
    ^ self subclassResponsibility.
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1528
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1529
    "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
  1530
!
914309d517ed class: SourceCodeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3514
diff changeset
  1531
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1532
checkinClass:aClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1533
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1534
     Asks interactively for a log-message."
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
    ^ self checkinClass:aClass withInfo:nil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1537
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1538
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1539
checkinClass:aClass withInfo:aLogInfoOrNil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1540
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1541
     If the argument, aLogInfoOrNil isNil, ask interactively for a log-message."
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
    ^ self checkinClass:aClass withInfo:aLogInfoOrNil withCheck:true
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1544
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1545
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1546
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1547
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1548
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1549
     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
  1550
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1551
    ^ self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1552
        checkinClass:aClass 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1553
        withInfo:aLogInfoOrNil 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1554
        withCheck:doCheckClass 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1555
        usingManager:(self sourceCodeManagerFor:aClass)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1556
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1557
    "Modified: / 21-12-2011 / 18:19:55 / cg"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1558
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1559
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1560
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClassHolder usingManager:managerOrNil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1561
    "check a class into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1562
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1563
     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
  1564
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1565
    ^ self
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1566
        checkinClass:aClass 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1567
        withInfo:aLogInfoOrNil withCheck:doCheckClassHolder 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1568
        usingManager:managerOrNil 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1569
        confirmNewContainer:confirmNewFiles
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1570
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1571
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1572
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClassHolder usingManager:managerOrNil confirmNewContainer:confirmNewContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1573
    "check a class into the source repository.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1574
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1575
     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
  1576
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1577
    ^ self
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1578
        checkinClass:aClass 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1579
        withInfo:aLogInfoOrNil withCheck:doCheckClassHolder 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1580
        usingManager:managerOrNil confirmNewContainer:confirmNewContainer 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1581
        onBranch:nil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1582
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1583
    "Created: / 21-12-2011 / 18:19:14 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1584
    "Modified: / 05-12-2017 / 20:26:38 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1585
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1586
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1587
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClassHolder usingManager:managerOrNil confirmNewContainer:confirmNewContainer onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1588
    "check a class into the source repository.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1589
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1590
     If doCheckClass is true, the class is checked for send of halts etc."
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1591
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1592
    |logMessage checkinInfo mgr pri|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1593
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1594
    aClass isLoaded ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1595
        self information:(resources string:'Cannot checkin unloaded classes (%1)' with:aClass name).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1596
        ^ false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1597
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1598
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1599
    mgr := managerOrNil.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1600
    mgr isNil ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1601
        mgr := self sourceCodeManagerFor:aClass.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1602
        mgr isNil ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1603
            ^ false
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1604
        ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1605
    ].
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
    self ensureCorrectVersionMethodsInClass:aClass usingManager:mgr.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1608
    mgr supportsCheckinLogMessages ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1609
        (self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1610
            getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1611
            forClass:aClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1612
            valuesInto:[:logMessageRet :checkinInfoRet |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1613
                logMessage := logMessageRet.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1614
                checkinInfo := checkinInfoRet.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1615
            ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1616
        ) ifFalse:[^ false].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1617
    ].
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
    (self classIsNotYetInRepository:aClass withManager:mgr) ifTrue:[
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1620
        (self createSourceContainerForClass:aClass usingManager:mgr confirmNewContainer:confirmNewContainer) ifFalse:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1621
"/            self warn:'did not create a container for ''' , aClass name , ''''.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1622
            ^ false
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
        ^ true.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1625
    ].
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
    self activityNotification:(resources string:'checking in %1' with:aClass name).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1628
    pri := Processor activePriority.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1629
    Processor activeProcess withPriority:pri-1 to:pri
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1630
    do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1631
        |revision aborted freshCreated|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1632
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1633
        freshCreated := false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1634
        revision := aClass revision.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1635
        revision isNil ifTrue:[ 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1636
            mgr isContainerBased ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1637
                "/ mhmh - check if it has a container.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1638
                (mgr checkForExistingContainerForClass:aClass) ifFalse:[
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1639
                    (self createSourceContainerForClass:aClass usingManager:mgr confirmNewContainer:confirmNewContainer) ifFalse:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1640
                        self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1641
                        ^ false.
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
                    freshCreated := 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
            ]
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
        doCheckClassHolder value ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1649
            "/ check if the class contains halts, error-sends etc.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1650
            (self checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:doCheckClassHolder) ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1651
                ^ false
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1652
            ].
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
        freshCreated ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1656
            aborted := false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1657
            AbortOperationRequest handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1658
                aborted := true.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1659
                ex return.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1660
            ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1661
                |checkinState cause|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1662
                checkinState := false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1663
                cause := ''.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1664
                [
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1665
                    checkinState := mgr checkinClass:aClass logMessage:logMessage onBranch:branchNameOrNil
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1666
                ] on:SourceCodeManagerError do:[:ex| 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1667
                    cause := ex description.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1668
                    "/ ex proceed.
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
                checkinState ifFalse:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1672
                    Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1673
                    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
  1674
                    AbortOperationRequest raise.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1675
                    "/ ^ false.
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
                checkinInfo notNil ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1678
                    checkinInfo isStable ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1679
                        "set stable tag for class that has been checked in"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1680
                        self tagClass:aClass as:#stable.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1681
                    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1682
                    checkinInfo tagIt ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1683
                        "set any additional tags for the class that has been checked in"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1684
                        (checkinInfo tag asCollectionOfSubstringsSeparatedByAny:',;') do:[:eachTag |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1685
                            self tagClass:aClass as:eachTag withoutSeparators.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1686
                        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1687
                    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1688
                    CVSSourceCodeManager recentTag:checkinInfo tag.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1689
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1690
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1691
            aborted ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1692
                Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1693
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1694
                AbortAllOperationWantedQuery query ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1695
                    (Dialog 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1696
                        confirm:(resources stringWithCRs:'Checkin of "%1" aborted.\\Cancel all ?' with:aClass name)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1697
                        default:false)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1698
                    ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1699
                        AbortAllOperationRequest raise.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1700
                    ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1701
                ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1702
                ^ false.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1703
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1704
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1705
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1706
    ^ true
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1707
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1708
    "Created: / 05-12-2017 / 20:26:09 / cg"
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1709
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1710
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1711
checkinClasses:aCollectionOfClass
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1712
    "check a collection of classes into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1713
     Asks interactively for log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1714
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1715
    ^ self checkinClasses:aCollectionOfClass withInfo:nil
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
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1719
    "check a bunch of classes into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1720
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1721
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1722
    ^ self checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil onBranch:nil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1723
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1724
    "Modified: / 05-12-2017 / 20:15:25 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1725
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1726
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1727
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil onBranch:branchNameOrNil     
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1728
    "check a bunch of classes into the source repository.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1729
     If the argument, aLogInfoOrNil isNil, ask interactively for log-message."
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1730
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1731
    |checkClassWhenCheckingInHolder|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1732
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1733
    checkClassWhenCheckingInHolder := ValueHolder with:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1734
    checkClassWhenCheckingInHolder 
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1735
        onChangeEvaluate:[ 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1736
            UserPreferences current at:#checkClassesWhenCheckingIn put:checkClassWhenCheckingInHolder value 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1737
        ].
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1738
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1739
    ^ self
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1740
        checkinClasses:aCollectionOfClasses 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1741
        withInfo:aLogInfoOrNil 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1742
        withCheck:checkClassWhenCheckingInHolder
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1743
        onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1744
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1745
    "Created: / 05-12-2017 / 20:15:09 / cg"
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1746
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1747
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1748
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1749
    "check a bunch of classes into the source repository.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1750
     If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message."
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1751
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1752
    ^ self checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder onBranch:nil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1753
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1754
    "Modified: / 05-12-2017 / 20:16:18 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1755
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1756
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1757
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1758
    "check a bunch of classes into the source repository.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1759
     If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message."
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1760
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1761
    ^ self checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClassesHolder usingManager:nil onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1762
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1763
    "Created: / 05-12-2017 / 20:15:59 / cg"
3602
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
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1766
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder usingManager:aManagerOrNil
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1767
    "check a bunch of classes into the source repository.
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1768
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1769
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1770
    ^ self
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1771
        checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder usingManager:aManagerOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1772
        onBranch:nil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1773
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1774
    "Modified: / 05-12-2017 / 20:17:32 / cg"
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1775
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1776
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1777
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1778
    usingManager:aManagerOrNil confirmNewContainer:confirmNewContainer
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1779
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1780
    "check a bunch of classes into the source repository.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1781
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1782
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1783
    ^ self 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1784
        checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1785
        usingManager:aManagerOrNil confirmNewContainer:confirmNewContainer onBranch:nil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1786
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1787
    "Created: / 21-12-2011 / 18:24:25 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1788
    "Modified (format): / 05-12-2017 / 20:24:09 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1789
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1790
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1791
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1792
    usingManager:aManagerOrNil confirmNewContainer:confirmNewContainer onBranch:branchNameOrNil
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1793
    "check a bunch of classes into the source repository.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1794
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1795
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1796
    |classes allClasses checkinInfoOrString yesOrNoToAll unchangedClasses|
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1797
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1798
    "/ ignore private classes
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1799
    classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1800
    classes isEmpty ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1801
        self information:'Only private classes given - nothing checked in.'.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1802
        ^ self
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1803
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1804
    classes := classes select:[:aClass | aClass isLoaded].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1805
    classes isEmpty ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1806
        self information:'Only unloaded classes given - nothing checked in.'.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1807
        ^ self
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1808
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1809
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1810
    classes size == 1 ifTrue:[
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1811
        self 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1812
            checkinClass:classes first 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1813
            withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1814
            usingManager:aManagerOrNil
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1815
            confirmNewContainer:confirmNewContainer
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1816
            onBranch:branchNameOrNil.
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1817
        ^ self
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1818
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1819
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1820
    "ask once, for all classes"
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1821
    aLogInfoOrStringOrNil isNil ifTrue:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1822
        checkinInfoOrString := self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1823
                        getCheckinInfoFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1824
                        initialAnswer:nil
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1825
                        withQuickOption:true.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1826
        checkinInfoOrString isNil ifTrue:[^ self].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1827
    ] ifFalse:[
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1828
        checkinInfoOrString := aLogInfoOrStringOrNil.
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1829
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1830
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1831
    allClasses := classes.    
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1832
    (checkinInfoOrString isString not and:[checkinInfoOrString quickCheckIn]) ifTrue:[
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1833
        "/ not only the one's in the changeSet;
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1834
        "/ also those which have not been checked in before.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1835
        classes := classes select:[:each | each hasUnsavedChanges or:[ (each revisionOfManager:aManagerOrNil) isNil ]].
4528
fbb7b72cedbe #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4519
diff changeset
  1836
        classes isEmpty ifTrue:[ 
fbb7b72cedbe #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4519
diff changeset
  1837
            (Dialog confirm:('No changes to checkin (quickCheckIn).\Force?' withCRs))
fbb7b72cedbe #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4519
diff changeset
  1838
            ifFalse:[^ self].
fbb7b72cedbe #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4519
diff changeset
  1839
            classes := allClasses.
fbb7b72cedbe #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4519
diff changeset
  1840
        ]
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1841
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1842
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1843
    "abortAll is handled, and also asked for here!!"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1844
    AbortAllOperationRequest handleAndAnswerQueryIn:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1845
        classes notEmpty ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1846
            self yesToAllNotification handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1847
                yesOrNoToAll := ex parameter.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1848
                ex proceed
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1849
            ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1850
                self yesToAllQuery handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1851
                    ex proceedWith:yesOrNoToAll
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1852
                ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1853
                    classes do:[:aClass |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1854
                        self activityNotification:(resources string:'checking in %1' with:aClass name).
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1855
                        "/ ca does not want boxes to pop up all over ...
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1856
                        UserInformation handle:[:ex |
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1857
                            Transcript showCR:ex description.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1858
                            ex proceed.
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1859
                        ] do:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1860
                            AbortOperationRequest catch:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1861
                                self 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1862
                                    checkinClass:aClass 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1863
                                    withInfo:checkinInfoOrString 
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1864
                                    withCheck:doCheckClassesHolder
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1865
                                    usingManager:aManagerOrNil
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1866
                                    confirmNewContainer:confirmNewContainer
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1867
                                    onBranch:branchNameOrNil
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1868
                            ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1869
                        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1870
                    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1871
                ]
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1872
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1873
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1874
3818
25607a4f1e98 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
  1875
        (checkinInfoOrString isString not and:[ (checkinInfoOrString isStable or:[checkinInfoOrString tagIt]) ])
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1876
        ifTrue:[
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1877
            "/mhmh - but tag should be set on all (even unchanged ones)
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1878
            "/ the other onces have already been tagged
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1879
            unchangedClasses := allClasses reject:[:eachClass | (classes includes:eachClass)].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1880
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1881
            "mhmh - could still have to tag them"
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1882
            checkinInfoOrString isStable ifTrue:[
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1883
                self tagClasses:unchangedClasses as:#stable.
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1884
"/                unchangedClasses do:[:eachClass |
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1885
"/                    self tagClass:eachClass as:#stable.
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1886
"/                ].
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1887
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1888
            checkinInfoOrString tagIt ifTrue:[
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1889
                self tagClasses:unchangedClasses as:(checkinInfoOrString tag).
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1890
"/                unchangedClasses do:[:eachClass |
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1891
"/                    self tagClass:eachClass as:(checkinInfoOrString tag).
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1892
"/                ].
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1893
            ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1894
        ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1895
    ].
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1896
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1897
    "Created: / 05-12-2017 / 20:23:37 / cg"
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  1898
    "Modified: / 05-12-2017 / 23:34:56 / cg"
4276
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1899
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1900
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1901
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder usingManager:aManagerOrNil onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1902
    "check a bunch of classes into the source repository.
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1903
     If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1904
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1905
    ^ self
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1906
        checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringOrNil withCheck:doCheckClassesHolder 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1907
        usingManager:aManagerOrNil 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1908
        confirmNewContainer:confirmNewFiles
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1909
        onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1910
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1911
    "Created: / 05-12-2017 / 20:17:16 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1912
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1913
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1914
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1915
    ^ self 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1916
        checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1917
        buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages 
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1918
        onBranch:nil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1919
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1920
    "Created: / 05-12-2017 / 20:02:49 / cg"
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1921
!
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1922
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1923
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages onBranch:branchNameOrNil
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1924
    self subclassResponsibility
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1925
1725bf9d43b0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4272
diff changeset
  1926
    "Created: / 05-12-2017 / 20:02:34 / cg"
3602
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1927
!
d5a67c9e51dd class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3594
diff changeset
  1928
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1929
checkoutClass:aClass askForMerge:askForMerge
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1930
    "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
  1931
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1932
    self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1933
        checkoutClass:aClass 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1934
        askForRevision:true
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1935
        askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1936
!
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1937
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1938
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1939
    "check-out a class from the source repository.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1940
     If askForRevision is false, check-out the newest version."
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  1941
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1942
    self
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1943
        checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge 
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1944
        askForConfirmation:true
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1945
!
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1946
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1947
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge askForConfirmation:askForConfirmation
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1948
    "check-out a class from the source repository.
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1949
     If askForRevision is false, check-out the newest version."
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  1950
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1951
    |mgr sourceInfo
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  1952
     currentClass inChangeSet
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  1953
     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
  1954
     nm msg rev2 newestRev
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1955
     containerModule containerPackage containerFile rslt
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1956
     pkg listHere listRep diffSet 
1054
4ecc5aeca084 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  1957
     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
  1958
     changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  1959
     wasInChangeSetBefore|
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1960
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1961
    aClass isNil ifTrue:[self error:'nil class'].
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1962
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1963
    currentClass := aClass theNonMetaclass.
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1964
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1965
    nm := currentClass name.
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  1966
    mgr := self sourceCodeManagerFor:currentClass.
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1967
    mgr isNil ifTrue:[
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1968
        ^ self
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  1969
    ].
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1970
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1971
    sourceInfo := mgr sourceInfoOfClass:currentClass.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1972
    sourceInfo notNil ifTrue:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  1973
        currentClass package ~= PackageId noProjectID ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  1974
            containerPackage := mgr directoryFromSourceInfo:sourceInfo.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1975
            containerModule := mgr moduleFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1976
        ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1977
        containerFile := mgr containerFromSourceInfo:sourceInfo.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1978
    ].
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1979
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1980
    currentClass isLoaded ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1981
        rev := currentClass binaryRevision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1982
        rev2 := currentClass revision.
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1983
        rev isNil ifTrue:[
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1984
            rev := rev2
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1985
        ].
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  1986
        rev isNil ifTrue:[
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  1987
            pkg := currentClass package.
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  1988
            (pkg notNil and:[pkg ~= PackageId noProjectID]) ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1989
                containerModule := pkg upTo:$:.
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1990
                containerPackage := pkg copyFrom:(containerModule size + 2).
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1991
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1992
            containerModule size == 0 ifTrue:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1993
                containerModule := (self class lastModule ) ? Project current repositoryModule.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1994
            ].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1995
            containerPackage size == 0 ifTrue:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  1996
                containerPackage := (self class lastPackage ) ? Project current package.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  1997
            ].
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  1998
            answer := self confirmWithCancel:(resources 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  1999
                                                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
  2000
                                                with:containerModule allBold 
1035
092c701c91f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  2001
                                                with:containerPackage allBold
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2002
                                                with:currentClass name allBold) withCRs.
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2003
            answer isNil ifTrue:[^ self "cancelled"].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2004
            answer ifFalse:[
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  2005
                rslt := self
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2006
                    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
  2007
                    title:'Container to load from' note:nil 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2008
                    initialModule:containerModule 
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2009
                    initialPackage:containerPackage 
1158
453b58c2a059 refactored slightly
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2010
                    initialFileName:(currentClass nameWithoutPrefix , '.st')
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2011
                    forNewContainer:false.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2012
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2013
                rslt isNil ifTrue:[
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2014
                    "/ canel
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2015
                    ^ self
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2016
                ].
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2017
                containerModule := "lastModule :=" rslt at:#module.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2018
                containerPackage := "lastPackage :=" rslt at:#package.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2019
                containerFile := rslt at:#fileName.
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2020
            ].
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2021
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  2022
"/            rslt := self
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2023
"/                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
  2024
"/                title:'Container to checkOut' note:nil 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2025
"/                initialModule:containerModule 
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2026
"/                initialPackage:containerPackage
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2027
"/                initialFileName:(currentClass name , '.st').
1030
7a798aa0735e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1026
diff changeset
  2028
"/                forNewContainer:false.
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2029
"/            rslt isNil ifTrue:[^ self].
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2030
            "/ 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
  2031
            "/ ^ self
989
bb70a0f30e98 care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
  2032
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2033
    ].
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2034
1966
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2035
    containerFile isNil ifTrue:[
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2036
        containerFile := currentClass classFilename.
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2037
    ].
d2e8ac3b2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2038
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2039
    "/
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2040
    "/ 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
  2041
    "/
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  2042
    containerModule isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  2043
        containerModule := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  2044
                                        stringWithCRs:'Missing Module Information for CheckOut of "%1".\\Module:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  2045
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  2046
        containerModule isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  2047
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  2048
    containerPackage isNil ifTrue:[
1982
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  2049
        containerPackage := Dialog request:(resources 
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  2050
                                        stringWithCRs:'Missing Package Information for CheckOut of "%1".\\Package:'
305ae0785e65 nicer dialog
Claus Gittinger <cg@exept.de>
parents: 1978
diff changeset
  2051
                                        with:aClass name allBold).
1978
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  2052
        containerPackage isEmptyOrNil ifTrue:[^ self].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  2053
    ].
91cb79a651aa *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1972
diff changeset
  2054
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2055
    newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2056
    askForRevision ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2057
        rev := newestRev ? ''
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2058
    ] ifTrue:[
1019
efc461bc89dc asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
  2059
        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
  2060
        rev notNil ifTrue:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2061
            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
  2062
                                           with:nm allBold with:rev).
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2063
            (rev2 notNil and:[rev2 ~= rev]) ifTrue:[
2539
abce5c41eef8 comment/format in: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  2064
                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
  2065
            ]
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2066
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2067
        newestRev notNil ifTrue:[
2539
abce5c41eef8 comment/format in: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  2068
            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
  2069
        ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2070
2791
0601ded0300b changed:
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
  2071
        rev := self
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2072
                    askForExistingRevision:msg 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2073
                    title:'CheckOut from repository' 
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2074
                    class:currentClass.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2075
        rev isNil ifTrue:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  2076
            ^ self   "/ canceled
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2077
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2078
    ].
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2079
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2080
    rev withoutSpaces isEmpty ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2081
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2082
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2083
        aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2084
        revString := '(newest: ' , (newestRev ? '???') , ')'.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2085
    ] ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2086
        msg := 'extracting previous %1'.
1084
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2087
"/        aStream := mgr getSourceStreamFor:currentClass revision:rev.
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2088
"/        revString := rev
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2089
        aStream := mgr  
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2090
            streamForClass:currentClass
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2091
            fileName:containerFile 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2092
            revision:rev 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2093
            directory:containerPackage 
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2094
            module:containerModule
2728a446d037 remember lastPackage/Module
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
  2095
            cache:true.
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2096
    ].
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  2097
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2098
    aStream isNil ifTrue:[
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2099
        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
  2100
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2101
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2102
    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
  2103
        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
  2104
        aStream close.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2105
        ^ self
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2106
    ] do:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2107
        sourceToLoad := aStream contents asString.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2108
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2109
    aStream close.
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2110
1919
8d30ac5be40f *** empty log message ***
boris
parents: 1913
diff changeset
  2111
    wasInChangeSetBefore := ChangeSet current includesChangeForClassOrMetaclass:currentClass.
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  2112
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2113
    currentClass isLoaded ifFalse:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2114
        rev = newestRev ifTrue:[
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2115
            currentClass autoload.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  2116
        ] ifFalse:[
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2117
            sourceToLoad readStream fileIn.
996
551841dd0105 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
  2118
        ].
1879
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  2119
        wasInChangeSetBefore ifFalse:[
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  2120
            ChangeSet current condenseChangesForClass:currentClass.
3ca8838014ee dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
  2121
        ].
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2122
        ^ self.
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2123
    ].
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2124
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  2125
    inChangeSet := aClass hasUnsavedChanges.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2126
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2127
    Error handle:[:ex |
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2128
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2129
            confirm:(resources 
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2130
                        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
  2131
                        with:ex description 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2132
                        with:currentClass name allBold) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2133
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2134
        ifFalse:[
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  2135
            AbortOperationRequest raise
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2136
        ].
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2137
        sourceToLoad readStream fileIn.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2138
        ^ self.
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2139
    ] do:[
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2140
        self activityNotification:'generating current source...'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2141
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2142
        currentSource := self sourceCodeOfClass:currentClass.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2143
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2144
        self activityNotification:'comparing...'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2145
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2146
        sourceToLoad = currentSource ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2147
            "/ make all methods belong to the classes project
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2148
            self setPackageOfAllMethodsIn:aClass to:aClass package.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2149
            inChangeSet ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2150
                rev = newestRev ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2151
                    (askForConfirmation not
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2152
                    or:[ wasInChangeSetBefore not
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2153
                    or:[ self confirm:(resources 
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2154
                                    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
  2155
                                    with:aClass name)]]) 
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2156
                    ifTrue:[
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2157
                        ChangeSet current condenseChangesForClass:aClass.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2158
                    ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2159
                ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2160
            ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2161
            self activityNotification:'... nothing changed in repository'.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2162
            ^ self.
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2163
        ].
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2164
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2165
        self activityNotification:'generating diffSet...'.
1972
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2166
        listHere := ChangeSet fromStream:(currentSource readStream).
32853d3cb43a care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  2167
    ].
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2168
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2169
    listRep := ChangeSet fromStream:(sourceToLoad readStream).
1051
9f76e78c91d4 *** empty log message ***
frank
parents: 1050
diff changeset
  2170
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2171
    Error handle:[:ex |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2172
        (Dialog 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2173
            confirm:(resources 
2426
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2174
                        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
  2175
                        with:ex description
d698fb5ebbd7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  2176
                    ) 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2177
            noLabel:'Cancel') 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2178
        ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2179
            ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2180
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2181
        sourceToLoad readStream fileIn.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2182
        ^ self.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2183
    ] do:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2184
        versionMethodsHere := listHere select:[:change | (change isMethodChange 
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  2185
                                               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
  2186
                                               and:[change changeClass isMeta]])].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2187
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2188
        versionMethodsRep := listRep select:[:change | (change isMethodChange 
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  2189
                                               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
  2190
                                               and:[change changeClass isMeta]])].
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
        "/ compare all but the version methods
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2193
        listHere := listHere reject:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  2194
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2195
                                               and:[change changeClass isMeta]])].
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2196
        listRep := listRep reject:[:change | (change isMethodChange 
2184
4bb6267612be changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
fm
parents: 2175
diff changeset
  2197
                                               and:[(AbstractSourceCodeManager isVersionMethodSelector:change selector)
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2198
                                               and:[change changeClass isMeta]])].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2199
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2200
        diffSet := listHere diffSetsAgainst:listRep.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2201
        changed := diffSet changed.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2202
        onlyHere := diffSet onlyInReceiver.
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2203
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2204
        "/ reject extensions
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2205
        onlyHere := onlyHere reject:[:eachDiff|  
4416
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2206
                        |changeClass method methodsPackage|
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2207
3272
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2208
                        eachDiff isMethodChange  
4416
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2209
                        and:[ (changeClass := eachDiff changeClass) notNil
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2210
                        and:[ (method := (changeClass compiledMethodAt:eachDiff selector)) notNil 
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2211
                        and:[ (methodsPackage := method package) ~= changeClass package
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2212
                        and:[ methodsPackage ~= PackageId noProjectID  ]]]]
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2213
                    ]. 
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2214
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2215
        onlyInRep := diffSet onlyInArg.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2216
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2217
        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
  2218
        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
  2219
        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
  2220
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2221
        labels := #('Cancel' 'Merge' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2222
        values := #(nil #merge #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2223
        default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2224
                        ifTrue:[3. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2225
                        ifFalse:[2. "i.e. merge"].
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
        msg := 'About to load ''%4''.\\'.
4416
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2228
        onlyInRep notEmpty ifTrue:[
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2229
            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
  2230
        ].
4416
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2231
        onlyHere notEmpty ifTrue:[
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2232
            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
  2233
            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
  2234
        ].
4416
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2235
        changed notEmpty ifTrue:[
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2236
            changed size == 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2237
                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
  2238
                singleChangeSelector := changed first first selector allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2239
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2240
                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
  2241
            ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2242
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2243
        changedClassDefinitions size > 0 ifTrue:[
2794
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2244
            msg := msg , (changedClassDefinitions size == 1 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2245
                            ifTrue:['The class definition is different.\\'] 
77c62d93cc76 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2793
diff changeset
  2246
                            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
  2247
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2248
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2249
        onlyHere isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2250
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2251
                (changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[
2605
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  2252
                    versionMethodsRep notEmpty ifTrue:[
4329
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2253
                         (answer := AlwaysUpdateVersionMethodsIfNoOtherChange) isNil ifTrue:[
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2254
                            Dialog 
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2255
                                withOptoutOption:[AlwaysUpdateVersionMethodsIfNoOtherChange := true]
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2256
                                labelled:'Do not ask again, but always update if no other change'
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2257
                                do:[
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2258
                                    answer := self confirm:(resources string:'Only version methods are different in %1.\\Update the version-IDs ?' with:aClass name allBold) withCRs.
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2259
                                ]
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2260
                        ].
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2261
                        answer ifTrue:[
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2262
                            Class withoutUpdatingChangesDo:[
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2263
                                versionMethodsRep do:[:each | each apply].
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2264
                            ].
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2265
                        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2266
                    ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2267
                    "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2268
                    "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2269
                    self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
2605
93f1e7e8aee7 changed: #checkoutClass:askForRevision:askForMerge:askForConfirmation:
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  2270
                    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
  2271
                    ^ self
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
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2274
                    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
  2275
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2276
                labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2277
                values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2278
                default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2279
                                ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2280
                                ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2281
                default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2282
            ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2283
                changed isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2284
                    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
  2285
                    labels := #('Cancel' 'Load'). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2286
                    values := #(nil #load). 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2287
                    default := askForRevision 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2288
                                    ifTrue:[2. "i.e. load"]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2289
                                    ifFalse:[1. "i.e. cancel"].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2290
                    default := 2. 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2291
                ] ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2292
                    inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2293
                        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
  2294
                    ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2295
                    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
  2296
                ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2297
            ]
1006
2ac6dfb81b8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  2298
        ] ifFalse:[
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2299
            onlyInRep isEmpty ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2300
                inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2301
                    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
  2302
                    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
  2303
                ].
1121
7531e9dd8ba8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  2304
                labels := #('Cancel' 'Load'). 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2305
                values := #(nil #load). 
1007
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  2306
                default := askForRevision 
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  2307
                                ifTrue:[2. "i.e. load"]
44c0229bcb43 better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents: 1006
diff changeset
  2308
                                ifFalse:[1. "i.e. cancel"].
1907
30ca5aea5a7a dialogs defaults
fm
parents: 1886
diff changeset
  2309
                default := 2. 
987
fa4fc87b8540 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2310
            ] ifFalse:[
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  2311
                inChangeSet ifTrue:[
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  2312
                    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
  2313
                    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
  2314
                ]
1339
9a1e91c28cb3 checkOut dialog labels
Claus Gittinger <cg@exept.de>
parents: 1338
diff changeset
  2315
            ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2316
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2317
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2318
        msg := msg bindWith:onlyInRep size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2319
                   with:onlyHere size printString 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2320
                   with:changed size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2321
                   with:aClass name allBold
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2322
                   with:changedClassDefinitions size printString
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2323
                   with:singleChangeSelector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2324
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2325
        askForConfirmation ifFalse:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2326
            answer := #load           
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2327
        ] ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2328
            answer := (Dialog confirmWithCancel:msg withCRs
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2329
                   labels:(resources array:labels)
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2330
                   values:values 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2331
                   default:default).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2332
            answer isNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2333
                self activityNotification:'...cancelled'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2334
                ^ self
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2335
            ].
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  2336
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2337
        self activityNotification:'updating...'.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2338
        changedClasses := IdentitySet new.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2339
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2340
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2341
            "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
  2342
             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
  2343
            onlyHere do:[:eachChange |   
3272
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2344
                "remove this change (method not present in repository version)"
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2345
                |cClass|
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2346
                eachChange isMethodChange ifTrue:[
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2347
                    cClass := eachChange changeClass.
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2348
                    cClass notNil ifTrue:[ 
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2349
                       cClass basicRemoveSelector:eachChange selector 
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2350
                    ].
6ce72ad3d416 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3261
diff changeset
  2351
                ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2352
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2353
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2354
            changedClassDefinitions do:[:eachChangeArr | 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2355
                |cHere eachChangedClass| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2356
                cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2357
                eachChangedClass := cHere changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2358
                eachChangedClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2359
                    changedClasses add:eachChangedClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2360
                    eachChangedClass := eachChangedClass theNonMetaclass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2361
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2362
                    "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
  2363
                    changed do:[:eachChangeArr|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2364
                        |eachChange eachClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2365
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2366
                        eachChange := eachChangeArr first.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2367
                        eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2368
                            eachClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2369
                            eachClass theNonMetaclass == eachChangedClass ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2370
                                eachClass basicRemoveSelector:eachChange selector.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2371
                            ].
1999
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  2372
                        ].
57cad7a53262 changed #checkOutClasse
Stefan Vogel <sv@exept.de>
parents: 1997
diff changeset
  2373
                    ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2374
                ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2375
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2376
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2377
           "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
  2378
           changedClassDefinitions do:[:eachChangeArr |    
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2379
                |cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2380
                cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2381
                cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2382
            ].
1057
6903d4d5097d do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents: 1056
diff changeset
  2383
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2384
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2385
        onlyInRep do:[:eachChange |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2386
            |changeClass|
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2387
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2388
            "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
  2389
             eachChange apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2390
             eachChange isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2391
                 changeClass := eachChange changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2392
                 changeClass notNil ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2393
                     eachChange changeMethod setPackage:(changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2394
                     changedClasses add:changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2395
                 ]
2013
0457926edfdb allow checkout without popup confirmations
Michael Beyl <mb@exept.de>
parents: 2009
diff changeset
  2396
             ]
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2397
        ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2398
    .
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2399
        answer == #load ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2400
            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
  2401
                 |cHere cRep| 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2402
                 cHere := eachChangeArr at:1.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2403
                 cRep := eachChangeArr at:2.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2404
                 cRep apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2405
                 cRep isMethodChange ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2406
                     cRep changeMethod setPackage:(cRep changeClass package).
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2407
                     changedClasses add:cRep changeClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2408
                 ]
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2409
            ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2410
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2411
            versionMethodsRep size >= 1 ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2412
                versionMethodsRep last apply.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2413
            ] ifFalse:[
4513
927fa8db128e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4490
diff changeset
  2414
                self error:('missing version method in repository (%1)' bindWith:aClass printString) mayProceed:true.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2415
            ].
2193
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2416
            "/ make all those methods belong to the classes project
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2417
            "/ no - that is wrong !! self setPackageOfAllMethodsIn:aClass to:aClass package.
cdb523415d6b added: #setPackageOfAllMethodsInChangeSet:to:
fm
parents: 2189
diff changeset
  2418
            self setPackageOfAllMethodsInChangeSet:listRep to:aClass package.
1055
f44b12442c58 version update after load from rep.
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  2419
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2420
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2421
        answer == #load ifTrue:[
2236
050566d67400 changed:
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
  2422
            inChangeSet := aClass hasUnsavedChanges.
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2423
            inChangeSet ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2424
                rev = newestRev ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2425
                    (wasInChangeSetBefore not
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2426
                     or:[ self confirm:(resources 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2427
                                    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
  2428
                                    with:aClass name)]) 
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2429
                    ifTrue:[
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2430
                        ChangeSet current condenseChangesForClass:aClass.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2431
                    ].
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2432
                ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2433
            ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2434
        ].
2092
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2435
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2436
        changedClasses do:[:eachClass |
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2437
             eachClass changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2438
        ].
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2439
        Smalltalk changed:#projectOrganization.
cd9b53d5ca31 allow for fileIn, even if diffset generation failed
Claus Gittinger <cg@exept.de>
parents: 2064
diff changeset
  2440
        self activityNotification:'... done'.
1800
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2441
    ].
560e29381f52 ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents: 1787
diff changeset
  2442
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  2443
    "Modified: / 07-02-2001 / 18:18:32 / ps"
3354
d36778f0ff0b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
  2444
    "Modified: / 22-07-2013 / 13:17:32 / cg"
4329
f1a534377d1e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
  2445
    "Modified: / 14-06-2018 / 17:02:05 / Claus Gittinger"
4416
2868d1f08a0a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4410
diff changeset
  2446
    "Modified: / 02-04-2019 / 12:03:11 / Stefan Vogel"
986
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2447
!
78d2a098bc81 support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2448
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2449
checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge usingManager:aSourceCodeManager
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2450
    "check-out a class from the source repository.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2451
     If askForRevision is false, check-out the newest version."
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2452
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  2453
    |inChangeSet extensionMethods msg
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  2454
     listHere listRep diffSet 
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2455
     changed onlyHere onlyInRep answer labels values singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2456
     changedClasses default |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2457
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2458
    listRep := self changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision usingManager:aSourceCodeManager.
1841
00e5a67d1d9e refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents: 1840
diff changeset
  2459
    listRep isNil ifTrue:[ ^self ].
1522
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
    self activityNotification:'generating diffSet...'.
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
    extensionMethods := OrderedCollection new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2464
    Smalltalk allClassesDo:[:aClass | |owner classPackage|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2465
        "/ individual methods ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2466
        aClass isMeta ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2467
            (aClass package ~= packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2468
                aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2469
                    "/ methods in this project ...
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2470
                    (mthd package = packageToCheckOut) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2471
                        "/ ... whose class is not in the ckechIn-set
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2472
                        extensionMethods add:mthd
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2473
                    ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2474
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2475
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2476
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2477
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2478
    listHere := ChangeSet forExistingMethods:extensionMethods.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2479
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2480
    inChangeSet := listRep contains:[:someChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2481
                            |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2482
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2483
                            someChange isMethodChange ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2484
                                cClass := someChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2485
                                cSel := someChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2486
                                ChangeSet current includesChangeForClass:cClass selector:cSel
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2487
                            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2488
                    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2489
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2490
    diffSet := listHere diffSetsAgainst:listRep.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2491
    changed := diffSet changed.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2492
    onlyHere := diffSet onlyInReceiver.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2493
    onlyInRep := diffSet onlyInArg.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2494
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2495
    labels := #('Cancel' 'Merge' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2496
    values := #(nil #merge #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2497
    default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2498
                    ifTrue:[3. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2499
                    ifFalse:[2. "i.e. merge"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2500
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2501
    msg := 'About to load extensions for ''%5''.\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2502
    onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2503
        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
  2504
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2505
    onlyHere size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2506
        onlyInRep size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2507
            msg := msg , 'And there '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2508
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2509
            msg := msg , 'There '.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2510
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2511
        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
  2512
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2513
    changed size > 0 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2514
        changed size == 1 ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2515
            msg := msg , 'The ''%5''-method is different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2516
            singleChangeSelector := changed first first selector allBold
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2517
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2518
            msg := msg , '%3 methods are different (present in both).\\'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2519
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2520
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2521
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2522
    onlyHere isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2523
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2524
            (changed isEmpty) ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2525
                listRep do:[:eachChange |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2526
                    eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2527
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2528
                ^ self
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2529
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2530
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2531
                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
  2532
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2533
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2534
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2535
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2536
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2537
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2538
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2539
            changed isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2540
                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
  2541
                labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2542
                values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2543
                default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2544
                                ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2545
                                ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2546
            ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2547
                inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2548
                    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
  2549
                ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2550
                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
  2551
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2552
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2553
    ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2554
        onlyInRep isEmpty ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2555
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2556
                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
  2557
                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
  2558
            ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2559
            labels := #('Cancel' 'Load'). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2560
            values := #(nil #load). 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2561
            default := askForRevision 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2562
                            ifTrue:[2. "i.e. load"]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2563
                            ifFalse:[1. "i.e. cancel"].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2564
        ] ifFalse:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2565
            inChangeSet ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2566
                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
  2567
                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
  2568
            ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2569
        ]
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2570
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2571
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2572
    msg := msg bindWith:onlyInRep size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2573
               with:onlyHere size printString 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2574
               with:changed size printString
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2575
               with:singleChangeSelector
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2576
               with:packageToCheckOut allBold.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2577
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2578
    answer := (Dialog confirmWithCancel:msg withCRs
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2579
           labels:(resources array:labels)
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2580
           values:values 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2581
           default:default).
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2582
    answer isNil ifTrue:[^ self].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2583
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2584
    self activityNotification:'updating...'.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2585
    changedClasses := IdentitySet new.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2586
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2587
"/    Class withoutUpdatingChangesDo:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2588
        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
  2589
                                     Class withoutUpdatingChangeSetDo:[ eachChange apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2590
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2591
                                     eachChange changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2592
                                     changedClasses add:eachChange changeClass.   
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2593
                     ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2594
        answer == #load ifTrue:[
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2595
            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
  2596
                                         |cClass cSel|
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2597
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2598
                                         cClass := eachChange changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2599
                                         cSel := eachChange selector.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2600
                                         Class withoutUpdatingChangeSetDo:[ cClass removeSelector:cSel ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2601
                        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2602
            changed do:[:eachChangeArr | "apply this change (go to rep-version)"
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2603
                                         |cHere cRep| 
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2604
                                         cHere := eachChangeArr at:1.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2605
                                         cRep := eachChangeArr at:2.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2606
                                         Class withoutUpdatingChangeSetDo:[ cRep apply ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2607
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2608
                                         cRep changeMethod setPackage:packageToCheckOut.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2609
                                         changedClasses add:cRep changeClass.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2610
                       ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2611
        ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2612
"/    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2613
    changedClasses do:[:eachClass |
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2614
         eachClass changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2615
    ].
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2616
    Smalltalk changed:#projectOrganization.
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2617
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2618
    "Modified: / 07-02-2001 / 18:18:32 / ps"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2619
    "Created: / 29-12-2011 / 14:34:12 / cg"
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2620
!
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  2621
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2622
compareClassWithRepository:aClass
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2623
    "open a diff-textView comparing the current (in-image) version
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2624
     against its orgiginal version found in the repository."
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2625
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2626
    self compareClassWithRepository:aClass askForRevision:true
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2627
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2628
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2629
      self compareClassWithRepository:Array
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2630
    "
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2631
!
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2632
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2633
compareClassWithRepository:aClass askForRevision:askForRevision
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2634
    "open a diff-textView comparing the current (in-image) version
4320
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  2635
     against the newest (askForRevision=false)
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  2636
     or an asked-for version (askForRevision=true) found in the repository."
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2637
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2638
    |classToCompare brwsr comparedSource currentSource rev revString thisRevString
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2639
     scmManager revisionInClass versionsAreTheSame revInfo revAuthor revDate revLabel |
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2640
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2641
    classToCompare := aClass theNonMetaclass.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2642
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2643
    comparedSource := self
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2644
                        fetchSourceOf:classToCompare askForRevision:askForRevision
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2645
                        into:[:revStringArg :revisionInClassArg :scmManagerArg|
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2646
                            revString := revStringArg.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2647
                            revisionInClass := revisionInClassArg.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2648
                            scmManager := scmManagerArg.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2649
                        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2650
    comparedSource isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2651
        ^ self
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2652
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2653
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2654
"/    classToCompare := aClass theNonMetaclass.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2655
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2656
"/    nm := classToCompare name.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2657
"/    (mgr := manager) isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2658
"/        mgr := self sourceCodeManagerFor:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2659
"/        mgr isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2660
"/            self error:'oops - no sourcecode manager' mayProceed:true.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2661
"/            ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2662
"/        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2663
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2664
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2665
"/    rev := classToCompare revisionInfoOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2666
"/"/    rev := classToCompare binaryRevision.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2667
"/    revisionInClass := classToCompare revisionOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2668
"/    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2669
"/        rev := revisionInClass
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2670
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2671
"/    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2672
"/        (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
  2673
"/        ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2674
"/            ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2675
"/        ]
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2676
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2677
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2678
"/    "/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2679
"/    "/ class in repository - ask for revision
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
"/    SourceCodeManagerError handle:[:ex |
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2682
"/        Dialog warn:(resources
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2683
"/                                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
  2684
"/                                with:classToCompare name
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2685
"/                                with:classToCompare sourceCodeManager managerTypeName
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2686
"/                                with:classToCompare package).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2687
"/        ^ self.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2688
"/    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2689
"/        newestRev := mgr newestRevisionOf:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2690
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2691
"/    askForRevision ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2692
"/        msg := resources string:'Compare to revision: (empty for newest)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2693
"/        rev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2694
"/            msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2695
"/                                           with:nm allBold with:rev).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2696
"/            (revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2697
"/                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
  2698
"/                                               with:revisionInClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2699
"/            ]
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2700
"/        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2701
"/        newestRev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2702
"/            msg := msg , '\' , (resources string:'Newest in repository is %1.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2703
"/                                           with:newestRev)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2704
"/        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2705
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2706
"/        rev := self
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2707
"/                    askForExistingRevision:msg
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2708
"/                    title:'Compare with repository'
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2709
"/                    class:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2710
"/    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2711
"/        rev := newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2712
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2713
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2714
"/    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2715
"/        mgr = classToCompare sourceCodeManager ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2716
"/            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
  2717
"/        ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2718
"/            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
  2719
"/        ].
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2720
"/        Dialog warn:(resources
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2721
"/                                stringWithCRs:msg
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2722
"/                                with:classToCompare name
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2723
"/                                with:mgr managerTypeName
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2724
"/                                with:classToCompare package
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2725
"/                                with:(classToCompare sourceCodeManager managerTypeName)).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2726
"/        ^ self.
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2727
"/
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2728
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2729
"/    rev withoutSpaces isEmpty ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2730
"/        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2731
"/        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2732
"/        aStream := mgr getSourceStreamFor:classToCompare revision:newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2733
"/        revString := '(newest: ' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2734
"/    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2735
"/        msg := 'extracting previous %1'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2736
"/        aStream := mgr getSourceStreamFor:classToCompare revision:rev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2737
"/        revString := rev
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2738
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2739
"/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2740
"/    aStream isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2741
"/        self warn:'Could not extract source from repository (check repository settings / network)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2742
"/        ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2743
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2744
"/    aStream class readErrorSignal handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2745
"/        self warn:('Read error while reading extracted source\\' , ex description) withCRs.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2746
"/        aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2747
"/        ^ self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2748
"/    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2749
"/        comparedSource := aStream contents asString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2750
"/    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2751
"/    aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2752
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2753
    self activityNotification:'generating current source...'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2754
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2755
    currentSource := self sourceCodeOfClass:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2756
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2757
    self activityNotification:'comparing...'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2758
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2759
    versionsAreTheSame := false.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2760
    "/ a quick smoke test, if code is exactly the same
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2761
    comparedSource = currentSource ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2762
        versionsAreTheSame := true.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2763
    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2764
        "/ this branch generates chunks and compares individual methods.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2765
        "/ 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
  2766
        "/ additional whitespace, empty lines etc.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2767
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2768
        thisRevString := revisionInClass ? 'no revision'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2769
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2770
        revString = '(newest)' ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2771
            |newestRev|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2772
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2773
            (newestRev := scmManager newestRevisionOf:classToCompare) notNil ifTrue:[
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2774
                revString := '(newest is ' , newestRev , ')'.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2775
                rev := newestRev.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2776
            ]
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2777
        ] ifFalse:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2778
            rev := revString
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2779
        ].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2780
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2781
        revLabel := revString.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2782
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2783
        rev notNil ifTrue:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2784
            revInfo := scmManager revisionLogOf:classToCompare fromRevision:rev toRevision:rev.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2785
            revInfo notNil ifTrue:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2786
                revInfo := (revInfo at:#revisions) first.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2787
                revAuthor := revInfo at:#author ifAbsent:[nil].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2788
                revDate := revInfo at:#date ifAbsent:[nil].
3993
209a7d800ea0 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3992
diff changeset
  2789
                revDate isString ifTrue:[
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2790
                    revDate := Timestamp readFrom:revDate onError:nil.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2791
                ].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2792
                revLabel := revString , ' ('.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2793
                revDate notNil ifTrue:[
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2794
                    revLabel := revLabel , revDate asDate printString.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2795
                ].
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2796
                revLabel := revLabel , ' by ', revAuthor.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2797
                revLabel := revLabel , ')'.
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2798
            ].
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2799
        ].
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2800
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2801
        self activityNotification:'comparing...'.
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2802
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2803
        ChangeSet invalidChangeChunkError handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2804
            |answer|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2805
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2806
            answer := Dialog
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2807
                        confirm:(resources
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2808
                            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
  2809
                            with:aClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2810
                        yesLabel:(resources string:'Debug')
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2811
                        noLabel:(resources string:'Cancel')
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2812
                        initialAnswer:false.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2813
            answer ifTrue:[ex reject].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2814
            AbortOperationRequest raise.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2815
        ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2816
            brwsr := (UserPreferences versionDiffViewerClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2817
                  openOnClass:classToCompare
3953
5d404f99092f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3926
diff changeset
  2818
                  labelA:('Repository: ' , revLabel)
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2819
                  sourceA:comparedSource
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2820
                  labelB:('Current: (based on: ' , thisRevString , ')')
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2821
                  sourceB:currentSource
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2822
                  title:('Comparing ' , classToCompare name)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2823
                  ifSame:[versionsAreTheSame := true].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2824
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2825
        versionsAreTheSame ifFalse:[
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2826
            brwsr classChangeSet
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2827
                classBeingCompared:classToCompare;
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2828
                versionA:revString;
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2829
                versionB:thisRevString , 'mod'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2830
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2831
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2832
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2833
    versionsAreTheSame ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2834
        (classToCompare hasUnsavedChanges) ifTrue:[
4448
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2835
            |answer|
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2836
            
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2837
            DoNotAskForCondenseIfSameAsRepository == true ifTrue:[
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2838
                answer := true.
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2839
            ] ifFalse:[    
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2840
                Dialog 
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2841
                    withOptoutOption:[ DoNotAskForCondenseIfSameAsRepository := true ]
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2842
                    labelled:'Do not ask again'
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2843
                    do:[
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2844
                        answer :=self confirm:(resources
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2845
                                        stringWithCRs:'Versions of %1 are identical.\\Remove entries from changeSet ?'
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2846
                                        with:classToCompare name allBold)
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2847
                    ].
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2848
            ].
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2849
            answer ifTrue:[
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2850
                ChangeSet current condenseChangesForClass:classToCompare.
4448
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2851
            ]    
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2852
        ] ifFalse:[
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2853
            self information:(resources string:'Versions are identical.').
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2854
            ChangeSet current unrememberChangedClasses.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2855
        ].
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2856
        revisionInClass isNil ifTrue:[
4486
a2811867a766 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
  2857
            (Dialog confirm:'Update (Fix) the classes Revision Info ?')
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2858
            ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2859
                |newString root|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2860
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2861
                newString := scmManager updatedRevisionStringOf:aClass forRevision:rev with:aClass revisionString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2862
                newString isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2863
                    root := scmManager getCVSROOTForModule:(aClass package upTo:$:).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2864
                    root := scmManager repositoryTopDirectoryFromCVSRoot:root.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2865
                    newString := '$', 'Header: ',(root copyReplaceAll: $: with:$/ ),'/'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2866
                                 ,(Smalltalk fileNameForClass:aClass),'.st,v ',rev,' '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2867
                                 ,(Date today printStringFormat:'%y-%m-%d'),' '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2868
                                 ,(Time now printStringFormat:'%h:%m:%s'),' '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2869
                                 ,'+0000 '
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2870
                                 ,(OperatingSystem getLoginName),' Exp $'.
1449
cfb2e98b9259 refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  2871
                ].
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2872
                scmManager updateVersionMethodOf:aClass for:newString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  2873
            ]
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2874
        ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2875
    ].
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2876
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2877
    "
997
c55b39b6c7a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2878
      self compareClassWithRepository:Array
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2879
    "
1497
061be9164dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1483
diff changeset
  2880
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  2881
    "Modified: / 24-07-2012 / 18:11:27 / cg"
4255
df635db10e0a #UI_ENHANCEMENT by mawalch
mawalch
parents: 4245
diff changeset
  2882
    "Modified (comment): / 04-09-2017 / 17:37:24 / mawalch"
4448
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  2883
    "Modified: / 23-06-2019 / 18:48:32 / Claus Gittinger"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2884
!
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
  2885
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2886
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
  2887
    "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
  2888
     and opens a diff browser on differences.
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2889
     
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2890
     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
  2891
     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
  2892
     revision.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2893
     
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2894
     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
  2895
     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
  2896
     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
  2897
     newest she wants."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2898
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2899
    self comparePackages:packages askForRevision:askForRevision extensionsOnly:false
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2900
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2901
    "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
  2902
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2903
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2904
comparePackages:packages askForRevision:askForRevision extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2905
    "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
  2906
     and opens a diff browser on differences.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2907
     
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2908
     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
  2909
     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
  2910
     revision.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2911
     
3536
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2912
     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
  2913
     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
  2914
     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
  2915
     newest she wants."
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2916
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2917
    |string dateOrNil symbolicNameOrNil knownTags includeSubProjectsHolder
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2918
     packagesIn packagesCompared|
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
    packagesIn := packages value.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2921
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2922
    knownTags := self knownTagsInPackages:packagesIn.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2923
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2924
    includeSubProjectsHolder := true asValue.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2925
    string := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2926
                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
  2927
                with:includeSubProjectsHolder 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2928
                knownTags:knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2929
                into:[:dateOrNilArg :symbolicNameOrNilArg |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2930
                    dateOrNil := dateOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2931
                    symbolicNameOrNil := symbolicNameOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2932
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2933
                    LastComparedTag := symbolicNameOrNil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2934
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2935
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2936
    string isNil ifTrue:[^ self].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2937
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2938
    packagesCompared := packagesIn.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2939
    includeSubProjectsHolder value ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2940
        packagesCompared := Smalltalk allPackageIDs
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2941
                        select:[:eachPackage |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2942
                            packagesIn contains:[:p | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2943
                                eachPackage = p 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2944
                                or:[ (eachPackage startsWith:(p,'-'))
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2945
                                or:[ (eachPackage startsWith:(p,':')) ]]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2946
                            ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2947
                        ]    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2948
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2949
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2950
    packagesCompared value do:[:eachProject |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2951
        dateOrNil notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2952
            self compareProject:eachProject withRepositoryVersionFrom:dateOrNil extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2953
        ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2954
            self compareProject:eachProject withRepositoryVersionTaggedAs:symbolicNameOrNil extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2955
        ]
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-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
  2959
    "Modified: / 05-02-2017 / 04:24:39 / 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
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2962
compareProject:aProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2963
        repositoryVersionFrom:dateOrNilV1 orTag:symbolicNameOrNilV1 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2964
        againstRepositoryVersionFrom:dateOrNilV2 orTag:symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2965
        extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2966
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2967
    |diffSet|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2968
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2969
    diffSet := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2970
                    diffSetOfProject:aProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2971
                    repositoryVersionFrom:dateOrNilV1 orTag:symbolicNameOrNilV1
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2972
                    againstRepositoryVersionFrom:dateOrNilV2 orTag:symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2973
                    extensionsOnly:extensionsOnly.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2974
    VersionDiffBrowser 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2975
        openOnDiffSet:diffSet 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2976
        labelA:(dateOrNilV1 ? symbolicNameOrNilV1) 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2977
        labelB:(dateOrNilV2 ? symbolicNameOrNilV2) 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2978
        title:('Differences of %1' bindWith:aProject)
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2979
        ignoreExtensions:true
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2980
        ignoreVersionMethods:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2981
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  2982
    "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
  2983
!
cb8679184d3b Compare packages functionality moved from browser to SourceCoeManagerUtilities
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3534
diff changeset
  2984
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2985
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2986
    ^ self compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2987
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2988
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2989
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2990
    |diffSet|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  2991
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  2992
    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
  2993
    VersionDiffBrowser 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2994
        openOnDiffSet:diffSet 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2995
        labelA:'Repository' 
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  2996
        labelB:'Image' 
2522
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  2997
        title:('Differences of %1' bindWith:aProject)
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2998
        ignoreExtensions:true
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  2999
        ignoreVersionMethods:true.
2522
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  3000
d32ade066c3f changed: #compareProject:withRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  3001
    "Modified: / 12-09-2011 / 11:56:01 / cg"
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3002
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3003
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3004
compareProject:aProject withRepositoryVersionTaggedAs:aSymbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3005
    |diffSet|
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3006
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3007
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionTaggedAs:aSymbolicName.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3008
    VersionDiffBrowser 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3009
        openOnDiffSet:diffSet 
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3010
        labelA:'Repository ("',(aSymbolicName?'newest'),'")' 
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3011
        labelB:'Image' 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3012
        title:('Differences of %1' bindWith:aProject)
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  3013
        ignoreExtensions:true
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  3014
        ignoreVersionMethods:true.
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3015
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3016
    "Modified: / 12-09-2011 / 11:56:01 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3017
    "Modified (format): / 04-02-2017 / 18:54:02 / cg"
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3018
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3019
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3020
compareProject:aProject withRepositoryVersionTaggedAs:aTagOrNil extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3021
    "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
  3022
    
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3023
    |diffSet|
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3024
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3025
    diffSet := self diffSetOfProject:aProject againstRepositoryVersionTaggedAs:aTagOrNil extensionsOnly:extensionsOnly.
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3026
    VersionDiffBrowser 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3027
        openOnDiffSet:diffSet 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3028
        labelA:'Repository' 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3029
        labelB:'Image' 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3030
        title:('Differences of %1' bindWith:aProject)
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3031
        ignoreExtensions:true
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3032
        ignoreVersionMethods:true.
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3033
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3034
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3035
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3036
     CVSSourceCodeManager utilities
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3037
            compareProject:'stx:libbasic2'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3038
            withRepositoryVersionTaggedAs:nil 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3039
            extensionsOnly:false.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3040
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3041
     CVSSourceCodeManager utilities
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3042
            compareProject:'stx:libbasic2'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3043
            withRepositoryVersionTaggedAs:'expecco_2_10_0' 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3044
            extensionsOnly:false.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3045
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3046
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3047
    "Created: / 12-11-2016 / 03:39:48 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3048
    "Modified (comment): / 04-02-2017 / 18:46:49 / cg"
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3049
!
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3050
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3051
compareProjectWithRepository:aProject
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3052
    ^ self compareProject:aProject withRepositoryVersionFrom:nil
1875
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  3053
!
f00eb53229ae first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1864
diff changeset
  3054
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3055
compareTwoPackageVersions:packages
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3056
    "Compares two versions of given packages."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3057
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3058
    self compareTwoPackageVersions:packages extensionsOnly:false
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3059
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3060
    "Created: / 04-02-2017 / 17:33:02 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3061
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3062
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3063
compareTwoPackageVersions:packagesIn extensionsOnly:extensionsOnly 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3064
    "Compares two versions of given packages
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3065
     and opens a diff browser on differences."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3066
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3067
    |string includeSubProjectsHolder knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3068
     dateOrNilV1 dateOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3069
     symbolicNameOrNilV1 symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3070
     packagesCompared|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3071
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3072
    knownTags := self knownTagsInPackages:packagesIn first.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3073
    includeSubProjectsHolder := true asValue.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3074
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3075
    string := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3076
                askForPackageVersion:'First version''s date (%1) or tag (any other format):'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3077
                with:includeSubProjectsHolder 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3078
                knownTags:knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3079
                into:[:dateOrNilArg :symbolicNameOrNilArg |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3080
                    dateOrNilV1 := dateOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3081
                    symbolicNameOrNilV1 := symbolicNameOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3082
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3083
    string isNil ifTrue:[^ self].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3084
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3085
    string := self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3086
                askForPackageVersion:'Second version''s date (%1) or tag (any other format):'
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3087
                with:nil 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3088
                knownTags:knownTags
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3089
                into:[:dateOrNilArg :symbolicNameOrNilArg |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3090
                    dateOrNilV2 := dateOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3091
                    symbolicNameOrNilV2 := symbolicNameOrNilArg.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3092
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3093
    string isNil ifTrue:[^ self].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3094
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3095
    LastComparedTag := symbolicNameOrNilV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3096
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3097
    packagesCompared := packagesIn.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3098
    includeSubProjectsHolder value ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3099
        packagesCompared := 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3100
            Smalltalk allPackageIDs
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3101
                select:[:eachPackage |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3102
                    packagesIn contains:[:p | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3103
                        eachPackage = p 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3104
                        or:[ (eachPackage startsWith:(p,'-'))
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3105
                        or:[ (eachPackage startsWith:(p,':')) ]]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3106
                    ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3107
                ]    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3108
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3109
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3110
    packagesCompared value do:[:eachProject |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3111
        self 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3112
            compareProject:eachProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3113
            repositoryVersionFrom:dateOrNilV1 orTag:symbolicNameOrNilV1 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3114
            againstRepositoryVersionFrom:dateOrNilV2 orTag:symbolicNameOrNilV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3115
            extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3116
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3117
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3118
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3119
     CVSSourceCodeManager utilities
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3120
        compareTwoPackageVersions:#('stx:libbasic') extensionsOnly:true   
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3121
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3122
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3123
    "Created: / 04-02-2017 / 17:51:09 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3124
    "Modified: / 05-02-2017 / 04:23:07 / cg"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3125
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3126
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3127
createSourceContainerForClass:aClass
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3128
    "let user specify the source-repository values for aClass.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3129
     Return false, if failed."
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3130
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3131
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3132
        createSourceContainerForClass:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3133
        usingManager:(self sourceCodeManagerFor:aClass).
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3134
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3135
    "Modified: / 21-12-2011 / 18:31:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3136
!
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3137
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3138
createSourceContainerForClass:aClass usingManager:aManager
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3139
    "let user specify the source-repository values for aClass.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3140
     Return false, if failed."
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3141
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3142
    ^ self
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3143
        createSourceContainerForClass:aClass usingManager:aManager
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3144
        confirmNewContainer:confirmNewFiles   
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3145
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3146
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3147
createSourceContainerForClass:aClass usingManager:aManager confirmNewContainer:confirmNewContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3148
    "let user specify the source-repository values for aClass.
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3149
     Return false, if failed."
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3150
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3151
    aManager isNil ifTrue:[^ false].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3152
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3153
    ^ self 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3154
        defineSourceContainerForClass:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3155
        usingManager:aManager
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3156
        title:(resources string:'Repository information for %1' with:aClass name)
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3157
        text:(resources string:'Create new %1-repository container for ''%2''' 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3158
                            with:aManager managerTypeName
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3159
                            with:aClass name allBold)
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3160
        createDirectories:true
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3161
        createContainer:true
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3162
        confirmNewContainer:confirmNewContainer.
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3163
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3164
    "Created: / 21-12-2011 / 18:31:23 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3165
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3166
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3167
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
  3168
    "let user specify the source-repository values for aClass"
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3169
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3170
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3171
        defineSourceContainerForClass:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3172
        usingManager:(self sourceCodeManagerFor:aClass)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3173
        title:title 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3174
        text:boxText 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3175
        createDirectories:createDirs 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3176
        createContainer:createContainer
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3177
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3178
    "Modified: / 21-12-2011 / 18:34:44 / cg"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3179
!
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3180
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3181
defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText createDirectories:createDirs createContainer:createContainer
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3182
    "let user specify the source-repository values for aClass"
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3183
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3184
    ^ self
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3185
        defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3186
        createDirectories:createDirs createContainer:createContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3187
        confirmNewContainer:confirmNewFiles
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3188
!
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3189
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3190
defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText 
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3191
    createDirectories:createDirs createContainer:createContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3192
    confirmNewContainer:confirmNewContainer
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3193
    "let user specify the source-repository values for aClass"
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3194
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3195
    |className
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3196
     "oldModule oldPackage" oldFileName
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3197
     module directory fileName nameSpace nameSpacePrefix
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3198
     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
  3199
     answer doCheckinWithoutAsking forceCheckIn rslt note
3276
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3200
     requiredPackage classPackage|
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3201
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3202
    mgr isNil ifTrue:[^  false].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3203
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3204
    aClass isLoaded ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3205
        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
  3206
        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3207
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3208
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3209
    className := aClass name.
3276
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3210
    classPackage := aClass package.
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3211
    classPackage ~= PackageId noProjectID ifTrue:[
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3212
        module := classPackage asPackageId module.
e6902cec8b2f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3272
diff changeset
  3213
        directory := classPackage asPackageId directory.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3214
    ] ifFalse:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3215
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3216
        "/ defaults, if nothing at all is known
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3217
        "/
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3218
        (module := LastModule) isNil ifTrue:[
3919
1373d06bbd50 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3906
diff changeset
  3219
            module := (UserPreferences current usersModuleName "OperatingSystem getLoginName").
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3220
        ].
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3221
        (directory := LastPackage) isNil ifTrue:[
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3222
            directory := 'private'.
3153
c2bca6dbe3a7 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3146
diff changeset
  3223
        ]. 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3224
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3225
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3226
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3227
    "/ 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
  3228
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3229
    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3230
        directory isNil ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3231
            (nm := project repositoryDirectory) isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3232
                nm := project name
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3233
            ].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3234
            directory := nm.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3235
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3236
        module isNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3237
            (nm := project repositoryModule) notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3238
                module := nm
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3239
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3240
        ].
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
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3243
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3244
    "/ 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
  3245
    "/ if so, take that as a default.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3246
    "/
1189
fdc5e747c184 refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
  3247
    info := mgr sourceInfoOfClass:aClass.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3248
    info notNil ifTrue:[
1368
20cde03a3cd6 defineSource - fixed package & module extraction
martin
parents: 1347
diff changeset
  3249
        true "module ~= LastModule" ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3250
            (info includesKey:#module) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3251
                module := (info at:#module).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3252
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3253
        ].
1401
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3254
"/        true "package ~= LastPackage" ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3255
"/            (info includesKey:#directory) ifTrue:[
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3256
"/                package := (info at:#directory).
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3257
"/            ].
102c0c12b66b default package changed
Claus Gittinger <cg@exept.de>
parents: 1391
diff changeset
  3258
"/        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3259
        fileName := mgr containerFromSourceInfo:info.
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  3260
        fileName isNil ifTrue:[ fileName := aClass classFilename ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3261
        (nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3262
            nameSpacePrefix := nameSpace name , '::'.
3259
5eb58e78257e refactored
Claus Gittinger <cg@exept.de>
parents: 3227
diff changeset
  3263
            fileName := fileName withoutPrefix:nameSpacePrefix.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3264
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3265
"/        (info includesKey:#fileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3266
"/            fileName := (info at:#fileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3267
"/        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3268
"/            (info includesKey:#expectedFileName) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3269
"/                fileName := (info at:#expectedFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3270
"/            ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3271
"/                (info includesKey:#classFileNameBase) ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3272
"/                    fileName := (info at:#classFileNameBase) , '.st'.
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
"/            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3275
"/        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3276
    ].
4058
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3277
    directory isNil ifTrue:[
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3278
        Dialog information:('Using %1 as last package-folder' bindWith:LastPackage).
3514
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3279
        directory := LastPackage.
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3280
    ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3281
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3282
    fileName isNil ifTrue:[
1338
bad5961fbff1 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 1323
diff changeset
  3283
        fileName := (Smalltalk fileNameForClass:aClass) , '.st'.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3284
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3285
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3286
    OperatingSystem isMSDOSlike ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3287
        module replaceAll:$\ with:$/.
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3288
        directory replaceAll:$\ with:$/.
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
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3291
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3292
    "/ 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
  3293
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3294
    doCheckinWithoutAsking := false.
1831
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3295
"/false ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3296
"/    (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
  3297
"/        answer := Dialog confirmWithCancel:(resources 
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3298
"/                            string:'About to change the source container.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3299
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3300
"/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
  3301
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3302
"/    %2 / %3 / %4
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3303
"/
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3304
"/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
  3305
"/                            with:className
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3306
"/                            with:module
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3307
"/                            with:directory
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3308
"/                            with:fileName)
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3309
"/                labels:(resources array:#('Cancel' 'Check in' 'Change')).
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  3310
"/        answer isNil ifTrue:[AbortOperationRequest raise].
1831
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3311
"/        answer ifTrue:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3312
"/            doCheckinWithoutAsking := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3313
"/            oldModule := module.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3314
"/            oldPackage := directory.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3315
"/            oldFileName := fileName
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3316
"/        ] ifFalse:[
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3317
"/            doCheckinWithoutAsking := true.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3318
"/            creatingNew := false.
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3319
"/        ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3320
"/    ].
cda120c93659 do not ask for changed source-container based on the default
sr
parents: 1828
diff changeset
  3321
"/].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3322
    mgr isContainerBased ifTrue:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3323
        doCheckinWithoutAsking ifFalse:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3324
            "/
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3325
            "/ open a dialog for this
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3326
            "/
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3327
            (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
  3328
                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
  3329
                creatingNew := true.
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3330
            ] ifTrue:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3331
                creatingNew := false.
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3332
            ].
3992
bf6479f38b32 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3333
            confirmNewContainer ifTrue:[
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3334
                rslt := self 
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3335
                            askForContainer:boxText title:title note:note
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3336
                            initialModule:module initialPackage:directory initialFileName:fileName
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3337
                            forNewContainer:true.        
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3338
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3339
                rslt isNil ifTrue:[
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3340
                    ^ false
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3341
                ].
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3342
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3343
                module := rslt at:#module.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3344
                directory := rslt at:#package.
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3345
                fileName := rslt at:#fileName.
4058
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3346
                (module isEmptyOrNil or:[fileName isEmptyOrNil]) ifTrue:[
3514
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3347
                    ^ false
a35b833ed992 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3433
diff changeset
  3348
                ].
4058
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3349
                (directory isEmptyOrNil) ifTrue:[
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3350
                    "/ only one special case allowed - the module-folder description itself.
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3351
                    aClass name = module ifFalse:[^ false].
27c8b7295fb3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4037
diff changeset
  3352
                ]
2847
406b336637ae class definition
Claus Gittinger <cg@exept.de>
parents: 2836
diff changeset
  3353
            ]
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3354
        ].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3355
        (fileName endsWith:',v') ifTrue:[
3227
bcaec3eb2d97 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3202
diff changeset
  3356
            fileName := fileName copyButLast:2
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3357
        ].
2688
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3358
        (fileName endsWith:'.st') ifFalse:[
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3359
            fileName := fileName , '.st'
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3360
        ].
fa8075458983 changed: #defineSourceContainerForClass:usingManager:title:text:createDirectories:createContainer:
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
  3361
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3362
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3363
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3364
    "/ 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
  3365
    "/ check for this ...
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3366
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3367
    requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol.
952
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3368
    requiredPackage ~= aClass package ifTrue:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3369
"/        doCheckinWithoutAsking ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3370
"/            (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
  3371
"/            ifFalse:[
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3372
"/                ^ false
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3373
"/            ]
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3374
"/        ].
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  3375
        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
  3376
        aClass package:requiredPackage.
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3377
    ].
c75976ac7b7f when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3378
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3379
    info := aClass revisionInfo.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3380
    info notNil ifTrue:[
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3381
        (info repositoryPathName isNil) ifTrue:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3382
            info := nil
2063
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3383
        ].
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3384
"/        (info includesKey:#repositoryPathName) ifFalse:[
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3385
"/            info := nil
502166975e05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3386
"/        ]
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3387
    ].
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  3388
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3389
    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
  3390
        true "doCheckinWithoutAsking" ifFalse:[
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3391
            answer := Dialog 
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3392
                 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
  3393
                 labels:(resources array:#( 'Cancel' 'No' 'Yes')).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3394
            answer isNil ifTrue:[^ false].
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3395
        ] ifTrue:[
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3396
            answer := true.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3397
        ].
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3398
        answer ifTrue:[
2637
dbfb2ef410bd changed:
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  3399
            mgr
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3400
                updateVersionMethodOf:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3401
                for:(mgr initialRevisionStringFor:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3402
                         inModule:module 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3403
                         directory:directory 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3404
                         container:fileName).
979
2374556f8a09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
  3405
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3406
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3407
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3408
    (self checkForExistingModule:module usingManager:mgr allowCreate:(createDirs or:[creatingNew]))
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3409
        ifFalse:[^ false].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3410
    LastModule := module.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3411
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  3412
    (self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:(createDirs or:[creatingNew]))
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3413
        ifFalse:[^ false].
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3414
    LastPackage := directory.
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3415
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3416
    "/
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3417
    "/ check for the container itself
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3418
    "/
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3419
    (mgr isContainerBased not
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3420
    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
  3421
"/            (oldModule notNil
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3422
"/            and:[(oldModule ~= module)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3423
"/                 or:[oldPackage ~= package
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3424
"/                 or:[oldFileName ~= fileName]]])
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3425
"/            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3426
"/                self warn:(resources string:'no change').
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3427
"/                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3428
"/            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3429
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3430
        mgr isContainerBased ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3431
            creatingNew ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3432
                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
  3433
            ].
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3434
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3435
            doCheckinWithoutAsking ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3436
                (Dialog 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3437
                    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
  3438
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3439
    %2 / %3 / %4  ?'
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3440
                                    with:className
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3441
                                    with:module 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3442
                                    with:directory 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3443
                                    with:fileName) withCRs
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3444
                    noLabel:'Cancel') 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3445
                ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3446
                    ^ false.
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3447
                ].  
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3448
            ].  
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3449
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3450
2637
dbfb2ef410bd changed:
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  3451
        mgr 
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3452
            updateVersionMethodOf:aClass 
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3453
            for:('$' , 'Header' , '$'). "/ concatenated to avoid RCS-expansion
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3454
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3455
        oldFileName notNil ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3456
            msg := ('forced checkin / source container change from ' , oldFileName).
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3457
        ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3458
            msg := 'defined source container'
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3459
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3460
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3461
        (forceCheckIn := doCheckinWithoutAsking) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3462
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3463
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3464
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3465
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3466
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3467
                logMessage:msg)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3468
            ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3469
                doCheckinWithoutAsking ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3470
                    (Dialog 
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3471
                        confirm:'No easy merge seems possible; force checkin (no merge) ?'
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3472
                        noLabel:'Cancel') 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3473
                    ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3474
                        ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3475
                    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3476
                ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3477
                forceCheckIn := true.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3478
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3479
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3480
        forceCheckIn ifTrue:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3481
            (mgr
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3482
                checkinClass:aClass 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3483
                fileName:fileName 
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3484
                directory:directory 
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3485
                module:module 
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3486
                logMessage:msg
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3487
                force:true)
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3488
            ifFalse:[
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3489
                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
  3490
                ^ false.
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3491
            ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3492
        ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3493
        ^ true
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3494
    ] ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3495
        (createContainer or:[creatingNew]) ifFalse:[
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3496
            (Dialog
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3497
                 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
  3498
                                      with:fileName with:module with:directory) withCRs
1076
4adaffbd7ab0 upper-case
Claus Gittinger <cg@exept.de>
parents: 1070
diff changeset
  3499
                 noLabel:'Cancel') ifFalse:[
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3500
                ^ false
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3501
            ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3502
        ]
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3503
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3504
1882
8b3a4c2a2c2a when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3505
    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
  3506
    aClass package:requiredPackage.
1913
d87c1ed5bf1f oops - halt
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3507
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3508
    [ mgr
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3509
        createContainerFor:aClass
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3510
        inModule:module
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3511
        package:directory
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3512
        container:fileName
3155
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3513
    ] whileFalse:[
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3514
        (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
  3515
            ^ false.
9c22d8b4315b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3153
diff changeset
  3516
        ].
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3517
    ].
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3518
    ^ true
1533
6897306a3cda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  3519
2651
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  3520
    "Created: / 21-12-2011 / 18:34:02 / cg"
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  3521
    "Modified: / 30-04-2016 / 11:58:11 / cg"
876
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3522
!
461b86272f48 more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
  3523
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3524
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3525
    ^ self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3526
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3527
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3528
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest extensionsOnly:extensionsOnly
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3529
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3530
        diffSetOfProject:aProject 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3531
        againstRepositoryVersionFrom:aDateOrNilForNewest
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3532
        orTag:nil
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3533
        extensionsOnly:extensionsOnly
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3534
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3535
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3536
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest orTag:aTagOrNil
2950
cd6dc0f1d994 comment/format in: #diffSetOfProject:againstRepositoryVersionFrom:orTag:
Claus Gittinger <cg@exept.de>
parents: 2949
diff changeset
  3537
    "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
  3538
     or a the version with a particular tag."
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3539
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3540
    ^ self
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3541
        diffSetOfProject:aProject 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3542
        againstRepositoryVersionFrom:aDateOrNilForNewest 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3543
        orTag:aTagOrNil 
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3544
        extensionsOnly:false
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3545
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3546
    "Modified: / 01-11-2010 / 21:02:52 / cg"
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3547
!
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3548
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3549
diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest orTag:aTagOrNil extensionsOnly:extensionsOnly
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3550
    "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
  3551
     or a the version with a particular tag (if not nil),
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3552
     or the newest (head) (if both are nil)."
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3553
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3554
    |classesInImage filesInImage module directory perProjectInfo 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3555
     classesNotInRepository filesNotInImage classesDeletedInRepository
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3556
     classesModifiedInImage classesNotReallyModified classesReallyModified classesNewerInRepository 
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3557
     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
  3558
     box doCleanup diffSet def autoloadedFilesNotInImage 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3559
     autoloadedClassesInImage autoloadedFilesInImage versionMethodsAndDoitsRejected|
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3560
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3561
    module := aProject asPackageId module.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3562
    directory := aProject asPackageId directory.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3563
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3564
    (aDateOrNilForNewest isNil and:[ aTagOrNil notNil ]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3565
        perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aTagOrNil.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3566
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3567
        perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilForNewest.
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3568
    ].
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3569
    perProjectInfo := perProjectInfo ? #().
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3570
    perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3571
    perProjectInfo := Dictionary withAssociations:perProjectInfo.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3572
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3573
    "/ to ignore version_xxx methods
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3574
    versionMethodsAndDoitsRejected := 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3575
        [:aChangeSet | 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3576
            aChangeSet reject:[:chg | 
2949
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  3577
                false "chg isMethodChangeForVersionMethod" 
83170e2244f3 changed:
Claus Gittinger <cg@exept.de>
parents: 2948
diff changeset
  3578
                or:[false "chg isMethodChangeForExtensionsVersionMethod"
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3579
                or:[chg isDoIt]]]
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3580
        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3581
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3582
    classesInImage := Smalltalk allClassesInPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3583
    autoloadedClassesInImage := classesInImage reject:[:cls | cls isLoaded].
2903
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  3584
    classesInImage := classesInImage select:[:cls | cls isLoaded and:[cls isPrivate not]].
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  3585
    filesInImage := classesInImage collect:[:cls | cls classBaseFilename] as:Set.
482f5086773d changed: #diffSetOfProject:againstRepositoryVersionFrom:
Stefan Vogel <sv@exept.de>
parents: 2864
diff changeset
  3586
    autoloadedFilesInImage := autoloadedClassesInImage collect:[:cls | cls classBaseFilename] as:Set.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3587
    "/ any differences ?
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3588
    classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3589
    classesDeletedInRepository := classesInImage select:[:cls | (perProjectInfo at:cls classBaseFilename ifAbsent:nil) == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3590
    perProjectInfo := perProjectInfo reject:[:v | v == #deleted].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3591
    filesNotInImage := perProjectInfo keys reject:[:file | (filesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3592
    filesNotInImage := filesNotInImage reject:[:file | (autoloadedFilesInImage includes:file)].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3593
    filesNotInImage remove:'extensions.st' ifAbsent:[].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3594
4338
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3595
    "/ if comparing against the newest, only look for changed stuff
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3596
    classesModifiedInImage := classesInImage select:[:cls | ChangeSet current includesChangeForClassOrMetaclass:cls].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3597
    classesModifiedInImage := classesModifiedInImage \ classesNotInRepository.
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
    classesNewerInRepository := classesInImage 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3600
                                    select:[:cls | 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3601
                                        |v clsRevision|
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3602
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3603
                                        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
  3604
                                        v notNil 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3605
                                            and:[ cls isLoaded 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3606
                                            and:[ (clsRevision := cls revision) notNil 
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3607
                                            and:[ v > clsRevision ]]]
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3608
                                    ].
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3609
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3610
    "/ stupid: as we do not have any revision information for extensions (sigh);
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3611
    "/ 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
  3612
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3613
    extensionMethods := Smalltalk allExtensionsForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3614
    extensionsInImage := ChangeSet forExistingMethods:extensionMethods.
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
        |s extensionsRevision|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3618
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3619
        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
  3620
        [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3621
            s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3622
                    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
  3623
                    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
  3624
            s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3625
                extensionsInRepository := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3626
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3627
        ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3628
            s notNil ifTrue:[s close]
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3629
        ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3630
        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
  3631
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3632
        "/ 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
  3633
        extensionsInRepository := versionMethodsAndDoitsRejected value:extensionsInRepository.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3634
    ] value.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3635
    extensionDiffs := extensionsInRepository diffSetsAgainst:extensionsInImage.
3926
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3636
    extensionsOnly ifTrue:[
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3637
        ^ extensionDiffs
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3638
    ].
b40b391c71b6 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
  3639
    
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3640
    diffSet := extensionDiffs copy.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3641
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3642
    (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
  3643
        "/ we could do the same as below for each class.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3644
        "/ however - as we do have change-info and revision info, we can avoid checking out
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3645
        "/ for all classes which are not changed and which have the same version info.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3646
        classesModifiedInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3647
            classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3648
                classesModifiedInImage select:[:eachChangedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3649
                    |currentVersion repositoryVersion s stFile diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3650
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3651
                    stFile := eachChangedClass classBaseFilename.
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3652
                    [    
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3653
                        s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3654
                                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
  3655
                                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
  3656
                        s notNil ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3657
                            repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3658
                        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3659
                    ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3660
                        s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3661
                    ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3662
                    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
  3663
                    repositoryVersion := versionMethodsAndDoitsRejected value:repositoryVersion.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3664
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3665
                    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
  3666
                    currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3667
                    diffs := repositoryVersion diffSetsAgainst:currentVersion .
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3668
                    diffSet addDiffSet:diffs.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3669
                    diffs notEmpty
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3670
                ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3671
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3672
            classesNotReallyModified := classesModifiedInImage \ classesReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3673
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3674
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3675
        classesReallyModified :=
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3676
            classesInImage select:[:eachClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3677
                |currentVersion repositoryVersion s stFile stRevision diffs|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3678
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3679
                stFile := eachClass classBaseFilename.
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3680
                stRevision := perProjectInfo at:stFile ifAbsent:nil.
4338
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3681
                eachClass revision = stRevision ifTrue:[
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3682
                    false
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3683
                ] ifFalse:[    
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3684
                    stRevision notNil ifTrue:[
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3685
                        [
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3686
                            s := SourceCodeManager
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3687
                                    streamForClass:nil fileName:stFile revision:stRevision 
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3688
                                    directory:directory module:module cache:true.
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3689
                            s notNil ifTrue:[
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3690
                                repositoryVersion := ChangeSet fromStream:s.
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3691
                            ].
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3692
                        ] ensure:[
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3693
                            s notNil ifTrue:[s close].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3694
                        ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3695
                    ].
4338
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3696
                    repositoryVersion isNil ifTrue:[
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3697
                        repositoryVersion := ChangeSet new.
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3698
                    ].
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3699
                    repositoryVersion := versionMethodsAndDoitsRejected value:repositoryVersion.
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3700
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3701
                    currentVersion := ChangeSet forExistingClass:eachClass withExtensions:false withLooseMethods:true.
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3702
                    currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3703
                    diffs := repositoryVersion diffSetsAgainst:currentVersion .
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3704
                    diffSet addDiffSet:diffs.
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3705
                    diffs notEmpty
2295
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  3706
                ].
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3707
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3708
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3709
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3710
    filesNotInImage notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3711
        "/ first, check if these are autoloaded classes which have NOT been installed
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3712
        "/ (for example, due to a --quick argument during startup)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3713
        autoloadedFilesNotInImage := OrderedCollection new.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3714
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3715
        def := ProjectDefinition definitionClassForPackage:aProject createIfAbsent:false projectType:nil.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3716
        def notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3717
            def classNamesAndAttributesDo:[:eachClassname :eachAttributes | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3718
                |cls eachFileName isAutoload|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3719
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3720
                cls := Smalltalk classNamed:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3721
                cls isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3722
                    isAutoload := eachAttributes includes:#autoload.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3723
                    isAutoload ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3724
                        eachFileName := Smalltalk fileNameForClass:eachClassname.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3725
                        autoloadedFilesNotInImage add:(eachFileName , '.st')
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3726
                    ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3727
                ]
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3728
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3729
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3730
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3731
        (filesNotInImage \ autoloadedFilesNotInImage) do:[:eachSTFile |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3732
            |s chgSet classDefinitions|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3733
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3734
            [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3735
                s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3736
                        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
  3737
                s isNil ifTrue:[
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3738
                    chgSet := ChangeSet new
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3739
                ] ifFalse:[
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3740
                    chgSet := ChangeSet fromStream:s.
407ae2f32318 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3591
diff changeset
  3741
                ]
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3742
            ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3743
                s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3744
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3745
            chgSet := versionMethodsAndDoitsRejected value:chgSet.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3746
            diffSet onlyInReceiver addAll:chgSet
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3747
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3748
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3749
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3750
    classesNewerInRepository notEmpty ifTrue:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3751
        classesNewerInRepository do:[:eachClass|
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3752
            |s diffs repositoryVersion currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3753
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3754
            [
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3755
                s := SourceCodeManager
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3756
                        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
  3757
                repositoryVersion := ChangeSet fromStream:s.
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3758
            ] ensure:[
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3759
                s notNil ifTrue:[s close].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3760
            ].
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3761
4519
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3762
            ChangeSet::InvalidChangeChunkError handle:[:ex |
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3763
                Dialog information:(resources stringWithCRs:'Failed to fetch source of %1 (source corrupted).\Class skipped in comparison' with:eachClass name)
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3764
            ] do:[
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3765
                currentVersion := ChangeSet forExistingClass:eachClass withExtensions:false withLooseMethods:true.
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3766
                currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3767
                diffs := repositoryVersion diffSetsAgainst:currentVersion .
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3768
                diffSet addDiffSet:diffs.
e0aab139cd66 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4515
diff changeset
  3769
            ]
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3770
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3771
    ].
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3772
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3773
    classesDeletedInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3774
"/ self halt.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3775
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3776
    classesNotInRepository notEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3777
        "/ if there are no changeSet entries for those classes, they seem to be
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3778
        "/ no longer in the repository (possibly moved ?)
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3779
        "/ 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
  3780
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3781
        classesAddedInImage := classesNotInRepository \ classesDeletedInRepository.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3782
        classesAddedInImage do:[:eachAddedClass |
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3783
            |currentVersion|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3784
2948
548a75a5a3b5 project diff fixed (care for version and loos methods)
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3785
            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
  3786
            currentVersion := versionMethodsAndDoitsRejected value:currentVersion.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3787
            diffSet onlyInArg addAll:currentVersion.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3788
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3789
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3790
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3791
    diffSet isEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3792
        "/ Dialog information:(resources string:'%1 is up-to-date.' with:eachProject allBold).
4458
abe7565c10fb #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4456
diff changeset
  3793
        Transcript showCR:'%1 is up-to-date.' with:aProject allBold.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3794
        (ChangeSet current includesChangeForPackage:aProject) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3795
            (Dialog confirm:('%1 is up-to-date.\\Cleanup ChangeSet ?' bindWith:aProject allBold) withCRs) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3796
                ChangeSet current condenseChangesForPackage:aProject.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3797
            ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3798
        ].
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3799
        ^ diffSet.
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3800
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3801
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  3802
    diffSet sortByClassName.
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  3803
    
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3804
    "/ 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
  3805
    "/ give user a chance to cleanup the changeSet here.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3806
    aDateOrNilForNewest isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3807
        classesNotReallyModified notEmptyOrNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3808
            doCleanup := false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3809
            box := Dialog
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3810
                forRequestText:(resources 
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3811
                                    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
  3812
                                    with:aProject allBold) 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3813
                editViewClass:ListView
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3814
                lines:10 columns:20 
3199
830195868b71 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  3815
                initialAnswer:nil 
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3816
                setupWith:
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3817
                   [:v :d | 
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3818
                            |removeButton|
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3819
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3820
                            v list:classesNotReallyModified.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3821
                            removeButton := Button label:(resources string:'Cleanup ChangeSet').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3822
                            removeButton action:[ doCleanup := true. box okPressed. ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3823
                            d addButton:removeButton after:(d okButton).
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3824
                            d okButton label:(resources string:'Continue').
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3825
                            d okButton isReturnButton:false.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3826
                            removeButton isReturnButton:true.
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3827
                   ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3828
            box open.
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3829
            box accepted ifTrue:[
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3830
                doCleanup ifTrue:[
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3831
                    classesNotReallyModified do:[:class |
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3832
                        ChangeSet current condenseChangesForClass:class.
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3833
                    ]
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3834
                ].
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3835
            ]
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3836
        ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3837
    ].
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3838
    ^ diffSet
2286
ad425b1c40ab changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3839
2295
505293d1cfbd changed: #diffSetOfProject:againstRepositoryVersionFrom:
Claus Gittinger <cg@exept.de>
parents: 2294
diff changeset
  3840
    "Modified: / 01-11-2010 / 21:02:52 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3841
    "Modified (comment): / 04-02-2017 / 18:49:12 / cg"
4338
dd140314af79 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4329
diff changeset
  3842
    "Modified: / 02-07-2018 / 14:01:01 / Claus Gittinger"
2189
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3843
!
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  3844
2939
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3845
diffSetOfProject:aProject againstRepositoryVersionTaggedAs:symbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3846
    ^ self
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3847
        diffSetOfProject:aProject 
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3848
        againstRepositoryVersionFrom:nil
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3849
        orTag:symbolicName
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3850
!
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
  3851
4132
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3852
diffSetOfProject:aProject againstRepositoryVersionTaggedAs:aTag extensionsOnly:extensionsOnly
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3853
    ^ self
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3854
        diffSetOfProject:aProject 
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3855
        againstRepositoryVersionFrom:nil
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3856
        orTag:aTag
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3857
        extensionsOnly:extensionsOnly
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3858
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3859
    "Created: / 12-11-2016 / 03:41:23 / cg"
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3860
!
205c322f6daf #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4080
diff changeset
  3861
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3862
diffSetOfProject:aProject 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3863
    repositoryVersionFrom:aDateOrNilV1 orTag:aTagOrNilV1
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3864
    againstRepositoryVersionFrom:aDateOrNilV2 orTag:aTagOrNilV2 extensionsOnly:extensionsOnly
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3865
    "return a diffset of two repository versions,
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3866
     each specified by either a version at a particular date,
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3867
     or a the version with a particular tag."
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3868
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3869
    |"classesInImage filesInImage" module directory 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3870
     perProjectInfoV1 perProjectInfoV2 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3871
     filesInRepositoryV1 filesInRepositoryV2
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3872
     filesAddedInV2 filesDeletedInV2 filesModified filesReallyModified
4204
5291c8e8c732 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  3873
     unchanged "filesNotInImage" "classesAddedInImage extensionMethods"  
5291c8e8c732 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  3874
     extensionsInRepositoryV1 extensionsInRepositoryV2 extensionDiffs diffSet "autoloadedClassesInImage autoloadedFilesInImage" versionMethodsAndDoitsRejected|
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3875
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3876
    module := aProject asPackageId module.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3877
    directory := aProject asPackageId directory.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3878
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3879
    (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
  3880
    (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
  3881
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3882
    aDateOrNilV1 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3883
        perProjectInfoV1 := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aTagOrNilV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3884
    ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3885
        perProjectInfoV1 := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3886
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3887
    perProjectInfoV1 := perProjectInfoV1 ? #().
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3888
    perProjectInfoV1 := perProjectInfoV1 select:[:info | info key asFilename hasSuffix:'st'].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3889
    perProjectInfoV1 := Dictionary withAssociations:perProjectInfoV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3890
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3891
    aDateOrNilV2 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3892
        perProjectInfoV2 := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aTagOrNilV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3893
    ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3894
        perProjectInfoV2 := SourceCodeManager revisionsInModule:module directory:directory fromDate:aDateOrNilV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3895
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3896
    perProjectInfoV2 := perProjectInfoV2 ? #().
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3897
    perProjectInfoV2 := perProjectInfoV2 select:[:info | info key asFilename hasSuffix:'st'].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3898
    perProjectInfoV2 := Dictionary withAssociations:perProjectInfoV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3899
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3900
    filesInRepositoryV1 := perProjectInfoV1 keys.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3901
    filesInRepositoryV2 := perProjectInfoV2 keys.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3902
    filesInRepositoryV1 := filesInRepositoryV1 reject:[:fileName | (perProjectInfoV1 at:fileName) == #deleted].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3903
    filesInRepositoryV2 := filesInRepositoryV2 reject:[:fileName | (perProjectInfoV2 at:fileName) == #deleted].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3904
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3905
    "/ first remove classes which have the same version
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3906
    unchanged := filesInRepositoryV1 select:[:fileName |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3907
                    (filesInRepositoryV2 includes:fileName)
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3908
                    and:[ (perProjectInfoV1 at:fileName) = (perProjectInfoV2 at:fileName) ]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3909
                 ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3910
    filesInRepositoryV1 removeAll:unchanged.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3911
    filesInRepositoryV2 removeAll:unchanged.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3912
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3913
    filesAddedInV2   := filesInRepositoryV2 select:[:fileName | (filesInRepositoryV1 includes:fileName) not].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3914
    filesDeletedInV2 := filesInRepositoryV1 select:[:fileName | (filesInRepositoryV2 includes:fileName) not].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3915
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3916
    filesModified    := filesInRepositoryV1 select:[:fileName | filesInRepositoryV2 includes:fileName].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3917
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3918
    "/ to ignore version_xxx methods
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3919
    versionMethodsAndDoitsRejected := 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3920
        [:aChangeSet | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3921
            aChangeSet reject:[:chg | 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3922
                false "chg isMethodChangeForVersionMethod" 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3923
                or:[false "chg isMethodChangeForExtensionsVersionMethod"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3924
                or:[chg isDoIt]]]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3925
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3926
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3927
    "/ 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
  3928
    "/ 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
  3929
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3930
    [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3931
        |s extensionsRevisionV1 extensionsRevisionV2|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3932
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3933
        extensionsRevisionV1 := perProjectInfoV1 at:'extensions.st' ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3934
        extensionsRevisionV1 notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3935
            [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3936
                s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3937
                        streamForClass:nil fileName:'extensions.st' revision:extensionsRevisionV1 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3938
                        directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3939
                s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3940
                    extensionsInRepositoryV1 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3941
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3942
            ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3943
                s notNil ifTrue:[s close]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3944
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3945
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3946
        extensionsInRepositoryV1 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3947
            extensionsInRepositoryV1 := ChangeSet new
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3948
        ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3949
            "/ ignore package doIts and all extensionVersion_xxx methods
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3950
            extensionsInRepositoryV1 := versionMethodsAndDoitsRejected value:extensionsInRepositoryV1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3951
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3952
        
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3953
        "/ ------
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3954
        extensionsRevisionV2 := perProjectInfoV2 at:'extensions.st' ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3955
        extensionsRevisionV2 notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3956
            [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3957
                s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3958
                        streamForClass:nil fileName:'extensions.st' revision:extensionsRevisionV2 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3959
                        directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3960
                s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3961
                    extensionsInRepositoryV1 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3962
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3963
            ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3964
                s notNil ifTrue:[s close]
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3965
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3966
        ].    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3967
        extensionsInRepositoryV2 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3968
            extensionsInRepositoryV2 := ChangeSet new
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3969
        ] ifFalse:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3970
            "/ ignore package doIts and all extensionVersion_xxx methods
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3971
            extensionsInRepositoryV2 := versionMethodsAndDoitsRejected value:extensionsInRepositoryV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3972
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3973
    ] value.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3974
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3975
    extensionDiffs := extensionsInRepositoryV1 diffSetsAgainst:extensionsInRepositoryV2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3976
    extensionsOnly ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3977
        ^ extensionDiffs
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3978
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3979
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3980
    diffSet := extensionDiffs copy.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3981
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3982
    filesReallyModified :=
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3983
        filesInRepositoryV2 select:[:eachFile |
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3984
            |repositoryVersion1 repositoryVersion2 s stRevision diffs|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3985
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3986
            stRevision := perProjectInfoV1 at:eachFile ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3987
            stRevision notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3988
                [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3989
                    s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3990
                            streamForClass:nil fileName:eachFile revision:stRevision 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3991
                            directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3992
                    s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3993
                        repositoryVersion1 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3994
                    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3995
                ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3996
                    s notNil ifTrue:[s close].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3997
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3998
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  3999
            repositoryVersion1 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4000
                repositoryVersion1 := ChangeSet new.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4001
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4002
            repositoryVersion1 := versionMethodsAndDoitsRejected value:repositoryVersion1.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4003
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4004
            stRevision := perProjectInfoV2 at:eachFile ifAbsent:nil.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4005
            stRevision notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4006
                [
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4007
                    s := SourceCodeManager
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4008
                            streamForClass:nil fileName:eachFile revision:stRevision 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4009
                            directory:directory module:module cache:true.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4010
                    s notNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4011
                        repositoryVersion2 := ChangeSet fromStream:s.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4012
                    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4013
                ] ensure:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4014
                    s notNil ifTrue:[s close].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4015
                ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4016
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4017
            repositoryVersion2 isNil ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4018
                repositoryVersion2 := ChangeSet new.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4019
            ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4020
            repositoryVersion2 := versionMethodsAndDoitsRejected value:repositoryVersion2.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4021
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4022
            diffs := repositoryVersion1 diffSetsAgainst:repositoryVersion2 .
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4023
            diffSet addDiffSet:diffs.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4024
            diffs notEmpty
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4025
        ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4026
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4027
    diffSet isEmpty ifTrue:[
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4028
        "/ 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
  4029
        Transcript showCR:('%1 not changed between %2 and %3.' 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4030
                            bindWith:aProject allBold 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4031
                            with:(aDateOrNilV1 ? aTagOrNilV1) 
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4032
                            with:(aDateOrNilV2 ? aTagOrNilV2)).
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4033
        ^ diffSet.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4034
    ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4035
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4036
    diffSet sortByClassName.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4037
    ^ diffSet
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4038
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4039
    "Created: / 04-02-2017 / 17:27:47 / cg"
4204
5291c8e8c732 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  4040
    "Modified: / 05-02-2017 / 10:04:50 / cg"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4041
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4042
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  4043
ensureCorrectVersionMethodsInClass:aClass usingManager:aManager
3674
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4044
    |theMetaclass versionMthd src newSrc versionMethodName oldVersionMethodName|
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4045
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4046
    theMetaclass := aClass theMetaclass.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4047
    versionMethodName := aManager nameOfVersionMethodInClasses.
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  4048
    oldVersionMethodName := aClass nameOfOldVersionMethod.
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4049
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4050
    (theMetaclass includesSelector:versionMethodName) ifTrue:[
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  4051
"/        (theMetaclass includesSelector:oldVersionMethodName) ifTrue:[
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  4052
"/            theMetaclass removeSelector:oldVersionMethodName.   
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  4053
"/        ].
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4054
        "/ ensure that my version method is parsable (contains $'s)
3674
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4055
        versionMthd := theMetaclass compiledMethodAt:versionMethodName.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4056
        versionMthd notNil ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4057
            src := versionMthd source.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4058
            src notNil ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4059
                newSrc := aManager ensureDollarsInVersionMethod:src.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4060
                newSrc ~= src ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4061
                    theMetaclass compile:newSrc categorized:#documentation.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4062
                ]
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4063
            ].
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4064
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4065
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4066
        (theMetaclass includesSelector:oldVersionMethodName) ifTrue:[
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  4067
            "/ but make sure, it is a version method for this sourcecodemanager...
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  4068
            (theMetaclass methodDictionary keys count:[:sel | sel startsWith:'version']) size == 1 ifTrue:[
3674
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4069
                versionMthd := theMetaclass compiledMethodAt:oldVersionMethodName.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4070
                versionMthd notNil ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4071
                    src := versionMthd source.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4072
                    (src startsWith:oldVersionMethodName) ifTrue:[
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4073
                        newSrc := versionMethodName , (src copyFrom:(oldVersionMethodName size + 1))
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4074
                    ].
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4075
                    theMetaclass compile:newSrc categorized:#documentation.
d9b94d8afb2c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  4076
                ]
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  4077
            ]
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4078
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4079
    ].
2442
7ecd9a4248bb changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
  4080
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  4081
    "Modified: / 20-08-2011 / 14:40:27 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  4082
    "Created: / 29-12-2011 / 14:33:46 / cg"
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4083
!
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4084
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4085
fetchSourceOf:aClass askForRevision:askForRevision into:aBlockToReturnMultipleValues
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4086
    "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
  4087
     or nil, if there are any problems.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4088
     Helper method"
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4089
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4090
    |classToCompare aStream comparedSource rev revString mgr
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4091
     nm msg revisionInClass newestRev|
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4092
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4093
    classToCompare := aClass theNonMetaclass.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4094
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4095
    nm := classToCompare name.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4096
    (mgr := manager) isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4097
        mgr := self sourceCodeManagerFor:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4098
        mgr isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4099
            self error:'oops - no sourcecode manager' mayProceed:true.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4100
            ^ nil
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4101
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4102
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4103
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4104
    rev := classToCompare revisionInfoOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4105
"/    rev := classToCompare binaryRevision.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4106
    revisionInClass := classToCompare revisionOfManager:mgr.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4107
    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4108
        rev := revisionInClass
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4109
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4110
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4111
    "/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4112
    "/ class in repository - ask for revision
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4113
    "/
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4114
    SourceCodeManagerError handle:[:ex |
4448
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  4115
        rev isNil ifTrue:[
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  4116
            Dialog warn:'Class is not yet in the repository\(or classes revision info is missing or corrupted)' withCRs.
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  4117
            ^ nil
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  4118
        ].
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4119
        Dialog warn:(resources 
4362
cd8a7d6bfc1d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  4120
                        stringWithCRs:'Could not fetch revision info of "%1".\Reported error: %4\\Please check your sourcecode manager settings of %2 for package: "%3".\(and possibly the network for reachability of the repository)'
cd8a7d6bfc1d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  4121
                        with:classToCompare name
cd8a7d6bfc1d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  4122
                        with:classToCompare sourceCodeManager managerTypeName
cd8a7d6bfc1d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  4123
                        with:classToCompare package
cd8a7d6bfc1d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  4124
                        with:(ex description asString withoutSeparators)).
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4125
        ^ nil.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4126
    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4127
        newestRev := mgr newestRevisionOf:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4128
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4129
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4130
    askForRevision ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4131
        msg := resources string:'Compare to revision: (empty for newest)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4132
        rev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4133
            msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4134
                                           with:nm allBold with:rev).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4135
            (revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4136
                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
  4137
                                               with:revisionInClass)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4138
            ]
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4139
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4140
        newestRev notNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4141
            msg := msg , '\' , (resources string:'Newest in repository is %1.'
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4142
                                           with:newestRev)
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4143
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4144
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4145
        rev := self
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4146
                    askForExistingRevision:msg 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4147
                    title:'Compare with repository' 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4148
                    class:classToCompare.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4149
    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4150
        rev := newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4151
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4152
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4153
    rev isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4154
        mgr = classToCompare sourceCodeManager ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4155
            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
  4156
        ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4157
            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
  4158
        ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4159
        Dialog warn:(resources 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4160
                                stringWithCRs:msg
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4161
                                with:classToCompare name
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4162
                                with:mgr managerTypeName
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4163
                                with:classToCompare package
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4164
                                with:(classToCompare sourceCodeManager managerTypeName)).
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4165
        ^ nil.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4166
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4167
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4168
    rev withoutSpaces isEmpty ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4169
        msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4170
        "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4171
        aStream := mgr getSourceStreamFor:classToCompare revision:newestRev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4172
        revString := '(newest: ' , (newestRev ? '???') , ')'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4173
    ] ifFalse:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4174
        msg := 'extracting previous %1'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4175
        aStream := mgr getSourceStreamFor:classToCompare revision:rev.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4176
        revString := rev
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4177
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4178
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4179
    aStream isNil ifTrue:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4180
        self warn:'Could not extract source from repository (check repository settings / network)'.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4181
        ^ nil
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4182
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4183
    aStream class readErrorSignal handle:[:ex |
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4184
        self warn:('Read error while reading extracted source\\' , ex description) withCRs.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4185
        aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4186
        ^ nil
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4187
    ] do:[
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4188
        comparedSource := aStream contents asString.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4189
    ].
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4190
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4191
    aStream close.
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4192
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4193
    aBlockToReturnMultipleValues 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4194
        value:revString 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4195
        value:revisionInClass
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4196
        value:mgr. 
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4197
    ^ comparedSource
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4198
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4199
    "
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4200
      self compareClassWithRepository:Array
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4201
    "
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4202
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4203
    "Modified: / 24-07-2012 / 18:11:27 / cg"
4448
0bb397930dcb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  4204
    "Modified: / 23-06-2019 / 18:43:26 / Claus Gittinger"
3896
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4205
!
41784f108832 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3892
diff changeset
  4206
4490
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4207
getLogMessageForCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4208
    initialLogMessage:initialLogMessage title:title 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4209
    isClassCheckin:isClassCheckin
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4210
    showChangesAction:showChangesAction
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4211
    validateConsistencyAction:validateConsistencyAction
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4212
    valuesInto:aBlock
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4213
3325
944f6a6e66ff class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3313
diff changeset
  4214
    "open a dialog, asking for commit/checkin log info.
4490
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4215
     Returns 2 values: 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4216
        a log message 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4217
        and additional checkinInfo (containing things like markAsStable, etc,)"
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4218
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4219
    |checkinInfo reasonLine logMessage checkinReason|
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4220
    
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4221
    "/ heuristics for a useful initial log message...
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4222
    aLogInfoOrNil isNil ifTrue:[
4359
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  4223
        checkinInfo := self 
4490
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4224
                        getCheckinInfoFor:title 
4359
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  4225
                        initialAnswer:initialLogMessage
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  4226
                        withQuickOption:false
4490
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4227
                        withValidateConsistencyOption:(validateConsistencyAction notNil)
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4228
                        isClassCheckin:isClassCheckin
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4229
                        showChangesAction:showChangesAction.
4359
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  4230
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  4231
        checkinInfo isNil ifTrue:[^ false].
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  4232
f46715e6c974 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4349
diff changeset
  4233
        checkinInfo validateConsistency ifTrue:[
4490
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4234
            validateConsistencyAction value.
4079
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4235
        ].
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  4236
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4237
        logMessage := checkinInfo logMessage.
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4238
        checkinReason := checkinInfo checkinReason.
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4239
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4240
        reasonLine := '#OTHER'. 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4241
        checkinReason == Tools::CheckinInfoDialog reasonBugfix ifTrue:[
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4242
            reasonLine := '#BUGFIX' 
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4243
        ] ifFalse:[ 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4244
            checkinReason == Tools::CheckinInfoDialog reasonFeature ifTrue:[
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4245
                reasonLine := '#FEATURE' 
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4246
            ] ifFalse:[ 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4247
                checkinReason == Tools::CheckinInfoDialog reasonRefactoring ifTrue:[
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4248
                    reasonLine := '#REFACTORING' 
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4249
                ] ifFalse:[ 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4250
                    checkinReason == Tools::CheckinInfoDialog reasonDocumentation ifTrue:[
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4251
                        reasonLine := '#DOCUMENTATION' 
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4252
                    ] ifFalse:[ 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4253
                        checkinReason == Tools::CheckinInfoDialog reasonUIEnhancement ifTrue:[
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4254
                            reasonLine := '#UI_ENHANCEMENT' 
3971
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4255
                        ] ifFalse:[ 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4256
                            checkinReason == Tools::CheckinInfoDialog reasonQuality ifTrue:[
3971
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4257
                                reasonLine := '#QUALITY' 
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4258
                            ] ifFalse:[ 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4259
                                checkinReason == Tools::CheckinInfoDialog reasonTuning ifTrue:[
3971
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4260
                                    reasonLine := '#TUNING' 
4470
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4261
                                ] ifFalse:[ 
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4262
                                    checkinReason == Tools::CheckinInfoDialog reasonWorkaround ifTrue:[
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4263
                                        reasonLine := '#WORKAROUND' 
645329232307 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4458
diff changeset
  4264
                                    ]
3971
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4265
                                ]
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4266
                            ]
3906
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4267
                        ]
0b1447ec43b9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3900
diff changeset
  4268
                    ]
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4269
                ]
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4270
            ]
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4271
        ]
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4272
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4273
        aLogInfoOrNil isString ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4274
            "soon obsolete..."    
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4275
            logMessage := aLogInfoOrNil
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4276
        ] ifFalse:[ 
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4277
            checkinInfo := aLogInfoOrNil.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4278
            logMessage := checkinInfo logMessage.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4279
        ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4280
    ].
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4281
    logMessage notNil ifTrue:[  
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4282
        logMessage := logMessage asSingleByteStringReplaceInvalidWith:$?
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4283
    ].
3974
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4284
    reasonLine isNil ifTrue:[
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4285
        reasonLine := '#OTHER'. 
3900
621438521fee #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3896
diff changeset
  4286
    ].
3974
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4287
    logMessage := reasonLine , ' by ',OperatingSystem getLoginName,'\' withCRs 
0d6e71243042 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3971
diff changeset
  4288
                  , (logMessage ? '').
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4289
    aBlock value:logMessage value:checkinInfo.
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4290
    ^ true
3971
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4291
e7cba6e3e584 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3967
diff changeset
  4292
    "Modified: / 31-03-2016 / 17:58:11 / cg"
4230
51459e224b36 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4226
diff changeset
  4293
    "Modified: / 17-03-2017 / 18:00:12 / stefan"
2383
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4294
!
Claus Gittinger <cg@exept.de>
parents: 2365
diff changeset
  4295
4490
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4296
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil forClass:aClassOrNil valuesInto:aBlock
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4297
    "open a dialog, asking for commit/checkin log info for a class checkin.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4298
     Returns 2 values: 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4299
        a log message 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4300
        and additional checkinInfo (containing things like markAsStable, etc,)"
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4301
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4302
    |initialLogMessage|
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4303
    
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4304
    initialLogMessage := (self class goodInitialLogMessageForCheckinClassOfClass:aClassOrNil) ? ''.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4305
    "/ initial checkin ?
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4306
    (aClassOrNil package isNil or:[(aClassOrNil revisionOfManager:manager) "revision" isNil]) ifTrue:[ 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4307
        initialLogMessage := 'initial checkin\\' withCRs , initialLogMessage
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4308
    ].
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4309
    ^ self 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4310
        getLogMessageForCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4311
        initialLogMessage:initialLogMessage title:(aClassOrNil name)
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4312
        isClassCheckin:aClassOrNil notNil
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4313
        showChangesAction:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4314
            "/ that is passed to the dialog's 'what changed' button
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4315
            self compareClassWithRepository:aClassOrNil askForRevision:false
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4316
        ]
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4317
        validateConsistencyAction:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4318
            aClassOrNil isProjectDefinition ifTrue:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4319
                self validateConsistencyOfPackage:aClassOrNil package doClasses:false doExtensions:false.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4320
            ] ifFalse:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4321
                self validateConsistencyOfPackage:aClassOrNil doClasses:false doExtensions:false.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4322
            ].
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4323
        ]
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4324
        valuesInto:aBlock.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4325
!
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  4326
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4327
knownTagsInPackages:packages
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4328
    "return the symbolic names given to any version in packages.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4329
     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
  4330
     and only fetch the tag names from the first given package.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4331
     May raise an error, if the repository cannot be accessed"
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4332
    
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4333
    |someDfnClass|
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4334
    
4295
569479b5d86c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4290
diff changeset
  4335
    someDfnClass := ProjectDefinition definitionClassForPackage:packages firstOrNil.
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4336
    someDfnClass isNil ifTrue:[ someDfnClass := Object projectDefinitionClass ].
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4337
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4338
    ^ (manager knownTagsFor:someDfnClass) asOrderedCollection sort.
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4339
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4340
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4341
     CVSSourceCodeManager utilities knownTagsInPackages:#( 'stx:libbasic' 'stc:libbasic2' )
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4342
    "
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4343
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4344
    "Created: / 04-02-2017 / 18:55:16 / cg"
4295
569479b5d86c #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4290
diff changeset
  4345
    "Modified: / 29-12-2017 / 15:16:21 / stefan"
4201
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4346
!
e13af182fbb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
  4347
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4348
removeSourceContainerForClass:aClass
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4349
    "show container & let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4350
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4351
    ^ self removeSourceContainerForClass:aClass confirm:true warn:true
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4352
!
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4353
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4354
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4355
    "show container & optionally let user confirm twice."
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4356
3814
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4357
    |info mgr|
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4358
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4359
    aClass isLoaded ifFalse:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4360
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4361
            self warn:(resources string:'Please load the class first.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4362
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4363
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4364
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4365
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4366
    "/
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4367
    "/ 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
  4368
    "/ if so, take that as a default.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4369
    "/
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4370
    mgr := self sourceCodeManagerFor:aClass.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4371
    mgr isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4372
        ^ false
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4373
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4374
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4375
    info := mgr sourceInfoOfClass:aClass.
3814
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4376
    ^ self removeSourceContainerForClass:aClass usingSourceInfo:info confirm:doConfirm warn:doWarn
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4377
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4378
    "Modified: / 16-07-2013 / 19:46:50 / cg"
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4379
!
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4380
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4381
removeSourceContainerForClass:aClass usingSourceInfo:info confirm:doConfirm warn:doWarn
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4382
    "show container & optionally let user confirm twice."
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4383
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4384
    |module directory fileName mgr|
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4385
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4386
    aClass isLoaded ifFalse:[
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4387
        doWarn ifTrue:[
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4388
            self warn:(resources string:'Please load the class first.').
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4389
        ].
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4390
        ^ false.
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4391
    ].
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4392
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4393
    "/
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4394
    "/ ask the sourceCodeManager if it knows anything about that class
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4395
    "/ if so, take that as a default.
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4396
    "/
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4397
    mgr := self sourceCodeManagerFor:aClass.
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4398
    mgr isNil ifTrue:[
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4399
        ^ false
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4400
    ].
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4401
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4402
    info notNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4403
        (info includesKey:#module) ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4404
            module := (info at:#module).
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4405
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4406
        (info includesKey:#directory) ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4407
            directory := (info at:#directory).
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4408
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4409
        fileName := mgr containerFromSourceInfo:info.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4410
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4411
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4412
    module isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4413
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  4414
            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
  4415
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4416
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4417
    ].
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4418
    directory isNil ifTrue:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4419
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  4420
            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
  4421
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4422
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4423
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4424
    fileName isNil ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4425
        doWarn ifTrue:[
1423
d15575ef3dba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
  4426
            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
  4427
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4428
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4429
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4430
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4431
    OperatingSystem isMSDOSlike ifTrue:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4432
        "cvs expects unix-filenames"
3591
d86841bb0d5c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3579
diff changeset
  4433
        module := module asUnixFilenameString.
d86841bb0d5c class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3579
diff changeset
  4434
        directory := directory asUnixFilenameString.
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4435
    ].
1787
db6157670930 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1782
diff changeset
  4436
    (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4437
        doWarn ifTrue:[
4447
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4438
            self warn:(resources stringWithCRs:'Class %1 had no source container (or SCM access is broken).'
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4439
                                 with:aClass name) .
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4440
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4441
        ^ false.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4442
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4443
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4444
    doConfirm ifTrue:[
4447
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4445
        Dialog
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4446
            modifyingBoxWith:[:box |
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4447
                (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4448
                    box 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4449
                        addButton:(Button label:'Remove All' 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4450
                                          action:[YesToAllNotification queryWith:true. box hide. true])
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4451
                        after:box noButton
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4452
                ].
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4453
            ]
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4454
            do:[
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4455
                (Dialog
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4456
                    choose:(resources 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4457
                                stringWithCRs:'Please confirm removal of the container for %1:\\container:    %2 / %3 / %4\\Really remove ?' 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4458
                                with:aClass name 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4459
                                with:module 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4460
                                with:directory 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4461
                                with:fileName) 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4462
                    labels:(Array 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4463
                                with:(resources string:'No') 
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4464
                                with:(resources string:'Remove'))
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4465
                    values:#(false true)
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4466
                    default:false) ifFalse:[
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4467
                    ^ false.
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4468
                ].
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4469
            ].
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4470
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4471
3814
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4472
    (mgr removeContainer:fileName inModule:module directory:directory) 
466fa886aa65 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
  4473
    ifFalse:[
976
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4474
        doWarn ifTrue:[
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4475
            self warn:(resources string:'failed to remove container.').
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4476
        ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4477
        ^ true.
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4478
    ].
cedcdc7e405c utitity to remove a container
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
  4479
    ^ false
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4480
3351
68989ed1137f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3344
diff changeset
  4481
    "Modified: / 16-07-2013 / 19:46:50 / cg"
4447
4f7d18c92f9f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
  4482
    "Modified: / 23-06-2019 / 16:28:17 / Claus Gittinger"
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4483
!
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4484
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4485
repositoryLogOf:aClass onto:aStream
2050
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4486
    self repositoryLogOf:aClass short:false onto:aStream
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4487
!
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4488
037e794f5857 +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2042
diff changeset
  4489
repositoryLogOf:aClass short:shortOrNot onto:aStream
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4490
    |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
  4491
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4492
    info := aClass revisionInfo.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4493
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4494
    rv := aClass binaryRevision.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4495
    rv notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4496
        aStream nextPutLine:'**** Loaded classes binary information ****'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4497
        aStream nextPutLine:'  Binary based upon : ' , rv.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4498
        aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4499
    ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4500
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4501
    "/ old
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4502
"/    info isNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4503
"/        aStream nextPutLine:'No revision info found'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4504
"/        aClass isLoaded ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4505
"/            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
  4506
"/        ] ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4507
"/            fn := aClass classFilename.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4508
"/            aClass wasAutoloaded ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4509
"/                msg := 'This class was autoloaded.'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4510
"/                msg := msg , ' (from ''' , fn , ''')'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4511
"/            ] ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4512
"/                msg := 'This class was loaded from ''' , fn , '''.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4513
"/            ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4514
"/            msg notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4515
"/                aStream cr; nextPutAll:msg.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4516
"/            ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4517
"/        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4518
"/        ^ self
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4519
"/    ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4520
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4521
    info isNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4522
        aClass isLoaded ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4523
            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
  4524
        ] ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4525
            fn := aClass classFilename.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4526
            aClass wasAutoloaded ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4527
                msg := 'This class was autoloaded.'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4528
                msg := msg , ' (from ''' , fn , ''')'.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4529
            ] ifFalse:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4530
                msg := 'This class was loaded from ''' , fn , '''.'
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4531
            ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4532
            msg notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4533
                aStream nextPutLine:msg.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4534
            ]
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4535
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4536
        aStream cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4537
    ] ifFalse:[
2041
fb85bf748dbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2013
diff changeset
  4538
        (info revision notNil) ifFalse:[
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4539
            aStream nextPutLine:'WARNING:'; cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4540
            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
  4541
            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
  4542
            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
  4543
            aStream cr.
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4544
        ].
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4545
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4546
        aStream nextPutLine:'**** Classes source information ****'; cr.
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  4547
        s := info repositoryPathName.
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4548
        s notNil ifTrue:[
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4549
            aStream nextPutLine:'  Source repository : ' , s
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4550
        ].
3676
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4551
        aStream nextPutLine:('  Filename ........ : %1' bindWith: (info fileName ? '?')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4552
        info symbolicVersionName ~= info revision ifTrue:[
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4553
            aStream nextPutLine:('  Symbolic Version  : %1' bindWith: (info symbolicVersionName ? '?')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4554
        ].
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4555
        aStream nextPutLine:('  Revision ........ : %1' bindWith: (info revision ? '?')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4556
        aStream nextPutLine:('  Checkin date .... : %1 %2 %3' bindWith: (info date  ? '?') 
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4557
                                                              with:(info time ? '?') 
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4558
                                                              with:(info timezone ? '')).
51859e5df3b5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
  4559
        aStream nextPutLine:('  Checkin user .... : %1' bindWith: (info user ? '?')).
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4560
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4561
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4562
    (info2 := aClass packageSourceCodeInfo) notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4563
        aStream nextPutLine:'  Repository: ..... : ' , (info2 at:#module ifAbsent:'?').
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4564
        aStream nextPutLine:'  Directory: ...... : ' , (info2 at:#directory ifAbsent:'?').
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4565
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4566
    info notNil ifTrue:[
2042
e2311b66ad94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  4567
        aStream nextPutLine:'  Container ....... : ' , (info repositoryPathName ? '?').
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4568
    ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4569
    aStream cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4570
    mgr := self sourceCodeManagerFor:aClass.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4571
    mgr notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4572
        aStream nextPutLine:'**** Repository information ****'; cr.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4573
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4574
        module := nil.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4575
        info2 notNil ifTrue:[
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4576
            module := info2 at:#module ifAbsent:nil.
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4577
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4578
        module notNil ifTrue:[
3632
c39f5d147a8b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3602
diff changeset
  4579
            aStream nextPutLine:('  Repository URL ......: %1' bindWith: 
3633
abe27fb2c473 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  4580
                                ((mgr repositoryNameForPackage:aClass package) ifNil:[mgr repositoryName , ' (default)']) asString).
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4581
        ].
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  4582
        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
  4583
    ]
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4584
2836
91e9be94d80b changed: #repositoryLogOf:short:onto:
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  4585
    "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
  4586
    "Modified: / 11-07-2012 / 13:50:59 / cg"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4587
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4588
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4589
tagClass:aClass as:tag
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4590
    |mgr|
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4591
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4592
    mgr := self sourceCodeManagerFor:aClass.
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4593
    mgr setSymbolicName:tag revision:nil overWrite:true class:aClass.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4594
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4595
    "Modified: / 12-09-2006 / 13:03:59 / cg"
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4596
    "Modified (format): / 05-12-2017 / 22:50:18 / cg"
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4597
!
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4598
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4599
tagClasses:aCollectionOfClasses as:tag
3847
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4600
    ^ self tagClasses:aCollectionOfClasses as:tag revision:nil
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4601
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4602
    "Created: / 12-09-2006 / 13:04:29 / cg"
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4603
!
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4604
94661e33541c class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3818
diff changeset
  4605
tagClasses:aCollectionOfClasses as:tag revision:revision
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4606
    |classesPerManager|
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4607
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4608
    classesPerManager := Dictionary new.
4290
37bc52831eac #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4609
    aCollectionOfClasses do:[:eachClass | 
37bc52831eac #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4610
        |manager|
37bc52831eac #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4611
37bc52831eac #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4612
        manager := self sourceCodeManagerFor:eachClass.
37bc52831eac #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4613
        (classesPerManager at:manager ifAbsentPut:[Set new]) add:eachClass
37bc52831eac #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4614
    ].
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4615
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4616
    classesPerManager keysAndValuesDo:[:manager :classesPerManager|
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4617
        manager setSymbolicName:tag revision:revision overWrite:true classes:classesPerManager.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4618
    ].
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4619
    ^ true
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4620
4290
37bc52831eac #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4621
    "Modified (format): / 07-12-2017 / 10:48:36 / cg"
1726
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4622
!
e9fba6b66dd6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
  4623
2602
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4624
tagPackage: package as:tag
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4625
    self tagClasses:(Smalltalk allClassesInPackage:package) as:tag.
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4626
    "/ TODO: what about build support files and extensions???
2602
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4627
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4628
    "Created: / 12-09-2006 / 13:04:29 / cg"
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4629
    "Created: / 15-10-2011 / 22:47:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4630
    "Modified (comment): / 05-12-2017 / 22:58:09 / cg"
2602
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4631
!
a8fcee161334 added: #tagPackage:as:
vrany
parents: 2597
diff changeset
  4632
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  4633
tagPath:aPath as:tag usingManager:aManager
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4634
    aManager setSymbolicName:tag revision:nil overWrite:true path:aPath.
1782
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4635
41b0e8111aea tagIt bulk operation
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  4636
    "Modified: / 12-09-2006 / 12:04:44 / cg"
2691
01d067355899 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  4637
    "Created: / 29-12-2011 / 14:32:38 / cg"
4281
7b1c0f0170d0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4276
diff changeset
  4638
    "Modified (format): / 05-12-2017 / 22:55:29 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4639
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4640
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  4641
!SourceCodeManagerUtilities methodsFor:'utilities-scm-helpers'!
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
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4644
    "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
  4645
     Return a dictionary associating revision with a changeList entries for that method.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4646
     Unfinished - need a GUI for that."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4647
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4648
    |mgr theClass revisionLog revisions items s entriesPerRevision previousVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4649
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4650
    theClass := aClass theNonMetaclass.
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
    mgr := self sourceCodeManagerFor:theClass.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4653
    mgr isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4654
        self error:'no sourceCodeManager'.
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
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4657
    revisionLog := mgr
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4658
                        revisionLogOf:theClass
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4659
                        numberOfRevisions:numberOfRevisionsOrNil.
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
    revisions := revisionLog at:#revisions.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4662
    items := revisions collect:[:each | |rev date who|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4663
                                    rev := each at:#revision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4664
                                    date := each at:#date.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4665
                                    who := each at:#author.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4666
                                    rev allBold , ' [' , date , ' by ' , who , ']'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4667
                               ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4668
4349
7f65b32fd957 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  4669
    revisions := revisions collectColumn:#revision.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4670
    revisions addFirst:#current.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4671
    entriesPerRevision := Dictionary new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4672
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4673
    previousVersion := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4674
    revisions reverseDo:[:eachRevision |
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4675
        |srcStream entries thisVersion|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4676
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4677
        eachRevision == #current ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4678
            s := '' writeStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4679
            theClass fileOutOn:s withTimeStamp:false.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4680
            srcStream := s contents readStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4681
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4682
            self activityNotification:('checking out revision ' , eachRevision , '...').
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4683
            srcStream := mgr getSourceStreamFor:theClass revision:eachRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4684
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4685
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4686
        entries := ChangeSet fromStream:srcStream.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4687
        srcStream close.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4688
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4689
        "/ remove all definitions       
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4690
        entries := entries select:[:each | each isMethodChange].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4691
        "/ remove all methods which are for other selectors      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4692
        entries := entries select:[:each | each selector == selector].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4693
        "/ remove all methods which are for private subclasses      
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4694
        entries := entries select:[:each | each className = aClass name].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4695
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4696
        entries size == 1 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4697
            "/ the method is there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4698
            thisVersion := entries first.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4699
            (previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4700
                "/ no change
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4701
            ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4702
                entriesPerRevision at:eachRevision put:thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4703
            ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4704
        ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4705
            "/ the method is not there
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4706
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4707
        previousVersion := thisVersion.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4708
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4709
    self error:'unfinished code'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4710
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4711
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4712
     self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4713
     self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4714
    "
4349
7f65b32fd957 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  4715
7f65b32fd957 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  4716
    "Modified: / 22-09-2018 / 11:22:06 / Claus Gittinger"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4717
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4718
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  4719
!SourceCodeManagerUtilities methodsFor:'utilities-scm-user interaction'!
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4720
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4721
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4722
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4723
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4724
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4725
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4726
    ^ self
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4727
        askForContainer:boxText title:title note:notice 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4728
        initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4729
        forNewContainer:true
1026
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4730
!
1f193eb5f877 common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents: 1022
diff changeset
  4731
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4732
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
  4733
    "open a dialog asking for a source container;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4734
     return a dictionary containing module, package and filename,
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4735
     or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4736
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  4737
    |box y component answer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4738
     moduleHolder packageHolder fileNameHolder
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4739
     module package fileName 
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4740
     allPackageIDs knownContainers knownPackages packageUpdater
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4741
     packageBoxComponent fileNameBoxComponent fileNameUpdater|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4742
3967
5bfee3208fb3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  4743
    allPackageIDs := Smalltalk allPackageIDs.
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4744
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4745
    knownContainers := allPackageIDs collect:[:package | (package upTo:$:)] as:Set.
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4746
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4747
    knownContainers := knownContainers asOrderedCollection reject:[:module | module isBlank].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4748
    knownContainers sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4749
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4750
    packageUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4751
        |theModulePrefix|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4752
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4753
        theModulePrefix := moduleHolder value , ':'.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4754
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4755
        Cursor wait showWhile:[
3202
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4756
            knownPackages := 
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4757
                allPackageIDs
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4758
                    select:[:package | (package startsWith:theModulePrefix)]
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4759
                    thenCollect:[:package | |idx|
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4760
                        idx := package indexOf:$:.
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4761
                        (package copyFrom:idx + 1)].
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4762
b58b19cac708 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
  4763
            knownPackages := knownPackages asSet asOrderedCollection.
3291
7fc5a1fea0fd Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 3287
diff changeset
  4764
            knownPackages := knownPackages reject:[:package | package isBlank].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4765
            knownPackages sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4766
            packageBoxComponent list:knownPackages.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4767
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4768
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4769
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4770
    fileNameUpdater := [
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4771
        |module package files|
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4772
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4773
        Cursor read showWhile:[
2209
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  4774
            module := moduleHolder value ? (PackageId noProjectID).
e3a4510c45f2 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2200
diff changeset
  4775
            package := packageHolder value ? (PackageId noProjectID).
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4776
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4777
            files := SourceCodeManager getExistingContainersInModule:module directory:package.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4778
            files := files asOrderedCollection.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4779
            files := files select:[:eachFile | eachFile asFilename hasSuffix:'st'].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4780
            files sort.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4781
            fileNameBoxComponent list:files.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4782
        ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4783
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4784
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4785
    moduleHolder := initialModule asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4786
    packageHolder := initialPackage asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4787
    fileNameHolder := initialFileName asValue.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4788
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4789
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4790
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4791
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4792
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4793
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4794
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4795
    component := box addTextLabel:boxText withCRs adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4796
    component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4797
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4798
    box addVerticalSpace.
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4799
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4800
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4801
    component := box addTextLabel:(resources string:'Module:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4802
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4803
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4804
    component := box addComboBoxOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4805
    component list:knownContainers.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4806
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4807
"/    component := box addInputFieldOn:moduleHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4808
    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
  4809
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4810
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4811
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4812
    component := box addTextLabel:(resources string:'Package:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4813
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4814
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4815
    packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4816
"/    component := box addInputFieldOn:packageHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4817
    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
  4818
    packageUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4819
    moduleHolder onChangeEvaluate:packageUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4820
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4821
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4822
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4823
    component := box addTextLabel:(resources string:'Filename:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4824
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4825
    box yPosition:y.
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
    forNewContainer ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4828
        component := box addInputFieldOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4829
        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
  4830
    ] ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4831
        fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4832
        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
  4833
        fileNameUpdater value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4834
        packageHolder onChangeEvaluate:fileNameUpdater.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4835
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4836
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4837
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4838
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4839
    notice notNil ifTrue:[
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4840
        component := box addTextLabel:notice adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  4841
        component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4842
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4843
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4844
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4845
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4846
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4847
    (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
3683
fb6ad154b94d class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3679
diff changeset
  4848
        component := Button label:(resources string:'Yes to All').
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4849
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4850
                            YesToAllNotification queryWith:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4851
                            box doAccept.
2253
7d7b0d2d1fe7 changed: #askForContainer:title:note:initialModule:initialPackage:initialFileName:forNewContainer:
Claus Gittinger <cg@exept.de>
parents: 2242
diff changeset
  4852
                            box okPressed.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4853
                         ].
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4854
        box addButton:component.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4855
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4856
    (AbortAllSignal isHandled) ifTrue:[
3683
fb6ad154b94d class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3679
diff changeset
  4857
        component := Button label:(resources string:'Cancel All').
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4858
        component action:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4859
                            box hide.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4860
                            AbortAllSignal raiseSignal.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4861
                         ].
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4862
        box addButton:component before:nil.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4863
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4864
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4865
    (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4866
        answer := YesToAllQuery query.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4867
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4868
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4869
    answer isNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4870
        box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4871
        answer := box accepted
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
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4874
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4875
    answer ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4876
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4877
    ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  4878
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4879
    module := moduleHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4880
    package := packageHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4881
    fileName := fileNameHolder value withoutSpaces.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4882
    ^ Dictionary new
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4883
        at:#module put:module;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4884
        at:#package put:package;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4885
        at:#fileName put:fileName;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4886
        yourself
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4887
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4888
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4889
     self 
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4890
        askForContainer:'enter container' title:'container' note:'some note'
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4891
        initialModule:'foo' initialPackage:'bar' initialFileName:'baz'        
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4892
    "
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4893
3394
8e7ee24c6e7b class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3384
diff changeset
  4894
    "Modified: / 29-08-2013 / 12:26:04 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4895
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4896
2570
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4897
askForExistingRevision:boxText title:title class:aClass
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4898
    "open a dialog asking for a containers revision;
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4899
     return a revision number, or nil if canceled."
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4900
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4901
    |mgr sourceInfo module package fileName|
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4902
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4903
    mgr := self sourceCodeManagerFor:aClass.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4904
    sourceInfo := mgr sourceInfoOfClass:aClass.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4905
    sourceInfo isNil ifTrue:[^ nil].
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4906
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4907
    package := mgr directoryFromSourceInfo:sourceInfo.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4908
    module := mgr moduleFromSourceInfo:sourceInfo.  
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4909
    fileName := mgr containerFromSourceInfo:sourceInfo.
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4910
    ^ self
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4911
        askForExistingRevision:boxText 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4912
        title:title 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4913
        class:aClass 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4914
        manager:mgr 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4915
        module:module package:package 
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4916
        fileName:fileName
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4917
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4918
    "
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4919
     SourceCodeManagerUtilities
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4920
        askForRevisionToCompare:'enter revision'
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4921
        title:'revision'
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4922
        class:Array
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4923
    "
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4924
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4925
    "Modified: / 12-09-2006 / 14:17:04 / cg"
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4926
!
7f1a5b6ce066 added: #askForExistingRevision:title:class:
vrany
parents: 2569
diff changeset
  4927
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4928
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
  4929
    "open a dialog asking for a containers revision;
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4930
     return a revision number, or nil if canceled."
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4931
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4932
    |partialLog revisions items newestRev
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  4933
     box y component revisionHolder symbolicNames stableRevision releasedRevision
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4934
     tagPlusRevisionHolder tagHolder tagList lockChange|
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  4935
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4936
    partialLog := aSourceCodeManager
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4937
        revisionLogOf:clsOrNil
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4938
        numberOfRevisions:30
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4939
        fileName:fileName
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  4940
        directory:directory 
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4941
        module:module.
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  4942
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4943
    partialLog notNil ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4944
        newestRev := partialLog at:#newestRevision.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4945
        revisions := partialLog at:#revisions.
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4946
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[nil].
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  4947
        symbolicNames notNil ifTrue:[
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4948
            stableRevision := symbolicNames at:'stable' ifAbsent:[nil].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4949
            releasedRevision := symbolicNames at:'released' ifAbsent:[nil].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4950
            
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4951
            "/ sort by revision; within same revision, sort by tag name
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4952
            tagList := (((symbolicNames associations 
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4953
                            sort:[:a :b | a key < b key "self versionString:(a value) isLessThan:(b value)"])
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4954
                                stableSort:[:a :b | self versionString:(a value) isLessThan:(b value)])
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4955
                                    collect:[:assoc | assoc key]) reverse.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4956
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4957
            stableRevision notNil ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4958
                tagList remove:'stable'.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4959
                tagList notEmpty ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4960
                    tagList addFirst:'-'
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4961
                ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4962
                tagList addFirst:'stable'.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4963
            ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4964
            
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4965
            LastTag notEmptyOrNil ifTrue:[
4174
3b55c406664f #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4160
diff changeset
  4966
                tagList addFirst:LastTag.
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4967
            ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4968
            tagList := tagList collect:[:tag | 
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4969
                                    |rev|
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4970
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4971
                                    rev := symbolicNames at:tag ifAbsent:[nil].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4972
                                    rev isNil ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4973
                                        tag
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4974
                                    ] ifFalse:[
4488
f1e36ed6d04b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  4975
                                        tag,((' (', rev value, ')') allGray)
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4976
                                    ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  4977
                                ].
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  4978
        ].
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4979
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4980
        "/ fill in timestamps
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  4981
        revisions do:[:each |
4160
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4982
            |dateOrDateString timeOrTimeString timestampString timestamp|
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4983
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4984
            dateOrDateString := each at:#date ifAbsent:nil.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4985
            timeOrTimeString := each at:#time ifAbsent:nil.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4986
            dateOrDateString notNil ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4987
                dateOrDateString isString ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4988
                    timestamp := Timestamp readFrom:dateOrDateString onError:nil.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4989
                    timestamp notNil ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4990
                        each at:#timestamp put:timestamp.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4991
                    ].
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4992
                ] ifFalse:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4993
                    timeOrTimeString isString ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4994
                    self halt.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4995
    
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4996
                    ] ifFalse:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4997
                        (dateOrDateString notNil and:[timeOrTimeString notNil]) ifTrue:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4998
                            timestamp := Timestamp fromDate:dateOrDateString andTime:timeOrTimeString.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  4999
                            each at:#timestamp put:timestamp.
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  5000
                        ] ifFalse:[
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  5001
                            self halt
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  5002
                        ]    
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  5003
                    ]
29602d7fb4c9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4132
diff changeset
  5004
                ].    
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5005
            ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5006
        ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5008
        items := revisions 
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5009
                    collectWithIndex:[:each :idx| 
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5010
                        |item rev timestamp date time dateAndTimeString who flag reason
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5011
                         prevInfo prevDate nextInfo nextDate dateDifferentToPrev dateDifferentToNext|
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5012
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5013
                        rev := each at:#revision.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5014
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5015
                        timestamp := each at:#timestamp.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5016
                        timestamp notNil ifTrue:[
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5017
                            date := each at:#date.
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5018
                            date = Date today ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5019
                                dateAndTimeString := timestamp asTime printString.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5020
                            ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5021
                                "/ if date is different to both previous AND next,
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5022
                                "/ only show the date
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5023
                                dateDifferentToPrev := dateDifferentToNext := false.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5024
                                (idx > 1) ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5025
                                    prevInfo := revisions at:idx-1.
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5026
                                    prevDate := prevInfo at:#date ifAbsent:nil.
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5027
                                    dateDifferentToPrev := prevDate notNil and:[prevDate ~= date].
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5028
                                ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5029
                                (idx < revisions size) ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5030
                                    nextInfo := revisions at:idx+1.
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5031
                                    nextDate := nextInfo at:#date ifAbsent:nil.
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5032
                                    dateDifferentToNext := nextDate notNil and:[nextDate ~= date].
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5033
                                ].
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5034
                                dateDifferentToPrev & dateDifferentToPrev ifTrue:[
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5035
                                    dateAndTimeString := date printString.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5036
                                ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5037
                                    dateAndTimeString := date printString,' ',(timestamp asTime printString).
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5038
                                ]
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5039
                            ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5040
                        ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5041
                            dateAndTimeString := (each at:#date ifAbsent:nil) ? '(unknown time)'.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5042
                        ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5043
                        who := (each at:#author ifAbsent:nil) ? '?'.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5044
                        rev = stableRevision ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5045
                            flag := ' Stable' allBold.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5046
                        ] ifFalse:[rev = releasedRevision ifTrue:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5047
                            flag := ' Released' allBold.
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5048
                        ] ifFalse:[
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5049
                            flag := ''
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5050
                        ]].
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5051
                        reason := each loggedReason.
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5052
                        item := '%1%2 [%3 by %4 (%5 %6)]' bindWith:rev allBold with:flag with:dateAndTimeString 
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5053
                                                  with:who with:reason with:each changedLinesInfo.
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5054
                        reason = 'BUGFIX' ifTrue:[
4488
f1e36ed6d04b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  5055
                            item allRed
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5056
                        ] ifFalse:[reason = 'DOCUMENTATION' ifTrue:[
4488
f1e36ed6d04b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  5057
                            item allGray
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5058
                        ] ifFalse:[
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5059
                            item
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5060
                        ]]
4007
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5061
                   ].
ffa3939cd5af #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3993
diff changeset
  5062
4349
7f65b32fd957 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  5063
        revisions := revisions collectColumn:#revision.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5064
    ] ifFalse:[
1666
40429b90ebb6 renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
  5065
        newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5066
        revisions := items := nil.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5067
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5068
        newestRev isNil ifTrue:[
4226
e4ab49b2ce35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4204
diff changeset
  5069
            (aSourceCodeManager checkForExistingContainer:fileName inModule:module directory:directory warn:true)
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5070
            ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5071
                ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5072
            ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5073
        ]
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5074
    ].
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5075
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5076
    lockChange := false.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5077
    revisionHolder := newestRev asValue.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5078
    revisionHolder onChangeEvaluate:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5079
        "/ cut off everything after revision
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5080
        |s first words tag|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5081
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5082
        s := revisionHolder value.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5083
        words := s asCollectionOfWords.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5084
        words size > 0 ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5085
            first := words first string.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5086
            first ~= s ifTrue:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5087
                revisionHolder value:first
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5088
            ]
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5089
        ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5090
        lockChange ifFalse:[
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5091
            tagPlusRevisionHolder value:''.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5092
            tagHolder value:''
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5093
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5094
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5095
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5096
    tagHolder := '' asValue.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5097
    tagHolder 
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5098
        onChangeEvaluate:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5099
            |tag rev|
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5100
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5101
            (tag := tagHolder value) notEmptyOrNil ifTrue:[
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  5102
                "/ LastTag := tag.
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5103
                rev := symbolicNames at:tag ifAbsent:[nil].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5104
                (rev notNil and:[rev ~= revisionHolder value]) ifTrue:[
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5105
                    lockChange := true.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5106
                    revisionHolder value:rev.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5107
                    lockChange := false.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5108
                ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5109
            ]
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5110
        ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5111
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5112
    tagPlusRevisionHolder := '' asValue.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5113
    tagPlusRevisionHolder
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5114
        onChangeEvaluate:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5115
            |tagPlusRevision tag|
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5116
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5117
            (tagPlusRevision := tagPlusRevisionHolder value) notEmptyOrNil ifTrue:[
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5118
                tag := (tagPlusRevision string upTo:$( ) withoutSeparators.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5119
                tagHolder value:tag.
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5120
            ]
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5121
        ].
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5122
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5123
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5124
    "/ open a dialog for this
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5125
    "/
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5126
    box := DialogBox new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5127
    box label:title.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5128
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  5129
    component := box addTextLabel:boxText withCRs adjust:#left.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  5130
    component borderWidth:0.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5131
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5132
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5133
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5134
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  5135
    component := box addTextLabel:(resources string:'Revision:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  5136
    component width:0.4.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5137
    box yPosition:y.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5138
    component := box addComboBoxOn:revisionHolder tabable:true.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5139
    component list:items.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5140
    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
  5141
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5142
    y := box yPosition.
3425
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  5143
    component := box addTextLabel:(resources string:'or Tag:') adjust:#right.
05be11d262e2 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
  5144
    component width:0.4.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5145
    box yPosition:y.
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5146
    component := box addComboListOn:tagPlusRevisionHolder tabable:true.
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5147
    component list:tagList.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5148
    component width:0.6; left:0.4.
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5149
    tagList isNil ifTrue:[
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5150
        component disable
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5151
    ].
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5152
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5153
    box addVerticalSpace.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5154
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5155
    box addAbortAndOkButtons.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5156
2325
a15e7231c04f changed:
Claus Gittinger <cg@exept.de>
parents: 2313
diff changeset
  5157
    AbortAllOperationWantedQuery query ifTrue:[
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5158
        (box addAbortButtonLabelled:'Cancel all') action:[AbortAllOperationRequest raise].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5159
    ].
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  5160
    LastTag notEmptyOrNil ifTrue:[
4193
6a4b646749ea #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4192
diff changeset
  5161
        (symbolicNames notNil and:[symbolicNames includesKey:LastTag]) ifTrue:[
6a4b646749ea #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4192
diff changeset
  5162
            tagHolder value:LastTag.
6a4b646749ea #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4192
diff changeset
  5163
        ].
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  5164
    ].
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  5165
    
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5166
    box showAtPointer.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5167
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5168
    box accepted ifFalse:[
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5169
        box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5170
        ^ nil
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5171
    ].
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5172
    box destroy.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5173
4192
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  5174
    LastTag := tagHolder value.
3651741019db #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4179
diff changeset
  5175
    
3865
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  5176
    "/ it is not a good idea to return the tag-name here,
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  5177
    "/ because it may get cached later when the source is fetched,
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  5178
    "/ 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
  5179
    "/ without me knowing about that fact.
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  5180
    "/ Therefore, we should return the real revision number.
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  5181
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  5182
    "/ 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
  5183
    "/ so we DO return the tag, but suppress caching it. sigh.
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  5184
    ^ (tagHolder value notEmptyOrNil ifTrue:[tagHolder] ifFalse:[revisionHolder]) value withoutSpaces.
3865
b76ba0a9cf83 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3847
diff changeset
  5185
    "/ ^ revisionHolder value withoutSpaces.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5186
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5187
    "
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5188
     CVSSourceCodeManager utilities
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5189
        askForExistingRevision:'enter revision'
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5190
        title:'revision'
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5191
        class:Array
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5192
        manager:CVSSourceCodeManager 
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5193
        module:'stx'
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5194
        package:'libbasic'
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5195
        fileName:nil
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5196
    "
1522
9f457901c268 checkout extensions added
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
  5197
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5198
    "Modified: / 06-12-2017 / 12:30:32 / cg"
4410
bc87f63d00b9 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4402
diff changeset
  5199
    "Modified: / 12-03-2019 / 11:46:34 / Stefan Vogel"
4438
3526402a9996 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4436
diff changeset
  5200
    "Modified: / 07-06-2019 / 22:13:30 / Claus Gittinger"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5201
!
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5202
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5203
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5204
    "check if a class contains message-sends to:
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5205
        #halt , #halt:
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5206
        #error
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5207
        #todo , #todo:
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5208
        (and maybe more in the future)
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5209
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5210
     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
  5211
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5212
    |badStuff whatIsBad msg answer labels values defaultAnswer dontShowAgain
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  5213
     methodsWithBadStuff|
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5214
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5215
    badStuff := #(
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5216
        ( 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
  5217
        ( 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
  5218
        ( 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
  5219
        ( todo         'send of #todo - unfinished code present?' )
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5220
        ( todo:        'send of #todo:- unfinished code present?' )
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5221
    ).
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5222
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5223
    methodsWithBadStuff := Set new.
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5224
    whatIsBad := Set new.
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5225
    aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5226
        |setOfLiterals setOfSentMessages|
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5227
2977
e5bfe652373f class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
  5228
        mthd isExtension ifFalse:[
2237
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5229
            setOfLiterals := mthd literals.  "/ try without parsing first.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5230
            (badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5231
                setOfSentMessages := mthd messagesSent.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5232
                badStuff do:[:eachEntry | 
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5233
                    (setOfSentMessages includes:eachEntry first) ifTrue:[
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5234
                        whatIsBad add:eachEntry second.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5235
                        methodsWithBadStuff add:mthd.
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5236
                    ]
96105b41c6a6 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  5237
                ].
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  5238
            ].
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  5239
        ].
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5240
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5241
    whatIsBad isEmpty ifTrue:[^ true].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5242
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5243
    (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
  5244
        answer := YesToAllQuery query.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5245
        answer notNil ifTrue:[ ^ answer ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5246
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5247
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5248
    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
  5249
    msg := msg , '\\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5250
    whatIsBad do:[:each |
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5251
        msg := msg , '   ' , each , '\'
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5252
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5253
    msg := msg , '\'.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5254
    methodsWithBadStuff size == 1 ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5255
        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
  5256
                        with:methodsWithBadStuff anElement whoString allBold).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5257
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5258
        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
  5259
                        with:methodsWithBadStuff anElement whoString allBold 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5260
                        with:methodsWithBadStuff size-1).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5261
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5262
    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
  5263
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5264
    (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
  5265
        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
  5266
        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
  5267
        defaultAnswer := #yesToAll.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5268
    ] ifFalse:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5269
        labels := #('No' 'No, Browse' 'Yes').
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5270
        values := #(false #noBrowse true).
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5271
        defaultAnswer := true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5272
    ].
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5273
1456
673e4fc61c36 Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents: 1449
diff changeset
  5274
"/        AbortAllOperationRequest isHandled ifTrue:[
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5275
"/            labels := #('Cancel All') , labels.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5276
"/            values := #(#cancelAll) , values.
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5277
"/        ].
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5278
3812
173678af0074 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3692
diff changeset
  5279
    Dialog modifyingBoxWith:[:box |
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5280
        checkAgainHolder isValueModel ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5281
            dontShowAgain := checkAgainHolder value not asValue.
3812
173678af0074 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3692
diff changeset
  5282
            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
  5283
                on:dontShowAgain.
1426
609f0db77471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1424
diff changeset
  5284
        ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5285
    ] do:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5286
        answer := OptionBox 
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5287
                      request:msg withCRs
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5288
                      label:(resources string:'Really CheckIn ?')
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5289
                      image:(InfoBox iconBitmap)
3551
e8feddd829f9 class: SourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents: 3546
diff changeset
  5290
                      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
  5291
                      values:values
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5292
                      default:defaultAnswer
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5293
                      onCancel:nil.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5294
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5295
    answer isNil ifTrue:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  5296
        AbortOperationRequest raise.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5297
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5298
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5299
    dontShowAgain notNil ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5300
        checkAgainHolder value:dontShowAgain value not 
1000
3687dbf412db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
  5301
    ].
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5302
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5303
    answer == #noBrowse ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5304
        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
  5305
        self yesToAllNotification queryWith:false.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5306
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5307
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5308
    answer == #cancelAll ifTrue:[
3433
eee3079d18d3 AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 3425
diff changeset
  5309
        AbortOperationRequest raise.
1994
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5310
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5311
    answer == #yesToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5312
        YesToAllNotification queryWith:true.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5313
        ^ true
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5314
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5315
    answer == #noToAll ifTrue:[
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5316
        YesToAllNotification queryWith:false.
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5317
        ^ false
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5318
    ].
eccaf18ff7a1 which method is bad - offer chance to browse them.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  5319
    ^ answer
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5320
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5321
    "
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5322
     self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities)  
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5323
    "
2775
d1908ae4aed8 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2774
diff changeset
  5324
d1908ae4aed8 changed: #checkAndWarnAboutBadMessagesInClass:checkAgainHolder:
Claus Gittinger <cg@exept.de>
parents: 2774
diff changeset
  5325
    "Modified: / 28-02-2012 / 10:41:38 / cg"
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5326
!
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5327
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5328
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5329
    "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
  5330
     and other info (mark as stable, for example).
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5331
     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
  5332
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5333
    ^ self
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5334
        getCheckinInfoFor:aClassNameOrPackageNameString 
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5335
        initialAnswer:initialAnswerOrNil
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5336
        withQuickOption:false
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5337
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5338
    "
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5339
     SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla'
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5340
    "
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5341
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5342
    "Modified: / 06-07-2010 / 11:22:15 / cg"
1704
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5343
!
c048825b966f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1671
diff changeset
  5344
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5345
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption
2283
2de925716786 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2254
diff changeset
  5346
    "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
  5347
     and other info (mark as stable, for example).
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5348
     Return the info-object (actually: the dialog) or nil if aborted."
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5349
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5350
    ^  self 
4079
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  5351
        getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil 
05771563133b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4058
diff changeset
  5352
        withQuickOption:withQuickOption
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5353
        withValidateConsistencyOption:false
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5354
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5355
    "
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5356
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5357
    "
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5358
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5359
    "Modified: / 12-03-2012 / 13:12:40 / cg"
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5360
!
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5361
4272
d0105e003a5a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4266
diff changeset
  5362
getCheckinInfoFor:infoString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption withValidateConsistencyOption:withValidateConsistencyOption
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5363
    "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
  5364
     and other info (mark as stable, for example).
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5365
     Return the info-object (actually: the dialog) or nil if aborted."
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5366
4320
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5367
    ^ self
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5368
        getCheckinInfoFor:infoString initialAnswer:initialAnswerOrNil 
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5369
        withQuickOption:withQuickOption withValidateConsistencyOption:withValidateConsistencyOption
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5370
        showChangesAction:nil
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5371
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5372
    "
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5373
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5374
    "
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5375
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5376
    "Modified: / 12-03-2012 / 13:12:40 / cg"
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5377
    "Modified (format): / 04-12-2017 / 23:07:39 / cg"
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5378
!
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5379
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5380
getCheckinInfoFor:infoString initialAnswer:initialAnswerOrNil 
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5381
    withQuickOption:withQuickOption withValidateConsistencyOption:withValidateConsistencyOption
4490
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5382
    isClassCheckin:isClassCheckin
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5383
    showChangesAction:showChangesActionOrNil
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5384
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5385
    "ask for a log message for checking in a class (plus checkinQuick state info),
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5386
     and other info (mark as stable, for example).
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5387
     Return the info-object (actually: the dialog) or nil if aborted."
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5388
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5389
    |logMsg infoDialog|
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5390
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5391
    infoDialog := Tools::CheckinInfoDialog new
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5392
                    showChangesAction:showChangesActionOrNil;
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5393
                    getCheckinInfoFor:infoString 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5394
                    initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage)
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5395
                    withQuickOption:withQuickOption
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5396
                    isClassCheckin:isClassCheckin
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5397
                    logHistory:(LastSourceLogMessages ? #())
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5398
                    withValidateConsistencyOption:withValidateConsistencyOption.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5399
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5400
    infoDialog notNil ifTrue:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5401
        logMsg := infoDialog logMessage.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5402
        logMsg notEmptyOrNil ifTrue:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5403
            LastSourceLogMessage := logMsg.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5404
            LastSourceLogMessages isNil ifTrue:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5405
                LastSourceLogMessages := OrderedCollection new.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5406
            ].
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5407
            LastSourceLogMessages remove:logMsg ifAbsent:[].
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5408
            LastSourceLogMessages addFirst:logMsg.
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5409
            LastSourceLogMessages size > 10 ifTrue:[
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5410
                LastSourceLogMessages removeLast
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5411
            ].
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5412
        ].
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5413
    ].
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5414
    ^ infoDialog
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5415
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5416
    "
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5417
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5418
    "
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5419
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5420
    "Modified: / 12-03-2012 / 13:12:40 / cg"
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5421
    "Modified (format): / 04-12-2017 / 23:07:39 / cg"
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5422
!
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5423
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5424
getCheckinInfoFor:infoString initialAnswer:initialAnswerOrNil 
b81572bab216 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
  5425
    withQuickOption:withQuickOption withValidateConsistencyOption:withValidateConsistencyOption
4320
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5426
    showChangesAction:showChangesActionOrNil
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5427
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5428
    "ask for a log message for checking in a class (plus checkinQuick state info),
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5429
     and other info (mark as stable, for example).
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5430
     Return the info-object (actually: the dialog) or nil if aborted."
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5431
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5432
    |logMsg infoDialog|
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5433
4320
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5434
    infoDialog := Tools::CheckinInfoDialog new
a8d8e5c80595 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4301
diff changeset
  5435
                    showChangesAction:showChangesActionOrNil;
4272
d0105e003a5a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4266
diff changeset
  5436
                    getCheckinInfoFor:infoString 
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5437
                    initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage)
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5438
                    withQuickOption:withQuickOption
3140
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5439
                    logHistory:(LastSourceLogMessages ? #())
25a1a02ce3d9 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3134
diff changeset
  5440
                    withValidateConsistencyOption:withValidateConsistencyOption.
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5441
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5442
    infoDialog notNil ifTrue:[
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5443
        logMsg := infoDialog logMessage.
2284
624993d61344 comment
Claus Gittinger <cg@exept.de>
parents: 2283
diff changeset
  5444
        logMsg notEmptyOrNil ifTrue:[
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5445
            LastSourceLogMessage := logMsg.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5446
            LastSourceLogMessages isNil ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5447
                LastSourceLogMessages := OrderedCollection new.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5448
            ].
2796
78401b160a28 changed: #getCheckinInfoFor:initialAnswer:withQuickOption:
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  5449
            LastSourceLogMessages remove:logMsg ifAbsent:[].
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5450
            LastSourceLogMessages addFirst:logMsg.
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5451
            LastSourceLogMessages size > 10 ifTrue:[
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5452
                LastSourceLogMessages removeLast
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5453
            ].
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5454
        ].
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5455
    ].
2106
35b6c567ff7e comment
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  5456
    ^ infoDialog
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5457
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5458
    "
2795
26cfabcd623e previous log messages
Claus Gittinger <cg@exept.de>
parents: 2794
diff changeset
  5459
     SourceCodeManagerUtilities default getCheckinInfoFor:'hello' initialAnswer:'bla'
1460
2e1c304e5b52 Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents: 1456
diff changeset
  5460
    "
1501
6bb154127b0f CheckInDialog class moved
Claus Gittinger <cg@exept.de>
parents: 1500
diff changeset
  5461
2796
78401b160a28 changed: #getCheckinInfoFor:initialAnswer:withQuickOption:
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  5462
    "Modified: / 12-03-2012 / 13:12:40 / cg"
4272
d0105e003a5a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4266
diff changeset
  5463
    "Modified (format): / 04-12-2017 / 23:07:39 / cg"
2129
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5464
!
9d5c146df780 goodInitialLogMessageForCheckinClassOfClass:
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  5465
3344
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5466
revisionForSymbolicName:tag class:cls fileName:classFileName directory:packageDir module:moduleDir manager:aSourceCodeManager
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5467
    "given a tag, return the corresponding revision"
4e577aa5b998 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3343
diff changeset
  5468
4287
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5469
    ^ aSourceCodeManager revisionForSymbolicName:tag class:cls fileName:classFileName directory:packageDir module:moduleDir
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5470
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5471
    "
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5472
     CVSSourceCodeManager 
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5473
        revisionForSymbolicName:'stable' 
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5474
        class:Array fileName:'Array.st' 
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5475
        directory:'libbasic' module:'stx' 
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5476
    "
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5477
c9ef4001cebd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
  5478
    "Modified (format): / 06-12-2017 / 11:45:12 / cg"
1375
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5479
! !
80969e1428a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5480
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5481
!SourceCodeManagerUtilities class methodsFor:'documentation'!
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5482
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  5483
version
3892
3e7000585011 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
  5484
    ^ '$Header$'
2487
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  5485
!
c8f4417b9edc changed: #ensureCorrectVersionMethodsInClass:using:
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  5486
2175
50349cb87bf4 changed:
fm
parents: 2161
diff changeset
  5487
version_CVS
3892
3e7000585011 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
  5488
    ^ '$Header$'
873
0016bc968e28 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5489
! !
3134
93b8f75424c5 class: SourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  5490