HistoryManager.st
author Claus Gittinger <cg@exept.de>
Tue, 22 Aug 2000 21:57:35 +0200
changeset 957 54dade11e57f
parent 743 a21b7562704b
child 1081 5d8001052312
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46
claus
parents: 43
diff changeset
     1
"
claus
parents: 43
diff changeset
     2
 COPYRIGHT (c) 1995 by AEG Industry Automation
claus
parents: 43
diff changeset
     3
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents: 43
diff changeset
     4
	      All Rights Reserved
claus
parents: 43
diff changeset
     5
claus
parents: 43
diff changeset
     6
 This software is furnished under a license and may be used
claus
parents: 43
diff changeset
     7
 only in accordance with the terms of that license and with the
claus
parents: 43
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
claus
parents: 43
diff changeset
     9
 be provided or otherwise made available to, or used by, any
claus
parents: 43
diff changeset
    10
 other person.  No title to or ownership of the software is
claus
parents: 43
diff changeset
    11
 hereby transferred.
claus
parents: 43
diff changeset
    12
"
claus
parents: 43
diff changeset
    13
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
    14
"{ Package: 'stx:libbasic3' }"
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
    15
120
950e4628d657 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 119
diff changeset
    16
Object subclass:#HistoryManager
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    17
	instanceVariableNames:'historyMode fullHistoryUpdate'
149
f7d66ab71259 filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
    18
	classVariableNames:'TheOneAndOnlyInstance'
f7d66ab71259 filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
    19
	poolDictionaries:''
f7d66ab71259 filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
    20
	category:'System-Changes-History'
41
claus
parents:
diff changeset
    21
!
claus
parents:
diff changeset
    22
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    23
Object subclass:#HistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    24
	instanceVariableNames:'date time user what firstPositionInSourceCode type'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    25
	classVariableNames:'Quote Separator ModifiedString DeletedString IndentString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    26
		UseGECOS CreatedString AddedString'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    27
	poolDictionaries:''
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    28
	privateIn:HistoryManager
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    29
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    30
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    31
!HistoryManager class methodsFor:'documentation'!
41
claus
parents:
diff changeset
    32
46
claus
parents: 43
diff changeset
    33
copyright 
claus
parents: 43
diff changeset
    34
"
claus
parents: 43
diff changeset
    35
 COPYRIGHT (c) 1995 by AEG Industry Automation
claus
parents: 43
diff changeset
    36
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents: 43
diff changeset
    37
	      All Rights Reserved
claus
parents: 43
diff changeset
    38
claus
parents: 43
diff changeset
    39
 This software is furnished under a license and may be used
claus
parents: 43
diff changeset
    40
 only in accordance with the terms of that license and with the
claus
parents: 43
diff changeset
    41
 inclusion of the above copyright notice.   This software may not
claus
parents: 43
diff changeset
    42
 be provided or otherwise made available to, or used by, any
claus
parents: 43
diff changeset
    43
 other person.  No title to or ownership of the software is
claus
parents: 43
diff changeset
    44
 hereby transferred.
claus
parents: 43
diff changeset
    45
"
claus
parents: 43
diff changeset
    46
!
claus
parents: 43
diff changeset
    47
41
claus
parents:
diff changeset
    48
documentation
claus
parents:
diff changeset
    49
"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    50
    This class is part of the HistoryManagerProject.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    51
    It helps to keep track of changes made to methods.
41
claus
parents:
diff changeset
    52
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    53
    All Methods and Classes in the system get a HistroyLine which 
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    54
    contains a timestamp and the name of the changing user. 
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    55
    This is acually the UniX loginname.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    56
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    57
    The Manager registers itself to get notifications 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    58
    on change, intercepts them and appends a historyLine to the methods
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    59
    code.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    60
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    61
    The HistoryManager can be turned on/off from aprivate.rc script,
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    62
    or via the Launcher menu.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    63
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    64
    The methods history line is filtered, to only contain one
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    65
    entry per modifying user, containing the date of the last change.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    66
    If fullHistoryMode is on, the classes history-ethod is also updated for
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    67
    every change (containing every change).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    68
    Full mode is enabled via:
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    69
        HistoryManager fullHistoryUpdate:true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    70
    or via the Launchers compilation-settings dialog.
41
claus
parents:
diff changeset
    71
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    72
    claus:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    73
        I changed things to avoid depending on every class in the system.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    74
        Now also catch Smalltalk change messages, related to class changes.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    75
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
    76
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
    77
        Robert Sailer - AEG
243
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    78
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    79
    [see also:]
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    80
        HistoryLine
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    81
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    82
    [start with:]
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    83
         HistoryManager activate
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    84
         HistoryManager deactivate
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    85
41
claus
parents:
diff changeset
    86
"
claus
parents:
diff changeset
    87
! !
claus
parents:
diff changeset
    88
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    89
!HistoryManager class methodsFor:'initialization'!
41
claus
parents:
diff changeset
    90
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    91
initMe
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    92
    "setup theOneAndOnly instance of myself (if not already present"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    93
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    94
    ^self new.
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    95
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    96
    "Modified: 14.8.1995 / 09:02:00 / robert"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    97
    "Modified: 20.4.1996 / 20:33:44 / cg"
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    98
!
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    99
41
claus
parents:
diff changeset
   100
initialize
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   101
    "add myself as a dependent of ObjectMemory to be told about image restarts"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   102
41
claus
parents:
diff changeset
   103
    ObjectMemory addDependent: self.
claus
parents:
diff changeset
   104
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   105
    "Modified: 14.8.1995 / 09:09:06 / robert"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   106
    "Modified: 20.4.1996 / 20:34:09 / cg"
41
claus
parents:
diff changeset
   107
! !
claus
parents:
diff changeset
   108
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   109
!HistoryManager class methodsFor:'instance creation'!
41
claus
parents:
diff changeset
   110
claus
parents:
diff changeset
   111
new
46
claus
parents: 43
diff changeset
   112
    "because there can be only ONE HistoryManager, new must me redefiend"
41
claus
parents:
diff changeset
   113
claus
parents:
diff changeset
   114
    TheOneAndOnlyInstance isNil ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   115
        TheOneAndOnlyInstance := super new initialize.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   116
        HistoryLine initialize.
41
claus
parents:
diff changeset
   117
    ].
claus
parents:
diff changeset
   118
claus
parents:
diff changeset
   119
   ^ TheOneAndOnlyInstance
claus
parents:
diff changeset
   120
claus
parents:
diff changeset
   121
"
claus
parents:
diff changeset
   122
claus
parents:
diff changeset
   123
    HistoryManager new.
claus
parents:
diff changeset
   124
"
claus
parents:
diff changeset
   125
claus
parents:
diff changeset
   126
    "Modified: 11.08.1995 / 17:01:29 / robert"
claus
parents:
diff changeset
   127
! !
claus
parents:
diff changeset
   128
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   129
!HistoryManager class methodsFor:'accessing'!
41
claus
parents:
diff changeset
   130
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   131
fullHistoryUpdate
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   132
    "return true, if the historyManagement does full updates"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   133
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   134
    TheOneAndOnlyInstance isNil ifTrue:[^ false].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   135
    ^ TheOneAndOnlyInstance fullHistoryUpdate
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   136
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   137
    "Modified: / 27.8.1995 / 00:32:12 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   138
    "Created: / 24.10.1997 / 02:24:34 / cg"
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   139
    "Modified: / 29.10.1997 / 15:48:22 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   140
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   141
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   142
fullHistoryUpdate:aBoolean
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   143
    "set/clear, full updates"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   144
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   145
    TheOneAndOnlyInstance isNil ifTrue:[^ self].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   146
    TheOneAndOnlyInstance fullHistoryUpdate:aBoolean
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   147
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   148
    "Modified: / 27.8.1995 / 00:32:12 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   149
    "Created: / 24.10.1997 / 02:24:58 / cg"
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   150
    "Modified: / 29.10.1997 / 15:48:36 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   151
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   152
41
claus
parents:
diff changeset
   153
instance
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   154
    "return the one and only historyManager instance"
41
claus
parents:
diff changeset
   155
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   156
    ^ TheOneAndOnlyInstance
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   157
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   158
    "Modified: 20.4.1996 / 20:31:18 / cg"
41
claus
parents:
diff changeset
   159
!
claus
parents:
diff changeset
   160
claus
parents:
diff changeset
   161
isActive 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   162
    "return true, if the historyManagement is activated"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   163
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   164
    ^ TheOneAndOnlyInstance notNil
41
claus
parents:
diff changeset
   165
claus
parents:
diff changeset
   166
    "Modified: 27.8.1995 / 00:32:12 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   167
    "Modified: 20.4.1996 / 20:31:32 / cg"
41
claus
parents:
diff changeset
   168
! !
claus
parents:
diff changeset
   169
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   170
!HistoryManager class methodsFor:'activation / deactivation'!
41
claus
parents:
diff changeset
   171
claus
parents:
diff changeset
   172
activate
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   173
    "activate the HistoryManagement"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   174
41
claus
parents:
diff changeset
   175
    self new   "/ creating an instance activates me
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   176
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   177
    "
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   178
     HistoryManager activate
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   179
    "
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   180
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   181
    "Modified: 20.4.1996 / 20:31:46 / cg"
41
claus
parents:
diff changeset
   182
!
claus
parents:
diff changeset
   183
claus
parents:
diff changeset
   184
deactivate
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   185
    "deactivate the HistoryManagement"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   186
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   187
    |mgr|
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   188
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   189
    mgr := TheOneAndOnlyInstance.
532
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   190
    mgr notNil ifTrue:[
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   191
        mgr releaseDependencies.
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   192
    ].
41
claus
parents:
diff changeset
   193
    TheOneAndOnlyInstance := nil.
claus
parents:
diff changeset
   194
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   195
    "
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   196
     HistoryManager deactivate
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   197
    "
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   198
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   199
    "Modified: 8.1.1997 / 23:09:08 / cg"
41
claus
parents:
diff changeset
   200
! !
claus
parents:
diff changeset
   201
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   202
!HistoryManager class methodsFor:'change & update'!
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   203
320
661e503430ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
   204
update:what with:aParameter from:changedObject
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   205
    "intercepts system restart - reinstall mySelf as dependent of all classes"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   206
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   207
    (what == #restarted) ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   208
        TheOneAndOnlyInstance notNil ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   209
            "
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   210
             smalltalk is about to restart from an Image -
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   211
            "
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   212
"/            'HistoryManager initialize (via update)' infoPrintNL.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   213
            self initMe.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   214
        ]
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   215
    ].
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   216
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   217
    "Modified: 27.8.1995 / 16:33:02 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   218
    "Modified: 20.4.1996 / 20:33:02 / cg"
320
661e503430ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
   219
    "Created: 15.6.1996 / 15:25:53 / cg"
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   220
! !
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   221
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   222
!HistoryManager class methodsFor:'helpers'!
47
claus
parents: 46
diff changeset
   223
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   224
createInitialHistoryMethodIn:aClass
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   225
    "create an initial (empty) history method"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   226
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   227
    |histStream|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   228
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   229
    histStream := '' writeStream.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   230
    histStream nextPutLine:'history'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   231
    histStream nextPutLine:(HistoryLine newCreated printString).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   232
    Compiler 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   233
        compile:(histStream contents)
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   234
        forClass:aClass 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   235
        inCategory:'documentation'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   236
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   237
    "Created: / 24.10.1997 / 02:41:43 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   238
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   239
47
claus
parents: 46
diff changeset
   240
getAllHistoriesFrom:someString
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   241
    "returns anArray of HistoryLines from a string.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   242
     Usually, the argument is a methods source code."
47
claus
parents: 46
diff changeset
   243
claus
parents: 46
diff changeset
   244
    |position aReadWriteStream firstFound nextFound  aHistoryString rcOC h|
claus
parents: 46
diff changeset
   245
claus
parents: 46
diff changeset
   246
    "read begining from the end and look there for the first comment character. If there's none return"
claus
parents: 46
diff changeset
   247
claus
parents: 46
diff changeset
   248
    rcOC := OrderedCollection new.
claus
parents: 46
diff changeset
   249
    position := someString size.
claus
parents: 46
diff changeset
   250
    firstFound := false.
claus
parents: 46
diff changeset
   251
    nextFound := false.
claus
parents: 46
diff changeset
   252
claus
parents: 46
diff changeset
   253
    someString reverseDo:[ :aChar|
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   254
        position := position - 1.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   255
        aChar == $" ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   256
            firstFound ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   257
                firstFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   258
                nextFound := true.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   259
            ] ifFalse:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   260
                aReadWriteStream := ReadWriteStream on: String new.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   261
                firstFound := true.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   262
                nextFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   263
            ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   264
        ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   265
        (firstFound and: [nextFound not]) ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   266
            "now collect all up to the next comment character"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   267
            aChar == $" ifFalse:[     
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   268
                aReadWriteStream nextPut: aChar.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   269
            ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   270
        ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   271
        nextFound ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   272
            "End reached - now try to make a HistoryLine"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   273
            aHistoryString := (aReadWriteStream contents) reverse.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   274
            "
258
bf9fd9ad4687 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   275
                Transcript showCR: aHistoryString.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   276
            "
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   277
            h := HistoryLine fromString: aHistoryString at: position.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   278
            h notNil ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   279
                rcOC add:h.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   280
            ].
47
claus
parents: 46
diff changeset
   281
"/            (aHistoryString startsWith: 'Modified:') ifTrue:[
claus
parents: 46
diff changeset
   282
"/                "a history line was found - now make a NewInstance of HistoryLine"
claus
parents: 46
diff changeset
   283
"/                rcOC add: ( HistoryLine fromString: aHistoryString at: position).
claus
parents: 46
diff changeset
   284
"/            ].
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   285
            nextFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   286
        ].
47
claus
parents: 46
diff changeset
   287
    ].
claus
parents: 46
diff changeset
   288
claus
parents: 46
diff changeset
   289
    ^rcOC reverse  "the OrderedCollection with HistoryLines in the right order"
claus
parents: 46
diff changeset
   290
claus
parents: 46
diff changeset
   291
    "Modified: 21.12.1993 / 18:32:30 / M.Noell"
claus
parents: 46
diff changeset
   292
    "Modified: 9.8.1995 / 22:45:30 / R.Sailer"
claus
parents: 46
diff changeset
   293
    "Modified: 8.9.1995 / 17:54:33 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   294
    "Modified: 20.4.1996 / 20:33:22 / cg"
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   295
!
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   296
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   297
withoutHistoryLines:someString
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   298
    "given some methods sourceString, return a copy without any
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   299
     history lines"
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   300
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   301
    | pos sourceCode previousHistories |
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   302
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   303
    someString isNil ifTrue:[^ someString].
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   304
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   305
    previousHistories := self getAllHistoriesFrom:someString.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   306
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   307
    "extract source body."
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   308
    previousHistories isEmpty ifTrue: [
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   309
        sourceCode := someString withoutSeparators.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   310
    ] ifFalse: [
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   311
        pos := (previousHistories first) firstPositionInSourceCode.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   312
        sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   313
    ].
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   314
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   315
    ^ sourceCode
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   316
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   317
    "
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   318
     HistoryManager withoutHistoryLines:nil  
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   319
     HistoryManager withoutHistoryLines:''  
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   320
     HistoryManager 
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   321
        withoutHistoryLines:(HistoryManager class 
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   322
                                compiledMethodAt:#withoutHistoryLines:) source
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   323
    "
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   324
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   325
    "Created: 5.3.1996 / 15:11:12 / cg"
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   326
    "Modified: 30.4.1996 / 10:57:35 / cg"
47
claus
parents: 46
diff changeset
   327
! !
claus
parents: 46
diff changeset
   328
41
claus
parents:
diff changeset
   329
!HistoryManager methodsFor:'accessing'!
claus
parents:
diff changeset
   330
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   331
fullHistoryUpdate
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   332
    "return the fullHistoryUpdate; 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   333
     if true, the classes history method is also updated."
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   334
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   335
    ^ fullHistoryUpdate
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   336
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   337
    "Modified: 11.08.1995 / 16:52:12 / robert"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   338
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   339
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   340
fullHistoryUpdate:aBoolean
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   341
    "set the fullHistoryUpdate; 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   342
     if true, the classes history method is also updated."
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   343
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   344
    fullHistoryUpdate := aBoolean.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   345
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   346
    "Modified: 11.08.1995 / 16:52:12 / robert"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   347
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   348
41
claus
parents:
diff changeset
   349
historyMode
claus
parents:
diff changeset
   350
    "return historyMode"
claus
parents:
diff changeset
   351
claus
parents:
diff changeset
   352
    ^ historyMode
claus
parents:
diff changeset
   353
claus
parents:
diff changeset
   354
    "Modified: 11.08.1995 / 16:51:56 / robert"
claus
parents:
diff changeset
   355
!
claus
parents:
diff changeset
   356
claus
parents:
diff changeset
   357
historyMode:something
claus
parents:
diff changeset
   358
    "set historyMode"
claus
parents:
diff changeset
   359
claus
parents:
diff changeset
   360
    historyMode := something.
claus
parents:
diff changeset
   361
claus
parents:
diff changeset
   362
    "Modified: 11.08.1995 / 16:52:12 / robert"
claus
parents:
diff changeset
   363
! !
claus
parents:
diff changeset
   364
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   365
!HistoryManager methodsFor:'change & update'!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   366
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   367
update:something with:someArgument from:changedObject
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   368
    "arrive here, whenever any class changed somehow.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   369
     (something contains aSymbol describing what happened)"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   370
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   371
    |sourceCode newMethod fileInOrRecompiling selector oldMethod what
597
d8b3b9622b39 dont crash if oldSource is not available.
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   372
     changedClass whatChange oldSource|
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   373
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   374
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   375
    "/ no action, if disabled
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   376
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   377
    historyMode ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   378
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   379
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   380
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   381
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   382
    "/ no action, if changeFile update is locked
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   383
    "/ (since then, this may be a recompile or fileIn)
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   384
    "/
743
a21b7562704b Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 739
diff changeset
   385
    fileInOrRecompiling := Class updateChangeFileQuerySignal query.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   386
    fileInOrRecompiling ifFalse:[ 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   387
"/        Transcript showCR: '* noChange in history'. 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   388
        ^ self 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   389
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   390
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   391
    "
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   392
     definition, instance / classVariables of a class have changed
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   393
    "
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   394
    (something == #definition) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   395
        "/ it is a class definition that has changed
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   396
        "/ add a line to the history method; if present
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   397
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   398
"/        Transcript show: 'Class definition: ', changedClass printString;cr.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   399
        fullHistoryUpdate == true ifTrue:[
728
501a0a757440 oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   400
            self addHistory:#modification with:'class definition' toHistoryMethodOf:changedObject.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   401
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   402
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   403
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   404
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   405
    "this is a sub item of #definition"    
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   406
    (something == #classVariables) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   407
        "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   408
        "/ Transcript showCR: 'classVariables changed'.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   409
        "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   410
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   411
        "/ does not yet work;
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   412
        "/ (someArgument does not contain the class we are interested in)
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   413
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   414
        fullHistoryUpdate == true ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   415
            self addHistory:#modification with:'class variables' toHistoryMethodOf:changedObject.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   416
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   417
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   418
    ].    
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   419
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   420
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   421
    "/ new Class creation
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   422
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   423
    ((changedObject == Smalltalk) and:[something == #newClass]) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   424
        "/ 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   425
        "/  add myself as dependents in order to get future change notifications
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   426
        "/ 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   427
        fullHistoryUpdate == true ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   428
            self createHistoryMethodFor:someArgument.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   429
            self addHistory:#creation with:nil toHistoryMethodOf:someArgument.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   430
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   431
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   432
        "/ claus: old implementation
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   433
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   434
"/        someArgument addDependent: self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   435
"/        someArgument class addDependent: self.   "for class methods"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   436
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   437
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   438
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   439
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   440
    "/ changed methods
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   441
    "/ for backward compatibility, still handle the
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   442
    "/ classes own change notification.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   443
    "/ (only if I am a dependent of all classes)
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   444
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   445
    changedObject isBehavior ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   446
        changedClass := changedObject.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   447
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   448
        something == #methodDictionary ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   449
            whatChange := #methodDictionary.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   450
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   451
            someArgument isArray ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   452
                selector := someArgument at:1.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   453
                oldMethod := someArgument at:2
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   454
            ] ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   455
                selector := someArgument
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   456
            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   457
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   458
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   459
        something == #methodInClassRemoved ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   460
            fullHistoryUpdate == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   461
                changedClass := someArgument at:1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   462
                selector := someArgument at:2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   463
                self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   464
            ].
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   465
            ^ self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   466
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   467
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   468
        something == #comment ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   469
            whatChange := #comment.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   470
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   471
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   472
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   473
    "/ the new mechanism; I only need to depend upon
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   474
    "/ Smalltalk, to get all method changes
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   475
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   476
    (changedObject == Smalltalk
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   477
    and:[something == #methodInClass]) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   478
        changedClass := someArgument at:1.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   479
        selector := someArgument at:2.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   480
        oldMethod := someArgument at:3.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   481
        whatChange := #methodDictionary.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   482
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   483
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   484
    changedClass notNil ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   485
        whatChange == #methodDictionary ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   486
            "/ ok; it is a changed method
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   487
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   488
            "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   489
            "/ fetch sourceString of the method
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   490
            "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   491
            sourceCode := changedClass sourceCodeAt:selector.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   492
            sourceCode isNil ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   493
                "method has been deleted"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   494
"/                Transcript showCR: 'method has been deleted'.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   495
                fullHistoryUpdate == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   496
                    self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   497
                ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   498
                ^ self.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   499
            ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   500
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   501
            newMethod := changedClass compiledMethodAt:selector.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   502
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   503
            oldMethod notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   504
                oldSource := oldMethod source.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   505
                oldSource notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   506
                    (oldSource asString withTabsExpanded = sourceCode asString withTabsExpanded) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   507
                         "/ no change (accepted same code again ?)
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   508
                        ^ self
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   509
                    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   510
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   511
            ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   512
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   513
            "/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   514
            "/ dont add historylines to documentation methods ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   515
            "/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   516
            (changedClass isMeta not
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   517
            or:[newMethod category ~= 'documentation']) ifTrue:[
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   518
                oldMethod notNil ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   519
                    what := #modification
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   520
                ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   521
                    what := #creation
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   522
                ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   523
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   524
                "/
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   525
                "/ update the history line-comment in
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   526
                "/ the methods source
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   527
                "/
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   528
            
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   529
                sourceCode := self addHistory:what with:nil to:sourceCode filter:true.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   530
                newMethod source: sourceCode.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   531
"/                    Transcript showCR: 'history updated / added'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   532
            ].
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   533
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   534
            fullHistoryUpdate == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   535
                self addHistory:what with:('#' , selector) toHistoryMethodOf:changedClass.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   536
            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   537
            ^self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   538
        ]. 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   539
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   540
        whatChange == #comment ifTrue:[
594
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   541
            "the classes comment - we are no longer interested in that one"
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   542
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   543
            ^ self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   544
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   545
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   546
        whatChange == #classDefinition ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   547
            "/ it is a class definition that has changed
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   548
            "/ add a line to the history method; if present
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   549
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   550
"/            Transcript show: 'Class definition: ', changedClass printString;cr.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   551
            fullHistoryUpdate == true ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   552
                self addHistory:#modification with:'class definition' toHistoryMethodOf:changedClass.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   553
            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   554
            ^self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   555
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   556
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   557
"/    Transcript show: 'unhandled change: ', something printString;cr.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   558
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   559
    ^self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   560
743
a21b7562704b Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 739
diff changeset
   561
    "Modified: / 27.8.1995 / 02:14:43 / claus"
a21b7562704b Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 739
diff changeset
   562
    "Modified: / 24.10.1997 / 01:41:19 / cg"
a21b7562704b Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 739
diff changeset
   563
    "Modified: / 18.3.1999 / 18:21:47 / stefan"
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   564
! !
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   565
41
claus
parents:
diff changeset
   566
!HistoryManager methodsFor:'initialization'!
claus
parents:
diff changeset
   567
claus
parents:
diff changeset
   568
exclude
46
claus
parents: 43
diff changeset
   569
    "public - return an exclusionlist for some smalltalk classes which should not be notified or historisized"
41
claus
parents:
diff changeset
   570
claus
parents:
diff changeset
   571
    | oc |
claus
parents:
diff changeset
   572
        
claus
parents:
diff changeset
   573
    oc := OrderedCollection new.
claus
parents:
diff changeset
   574
    oc add: self.
claus
parents:
diff changeset
   575
claus
parents:
diff changeset
   576
    ^oc
claus
parents:
diff changeset
   577
claus
parents:
diff changeset
   578
    "Modified: 11.08.1995 / 17:02:18 / robert"
claus
parents:
diff changeset
   579
!
claus
parents:
diff changeset
   580
claus
parents:
diff changeset
   581
initialize
46
claus
parents: 43
diff changeset
   582
    "public - make me depend on all smalltalk classes (except the exclusionList)
claus
parents: 43
diff changeset
   583
     to be notified later about changes. This intercepts source installation and allows
claus
parents: 43
diff changeset
   584
     be to patch the source-string with a historyLine."
41
claus
parents:
diff changeset
   585
53
claus
parents: 48
diff changeset
   586
    |exclusionlist|
41
claus
parents:
diff changeset
   587
claus
parents:
diff changeset
   588
    super initialize.
claus
parents:
diff changeset
   589
    historyMode := true.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   590
    fullHistoryUpdate := false.
41
claus
parents:
diff changeset
   591
    exclusionlist := self exclude.
claus
parents:
diff changeset
   592
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   593
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   594
    "/ made myself a dependent of all classes ...
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   595
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   596
"/    Smalltalk allClassesDo:[:aClass|
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   597
"/        "all classes should send a notification if changed"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   598
"/        "aClass = self " false ifFalse: [
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   599
"/            (exclusionlist includes: aClass) ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   600
"/                aClass addDependent: self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   601
"/                aClass class addDependent: self.   "for class methods"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   602
"/            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   603
"/        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   604
"/    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   605
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   606
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   607
    "/ Smalltalk also sends class-change notifications ...
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   608
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   609
    Smalltalk addDependent:self.
41
claus
parents:
diff changeset
   610
claus
parents:
diff changeset
   611
    ^self
claus
parents:
diff changeset
   612
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   613
    "Modified: 11.8.1995 / 17:12:51 / robert"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   614
    "Modified: 8.1.1997 / 23:07:14 / cg"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   615
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   616
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   617
releaseDependencies
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   618
    "no longer depend on class changes"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   619
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   620
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   621
    "/ made myself a dependent of all classes ...
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   622
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   623
"/    Smalltalk allClassesDo:[:aClass |
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   624
"/        aClass removeDependent:self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   625
"/        aClass class removeDependent:self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   626
"/    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   627
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   628
    "/ new implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   629
    "/ Smalltalk also sends class-change notifications ...
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   630
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   631
    Smalltalk removeDependent:self.
41
claus
parents:
diff changeset
   632
! !
claus
parents:
diff changeset
   633
claus
parents:
diff changeset
   634
!HistoryManager methodsFor:'updateHistory'!
claus
parents:
diff changeset
   635
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   636
addHistory:what with:argument to:someString filter:doFilter
41
claus
parents:
diff changeset
   637
    "private - add a historyLine at end to the sourceCode;
140
8c22b3cf100d changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
   638
     check for multiple lines of the same user and merge into one.
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   639
     What may be one of #modification or #creation, to choose among
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   640
     'Modified' or 'Created' lines."
41
claus
parents:
diff changeset
   641
53
claus
parents: 48
diff changeset
   642
    | histLines pos wStream sourceCode previousHistories
47
claus
parents: 46
diff changeset
   643
      newLine |
41
claus
parents:
diff changeset
   644
53
claus
parents: 48
diff changeset
   645
    "Check whether we want a history to be added"    
claus
parents: 48
diff changeset
   646
    historyMode ifFalse:[
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   647
        ^ someString
53
claus
parents: 48
diff changeset
   648
    ].
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   649
47
claus
parents: 46
diff changeset
   650
    previousHistories := self class getAllHistoriesFrom:someString.
41
claus
parents:
diff changeset
   651
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   652
    newLine := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   653
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   654
    what == #creation ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   655
        newLine isForCreation.
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   656
    ] ifFalse:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   657
        what == #deletion ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   658
            newLine isForDeletion.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   659
        ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   660
            what == #addition ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   661
                newLine isForAddition.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   662
            ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   663
                what == #modification ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   664
                    newLine isForModification.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   665
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   666
            ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   667
        ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   668
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   669
    argument notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   670
        newLine what:argument
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   671
    ].
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   672
41
claus
parents:
diff changeset
   673
    "extract source body."
claus
parents:
diff changeset
   674
    previousHistories isEmpty ifTrue: [
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   675
        sourceCode := someString withoutSeparators.
41
claus
parents:
diff changeset
   676
    ] ifFalse: [
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   677
        pos := (previousHistories first) firstPositionInSourceCode.
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   678
        sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators.
41
claus
parents:
diff changeset
   679
    ].
claus
parents:
diff changeset
   680
claus
parents:
diff changeset
   681
    "add the actual user's historyLine."
47
claus
parents: 46
diff changeset
   682
    previousHistories add:newLine.
41
claus
parents:
diff changeset
   683
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   684
    doFilter ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   685
        "Filtering historyLines (each user with one entry)."
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   686
        histLines := HistoryLine filterHistoryLines: previousHistories.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   687
    ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   688
        histLines := previousHistories
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   689
    ].
41
claus
parents:
diff changeset
   690
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   691
    "create new method body with added historyLine"
41
claus
parents:
diff changeset
   692
    wStream := WriteStream on: String new.
claus
parents:
diff changeset
   693
    wStream nextPutAll: sourceCode; cr.
claus
parents:
diff changeset
   694
claus
parents:
diff changeset
   695
    "append the historyLines to the source"
claus
parents:
diff changeset
   696
    wStream cr.
claus
parents:
diff changeset
   697
    histLines do: [:hl |
512
d38e6339cddb use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 504
diff changeset
   698
       wStream nextPutLine:hl printString.
41
claus
parents:
diff changeset
   699
    ].
claus
parents:
diff changeset
   700
512
d38e6339cddb use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 504
diff changeset
   701
    ^ wStream contents.
41
claus
parents:
diff changeset
   702
47
claus
parents: 46
diff changeset
   703
    "Modified: 11.8.1995 / 16:51:50 / robert"
claus
parents: 46
diff changeset
   704
    "Modified: 8.9.1995 / 17:55:38 / claus"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   705
    "Created: 24.10.1997 / 00:16:38 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   706
    "Modified: 24.10.1997 / 01:27:21 / cg"
41
claus
parents:
diff changeset
   707
!
claus
parents:
diff changeset
   708
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   709
addHistory:what with:arg toHistoryMethodOf:aClass
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   710
    "private - add a historyLine at end of the classes history methods
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   711
     source - if there is one"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   712
53
claus
parents: 48
diff changeset
   713
    |cls historyMethod oldSource newSource|
claus
parents: 48
diff changeset
   714
claus
parents: 48
diff changeset
   715
    aClass isMeta ifFalse:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   716
        cls := aClass class.
53
claus
parents: 48
diff changeset
   717
    ] ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   718
        cls := aClass
53
claus
parents: 48
diff changeset
   719
    ].
claus
parents: 48
diff changeset
   720
    historyMethod := cls compiledMethodAt: #history.
claus
parents: 48
diff changeset
   721
    historyMethod notNil ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   722
        oldSource := historyMethod source.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   723
        oldSource notNil ifTrue:[
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   724
            newSource := self 
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   725
                            addHistory:what
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   726
                            with:arg
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   727
                            to:oldSource
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   728
                            filter:false. 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   729
            historyMethod source:newSource.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   730
        ]
53
claus
parents: 48
diff changeset
   731
    ]
149
f7d66ab71259 filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
   732
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   733
    "Created: 12.10.1996 / 20:31:50 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   734
    "Modified: 24.10.1997 / 00:14:33 / cg"
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   735
!
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   736
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   737
createHistoryMethodFor:aClass
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   738
    "private - create a history method"
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   739
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   740
    |cls|
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   741
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   742
    aClass isMeta ifFalse:[
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   743
        cls := aClass class.
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   744
    ] ifTrue:[
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   745
        cls := aClass
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   746
    ].
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   747
497
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   748
    Class updateChangeFileQuerySignal answer:false do:[
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   749
        Compiler
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   750
            compile:'history' 
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   751
            forClass:cls 
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   752
            inCategory:'documentation'
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   753
    ].
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   754
497
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   755
    "Modified: 14.10.1996 / 16:58:20 / cg"
41
claus
parents:
diff changeset
   756
! !
claus
parents:
diff changeset
   757
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   758
!HistoryManager::HistoryLine class methodsFor:'converting'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   759
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   760
convertAStringToADate: aString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   761
   "kludge while not having the Time and Date format spec Class"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   762
690
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   763
    | s day month year coll |
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   764
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   765
    "delete delimiter from the date string"
690
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   766
    s := aString copyReplaceAll: $. with:(Character space) .
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   767
    coll := s asArrayOfSubstrings.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   768
    day := (coll at: 1) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   769
    month := (coll at: 2 ) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   770
    year := (coll at: 3 ) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   771
739
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   772
    ^ Date newDay:day month:month year:year.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   773
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   774
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   775
     HistoryLine convertAStringToADate:'18.10.1995'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   776
     HistoryLine convertAStringToADate:'18.10.95'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   777
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   778
690
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   779
    "Modified: / 23.8.1995 / 21:28:58 / robert"
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   780
    "Modified: / 16.9.1997 / 14:35:03 / stefan"
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   781
    "Modified: / 18.7.1998 / 22:55:09 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   782
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   783
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   784
convertAStringToATime: aString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   785
   "kludge while not having the Time and Date format spec Class"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   786
739
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   787
    |h m s|
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   788
739
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   789
    h := (aString copyFrom:1 to:2) asNumber.
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   790
    m := (aString copyFrom:4 to:5) asNumber.
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   791
    s := (aString copyFrom:7 to:8) asNumber.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   792
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   793
739
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   794
    ^Time hours:h minutes:m seconds:s.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   795
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   796
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   797
     HistoryLine convertAStringToATime:'18:23:15' 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   798
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   799
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   800
    "Modified: 15.08.1995 / 18:56:18 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   801
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   802
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   803
!HistoryManager::HistoryLine class methodsFor:'documentation'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   804
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   805
copyright 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   806
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   807
 COPYRIGHT (c) 1995 by AEG Industry Automation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   808
 COPYRIGHT (c) 1995 by Claus Gittinger
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   809
	      All Rights Reserved
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   810
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   811
 This software is furnished under a license and may be used
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   812
 only in accordance with the terms of that license and with the
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   813
 inclusion of the above copyright notice.   This software may not
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   814
 be provided or otherwise made available to, or used by, any
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   815
 other person.  No title to or ownership of the software is
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   816
 hereby transferred.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   817
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   818
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   819
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   820
documentation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   821
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   822
    The class HistoryLine is part of the HistoryManagerProjcet.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   823
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   824
    HistoryLine knows how to compose and parse comment lines which are
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   825
    used to keep track of changes. These historyLines are added at the end of
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   826
    a methods source code and to the special history classmethod.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   827
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   828
    HistoryLine and HistoryManager where generously provided by AEG for inclusion into the
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   829
    ST/X class delivery.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   830
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   831
    [see also:]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   832
        HistoryManager
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   833
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   834
    [author:]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   835
        Robert Sailer - AEG
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   836
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   837
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   838
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   839
examples
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   840
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   841
    HistoryLine initialize.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   842
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   843
    HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   844
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   845
    HistoryLine for: 'R.Sailer'.    for integration purposes ONLY
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   846
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   847
    HistoryLine deleted.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   848
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   849
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   850
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   851
version
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
   852
    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.46 2000-08-22 19:57:33 cg Exp $'
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   853
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   854
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   855
!HistoryManager::HistoryLine class methodsFor:'filtering'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   856
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   857
filterHistoryLines:  aCollectionOfHistoryLines
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   858
    "check the collection against multiple occurrence of the same user,
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   859
     and remove all but the youngest (per user)."
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   860
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   861
    |newCollection|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   862
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   863
    newCollection := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   864
    aCollectionOfHistoryLines keysAndValuesDo:[:index :histLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   865
        |skip|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   866
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   867
        skip := false.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   868
        histLine isModified ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   869
            "/ if there is another one, skip this
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   870
            aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   871
                anotherHistLine isModified ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   872
                    anotherHistLine user = histLine user ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   873
                        skip := true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   874
                    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   875
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   876
            ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   877
        ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   878
            "/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   879
            "/ filter out multiple created messages
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   880
            "/ (this only occurs if a method was copied from ClassA to ClassB)
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   881
            "/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   882
            histLine isCreated ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   883
                aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   884
                    anotherHistLine isCreated ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   885
                        skip := true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   886
                    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   887
                ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   888
            ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   889
        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   890
        skip ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   891
            newCollection add:histLine.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   892
        ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   893
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   894
    ^ newCollection.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   895
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   896
"/    | allUsers newCollection aHistLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   897
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   898
"/    allUsers := Set new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   899
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   900
"/    anOrderdCollectionOfHistoryLines do:[ :hl| allUsers add: hl user ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   901
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   902
"/    allUsers size ~~ anOrderdCollectionOfHistoryLines ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   903
"/        "there is at least one user twice"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   904
"/        newCollection := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   905
"/        1 to: (anOrderdCollectionOfHistoryLines size - 1) do:[ :index|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   906
"/            aHistLine :=(anOrderdCollectionOfHistoryLines at: index).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   907
"/            allUsers last = aHistLine user ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   908
"/                newCollection add: aHistLine.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   909
"/            ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   910
"/        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   911
"/        "add the last element with the actucal HistoryLine"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   912
"/        newCollection add: anOrderdCollectionOfHistoryLines last.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   913
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   914
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   915
"/        "the new collection shold now be sorted at timeStamp. --- for further study"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   916
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   917
"/        ^newCollection.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   918
"/    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   919
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   920
"/    ^ anOrderdCollectionOfHistoryLines
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   921
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   922
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   923
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   924
     |u1 u2 u3 u4 u5 oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   925
     u1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   926
     u2 := HistoryLine for: 'claus'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   927
     u3 := HistoryLine for: 'chris'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   928
     u4 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   929
     u5 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   930
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   931
     oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   932
     oc add: u1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   933
     oc add: u2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   934
     oc add: u3.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   935
     oc add: u4.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   936
     oc add: u5.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   937
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   938
     oc inspect.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   939
     (HistoryLine filterHistoryLines: oc) inspect 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   940
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   941
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   942
    "Modified: 8.9.1995 / 17:20:40 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   943
    "Modified: 20.4.1996 / 20:23:07 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   944
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   945
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   946
!HistoryManager::HistoryLine class methodsFor:'initialization'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   947
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   948
initialize
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   949
    "setup class variables"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   950
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   951
    Quote isNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   952
        Quote := '"'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   953
        Separator := '/'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   954
        ModifiedString := 'Modified:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   955
        DeletedString := 'Deleted:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   956
        CreatedString := 'Created:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   957
        AddedString := 'Added:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   958
        IndentString := '    '.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   959
        UseGECOS := false.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   960
    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   961
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   962
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   963
     HistoryLine initialize
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   964
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   965
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   966
    "Modified: 23.8.1995 / 22:14:03 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   967
    "Modified: 20.4.1996 / 20:23:29 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   968
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   969
    "Modified: 24.10.1997 / 01:18:56 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   970
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   971
    "Modified: / 24.10.1997 / 02:01:20 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   972
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   973
    "Modified:  24.10.1997  02:07:16  cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   974
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   975
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   976
!HistoryManager::HistoryLine class methodsFor:'instance creation'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   977
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   978
fromString: aString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   979
    "parses the argument, aString; 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   980
     create & return a new Instance with the values" 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   981
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   982
    ^ self fromString: aString at: 0.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   983
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   984
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   985
     HistoryLine fromString: 'Modified: 01.12.93 / 18:32:30 / M.Noell'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   986
     HistoryLine fromString: 'Created: 01.12.93 / 18:32:30 / M.Noell'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   987
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   988
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   989
    "Modified: 23.8.1995 / 22:14:13 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   990
    "Modified: 20.4.1996 / 20:24:47 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   991
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   992
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   993
fromString: aString at: position
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   994
    "parses the String and creates a new Instance with the values. 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   995
     The positionvalue is normally used to remove the HistoryLines from the sourceCode.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   996
     Claus: return nil, if the string is not a valid historyString."
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   997
728
501a0a757440 oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   998
    | inst anArray type aTime aDate userName idx what|
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   999
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1000
    inst := self basicNew.  
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1001
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1002
    anArray := aString asArrayOfSubstrings.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1003
    anArray size < 5 ifTrue:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1004
    anArray := anArray collect:[:word | word withoutSpaces].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1005
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1006
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1007
        Modified / Deleted / Created
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1008
        [what]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1009
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1010
        date asString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1011
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1012
        time asString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1013
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1014
        UserName ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1015
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1016
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1017
    type := anArray at:1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1018
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1019
    ((Array 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1020
        with:ModifiedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1021
        with:DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1022
        with:CreatedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1023
        with:AddedString) includes:type) ifFalse:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1024
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1025
    inst type:type.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1026
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1027
    "/ sigh backward compatibility ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1028
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1029
    (anArray at:2) first isDigit ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1030
        "/ date follows ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1031
        idx := 2
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1032
    ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1033
        idx := anArray indexOf:Separator startingAt:2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1034
        idx == 0 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1035
            "/ not a valid history string
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1036
            ^ nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1037
        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1038
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1039
        idx ~~ 2 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1040
            what := (anArray copyFrom:2 to:(idx-1)) asStringWith:(Character space).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1041
            inst what:what.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1042
        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1043
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1044
        idx := idx + 1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1045
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1046
    aDate := self convertAStringToADate: (anArray at: idx).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1047
    inst date: aDate.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1048
    (anArray at:idx+1) ~= Separator ifTrue:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1049
    idx := idx + 2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1050
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1051
    aTime := self convertAStringToATime: (anArray at: idx).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1052
    inst time: aTime.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1053
    (anArray at:idx+1) ~= Separator ifTrue:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1054
    idx := idx + 2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1055
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1056
    "the user's name may be more that one word"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1057
    userName := (anArray copyFrom:idx) asStringWith:Character space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1058
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1059
    inst user:userName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1060
    inst firstPositionInSourceCode:position.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1061
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1062
    ^ inst
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1063
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1064
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1065
     HistoryLine fromString: 'Modified: 21.12.93 / 18:32:30 / R.Sailer'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1066
     HistoryLine fromString: 'Created: 21.12.1993 / 18:32:30 / Felicitas Gabriele Felger'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1067
     HistoryLine fromString: 'Deleted: 21.12.93 / 18:32:30 / Astrid Weißeise'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1068
     HistoryLine fromString: 'Deleted: foo bar / 21.12.93 / 18:32:30 / Astrid Weißeise'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1069
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1070
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1071
    "Modified: / 23.8.1995 / 22:24:47 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1072
    "Modified: / 19.9.1995 / 14:14:48 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1073
    "Modified: / 24.10.1997 / 02:10:01 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1074
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1075
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1076
new
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1077
    "get a new history line. 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1078
     Preinitialize it as a modified-Line for the current user"    
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1079
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1080
    ^ self type:ModifiedString what:nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1081
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1082
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1083
newCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1084
    "public - get a new created-Line for the current user"    
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1085
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1086
    ^ self type:CreatedString what:nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1087
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1088
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1089
     HistoryLine newCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1090
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1091
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1092
    "Modified: 23.8.1995 / 22:14:24 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1093
    "Modified: 24.10.1997 / 00:18:30 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1094
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1095
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1096
!HistoryManager::HistoryLine class methodsFor:'private'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1097
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1098
currentUserName
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1099
    "return the current users name - 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1100
     thats either the userInfos-gecos field, or the users login name."
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1101
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1102
    UseGECOS == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1103
        ^ OperatingSystem getFullUserName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1104
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1105
    ^ (OperatingSystem getLoginName).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1106
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1107
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1108
     HistoryLine currentUserName
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1109
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1110
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1111
    "Modified: 15.7.1996 / 12:43:14 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1112
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1113
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1114
type:type what:what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1115
    "private - for integration purposes only"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1116
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1117
    | inst |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1118
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1119
    inst := self basicNew.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1120
    inst date: Date today.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1121
    inst time: Time now.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1122
    inst firstPositionInSourceCode: 0.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1123
    inst user:(self currentUserName).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1124
    inst type:type.    
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1125
    inst what:what.    
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1126
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1127
    ^ inst
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1128
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1129
    "Modified: 23.08.1995 / 21:35:44 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1130
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1131
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1132
!HistoryManager::HistoryLine methodsFor:'accessing'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1133
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1134
date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1135
    "return the date"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1136
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1137
    ^ date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1138
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1139
    "Modified: 20.4.1996 / 20:22:12 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1140
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1141
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1142
date:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1143
    "set the date"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1144
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1145
    date := something.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1146
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1147
    "Modified: 20.4.1996 / 20:22:16 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1148
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1149
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1150
firstPositionInSourceCode
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1151
    "return firstPositionInSourceCode"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1152
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1153
    ^ firstPositionInSourceCode!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1154
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1155
firstPositionInSourceCode:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1156
    "set firstPositionInSourceCode"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1157
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1158
    firstPositionInSourceCode := something.!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1159
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1160
isForAddition
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1161
    type := AddedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1162
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1163
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1164
isForCreation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1165
    type := CreatedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1166
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1167
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1168
isForDeletion
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1169
    type := DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1170
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1171
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1172
isForModification
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1173
    type := ModifiedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1174
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1175
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1176
time
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1177
    "return the time"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1178
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1179
    ^ time
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1180
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1181
    "Modified: 20.4.1996 / 20:22:04 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1182
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1183
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1184
time:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1185
    "set the time"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1186
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1187
    time := something.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1188
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1189
    "Modified: 20.4.1996 / 20:21:58 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1190
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1191
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1192
type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1193
    "return the type"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1194
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1195
    ^ type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1196
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1197
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1198
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1199
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1200
type:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1201
    "set the type"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1202
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1203
    type := something.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1204
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1205
    "Modified: 20.4.1996 / 20:21:39 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1206
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1207
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1208
user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1209
    "return the user"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1210
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1211
    ^ user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1212
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1213
    "Modified: 20.4.1996 / 20:21:45 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1214
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1215
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1216
user:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1217
    "set the user"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1218
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1219
    user := something.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1220
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1221
    "Modified: 20.4.1996 / 20:21:48 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1222
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1223
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1224
what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1225
    "return the what-changed info"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1226
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1227
    ^ what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1228
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1229
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1230
    "Created: 24.10.1997 / 00:20:33 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1231
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1232
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1233
what:someStringOrSelector
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1234
    "set the what-changed info"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1235
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1236
    what := someStringOrSelector
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1237
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1238
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1239
    "Created: 24.10.1997 / 00:21:00 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1240
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1241
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1242
!HistoryManager::HistoryLine methodsFor:'comparing'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1243
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1244
= aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1245
    "compares two instances of HistoryLine"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1246
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1247
    (aHistoryLine user = self user) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1248
        (aHistoryLine date = self date) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1249
            (aHistoryLine time = self time) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1250
                (aHistoryLine type = self type) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1251
                    (aHistoryLine what = self what) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1252
                        ^ true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1253
                    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1254
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1255
            ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1256
        ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1257
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1258
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1259
    ^ false
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1260
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1261
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1262
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1263
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1264
    h1 := HistoryLine for: OperatingSystem getLoginName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1265
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1266
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1267
    h1 = h2 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1268
        InfoBox new title: 'users are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1269
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1270
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1271
    h2 := HistoryLine for: OperatingSystem getLoginName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1272
    h1 = h2 ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1273
        InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1274
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1275
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1276
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1277
    "Modified: 23.8.1995 / 22:26:40 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1278
    "Modified: 24.10.1997 / 00:22:09 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1279
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1280
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1281
hash
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1282
    "return a hash key for the receiver"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1283
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1284
    ^user hash        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1285
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1286
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1287
    Check hashCode
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1288
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1289
    |h1 h2 oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1290
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1291
    h1 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1292
    h2 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1293
    oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1294
    oc add: h1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1295
    oc add: h2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1296
    ^oc
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1297
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1298
    using hash in a set:
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1299
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1300
    | h1 h2 aSet oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1301
    h1 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1302
    h2 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1303
    oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1304
    oc add: h1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1305
    oc add: h2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1306
    aSet := oc asSet.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1307
    ^aSet
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1308
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1309
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1310
    "Modified: 23.08.1995 / 22:26:44 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1311
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1312
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1313
sameDate: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1314
    "returns true if aUserName = user in preperation for a SortedCollection of HistoryLines"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1315
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1316
    ^aHistoryLine date = date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1317
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1318
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1319
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1320
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1321
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1322
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1323
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1324
    (h1 sameDate: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1325
	InfoBox new title: 'Dates are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1326
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1327
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1328
    h2 := HistoryLine for: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1329
    h2 date: (Date day: 12 month: 6 year:1981).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1330
    (h1 sameDate: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1331
	InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1332
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1333
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1334
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1335
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1336
    "Modified: 23.08.1995 / 22:26:47 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1337
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1338
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1339
sameType: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1340
    "returns true if the Type = type in preperation for a SortedCollection of HistoryLines"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1341
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1342
    ^aHistoryLine type = type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1343
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1344
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1345
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1346
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1347
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1348
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1349
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1350
    (h1 sameType: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1351
	InfoBox new title: 'Types are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1352
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1353
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1354
    h2 := HistoryLine createdBy: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1355
    (h1 sameType: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1356
	InfoBox new title: 'Types are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1357
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1358
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1359
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1360
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1361
    "Modified: 23.08.1995 / 22:26:49 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1362
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1363
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1364
sameUser: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1365
    "returns true if aUserName = user in preperation for a SortedCollection of HistoryLines"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1366
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1367
    ^aHistoryLine user = user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1368
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1369
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1370
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1371
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1372
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1373
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1374
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1375
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1376
    (h1 sameUser: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1377
	InfoBox new title: 'users are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1378
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1379
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1380
    h2 := HistoryLine for: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1381
    (h1 sameUser: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1382
	InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1383
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1384
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1385
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1386
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1387
    "Modified: 23.08.1995 / 22:26:51 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1388
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1389
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1390
sameWhat: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1391
    "returns true if the what = type in preperation for a SortedCollection of HistoryLines"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1392
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1393
    ^aHistoryLine what = what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1394
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1395
    "Created: 24.10.1997 / 00:21:46 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1396
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1397
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1398
!HistoryManager::HistoryLine methodsFor:'printing & storing'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1399
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1400
printOn:aStream
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1401
    "return a printed representation of a HistoryLine as a string"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1402
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1403
    aStream nextPutAll:IndentString.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1404
    aStream nextPutAll:Quote.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1405
    aStream nextPutAll:type.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1406
    what notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1407
        aStream space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1408
        aStream nextPutAll:what.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1409
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1410
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1411
    aStream nextPutAll:(date printFormat:#(1 2 3 $. 1 1)).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1412
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1413
    time print24HourFormatOn:aStream. 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1414
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1415
    aStream nextPutAll:user.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1416
    aStream nextPutAll:Quote.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1417
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1418
    "
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1419
     self new printOn:Transcript
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1420
    "
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1421
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1422
    "Modified: / 24.10.1997 / 02:07:23 / cg"
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1423
    "Modified: / 20.1.1998 / 12:58:53 / stefan"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1424
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1425
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1426
!HistoryManager::HistoryLine methodsFor:'queries'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1427
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1428
isCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1429
    "returns true if the bodytext is CreatedString"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1430
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1431
    ^type = CreatedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1432
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1433
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1434
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1435
        HistoryLine new isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1436
        (HistoryLine for: 'R.Sailer') isCreated 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1437
        (HistoryLine createdBy: 'R.Sailer') isCreated 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1438
        HistoryLine deleted isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1439
        (HistoryLine deletedBy: 'M.Noell') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1440
        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1441
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1442
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1443
    "Modified: 23.8.1995 / 22:30:23 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1444
    "Modified: 20.4.1996 / 20:20:36 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1445
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1446
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1447
isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1448
    "returns true if the bodytext is DeletedString"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1449
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1450
    ^type = DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1451
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1452
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1453
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1454
        HistoryLine deleted isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1455
        HistoryLine new isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1456
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1457
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1458
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1459
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1460
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1461
    "Modified: 20.4.1996 / 20:20:32 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1462
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1463
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1464
isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1465
    "returns true if the bodytext is ModifiedString"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1466
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1467
    ^type = ModifiedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1468
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1469
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1470
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1471
        HistoryLine new isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1472
        (HistoryLine for: 'R.Sailer') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1473
        HistoryLine deleted isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1474
        (HistoryLine deletedBy: 'M.Noell') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1475
        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1476
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1477
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1478
    "Modified: 20.4.1996 / 20:20:29 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1479
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1480
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
  1481
!HistoryManager class methodsFor:'documentation'!
119
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1482
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1483
version
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
  1484
    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.46 2000-08-22 19:57:33 cg Exp $'
119
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1485
! !
41
claus
parents:
diff changeset
  1486
HistoryManager initialize!