HistoryManager.st
author Claus Gittinger <cg@exept.de>
Mon, 09 Nov 1998 21:38:01 +0100
changeset 728 501a0a757440
parent 690 44eb8ffe27b9
child 739 00043008b63c
permissions -rw-r--r--
oops - changedClass was never set in #definition-change
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
120
950e4628d657 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 119
diff changeset
    14
Object subclass:#HistoryManager
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    15
	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
    16
	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
    17
	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
    18
	category:'System-Changes-History'
41
claus
parents:
diff changeset
    19
!
claus
parents:
diff changeset
    20
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    21
Object subclass:#HistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    22
	instanceVariableNames:'date time user what firstPositionInSourceCode type'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    23
	classVariableNames:'Quote Separator ModifiedString DeletedString IndentString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    24
		UseGECOS CreatedString AddedString'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    25
	poolDictionaries:''
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    26
	privateIn:HistoryManager
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    27
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    28
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    29
!HistoryManager class methodsFor:'documentation'!
41
claus
parents:
diff changeset
    30
46
claus
parents: 43
diff changeset
    31
copyright 
claus
parents: 43
diff changeset
    32
"
claus
parents: 43
diff changeset
    33
 COPYRIGHT (c) 1995 by AEG Industry Automation
claus
parents: 43
diff changeset
    34
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents: 43
diff changeset
    35
	      All Rights Reserved
claus
parents: 43
diff changeset
    36
claus
parents: 43
diff changeset
    37
 This software is furnished under a license and may be used
claus
parents: 43
diff changeset
    38
 only in accordance with the terms of that license and with the
claus
parents: 43
diff changeset
    39
 inclusion of the above copyright notice.   This software may not
claus
parents: 43
diff changeset
    40
 be provided or otherwise made available to, or used by, any
claus
parents: 43
diff changeset
    41
 other person.  No title to or ownership of the software is
claus
parents: 43
diff changeset
    42
 hereby transferred.
claus
parents: 43
diff changeset
    43
"
claus
parents: 43
diff changeset
    44
!
claus
parents: 43
diff changeset
    45
41
claus
parents:
diff changeset
    46
documentation
claus
parents:
diff changeset
    47
"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    48
    This class is part of the HistoryManagerProject.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    49
    It helps to keep track of changes made to methods.
41
claus
parents:
diff changeset
    50
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    51
    All Methods and Classes in the system get a HistroyLine which 
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    52
    contains a timestamp and the name of the changing user. 
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    53
    This is acually the UniX loginname.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    54
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    55
    The Manager registers itself to get notifications 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    56
    on change, intercepts them and appends a historyLine to the methods
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    57
    code.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    58
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    59
    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
    60
    or via the Launcher menu.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    61
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    62
    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
    63
    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
    64
    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
    65
    every change (containing every change).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    66
    Full mode is enabled via:
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    67
        HistoryManager fullHistoryUpdate:true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    68
    or via the Launchers compilation-settings dialog.
41
claus
parents:
diff changeset
    69
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    70
    claus:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    71
        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
    72
        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
    73
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
    74
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
    75
        Robert Sailer - AEG
243
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    76
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    77
    [see also:]
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    78
        HistoryLine
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    79
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    80
    [start with:]
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    81
         HistoryManager activate
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    82
         HistoryManager deactivate
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    83
41
claus
parents:
diff changeset
    84
"
claus
parents:
diff changeset
    85
! !
claus
parents:
diff changeset
    86
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    87
!HistoryManager class methodsFor:'initialization'!
41
claus
parents:
diff changeset
    88
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    89
initMe
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    90
    "setup theOneAndOnly instance of myself (if not already present"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    91
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    92
    ^self new.
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    93
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    94
    "Modified: 14.8.1995 / 09:02:00 / robert"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    95
    "Modified: 20.4.1996 / 20:33:44 / cg"
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    96
!
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    97
41
claus
parents:
diff changeset
    98
initialize
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    99
    "add myself as a dependent of ObjectMemory to be told about image restarts"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   100
41
claus
parents:
diff changeset
   101
    ObjectMemory addDependent: self.
claus
parents:
diff changeset
   102
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   103
    "Modified: 14.8.1995 / 09:09:06 / robert"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   104
    "Modified: 20.4.1996 / 20:34:09 / cg"
41
claus
parents:
diff changeset
   105
! !
claus
parents:
diff changeset
   106
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   107
!HistoryManager class methodsFor:'instance creation'!
41
claus
parents:
diff changeset
   108
claus
parents:
diff changeset
   109
new
46
claus
parents: 43
diff changeset
   110
    "because there can be only ONE HistoryManager, new must me redefiend"
41
claus
parents:
diff changeset
   111
claus
parents:
diff changeset
   112
    TheOneAndOnlyInstance isNil ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   113
        TheOneAndOnlyInstance := super new initialize.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   114
        HistoryLine initialize.
41
claus
parents:
diff changeset
   115
    ].
claus
parents:
diff changeset
   116
claus
parents:
diff changeset
   117
   ^ TheOneAndOnlyInstance
claus
parents:
diff changeset
   118
claus
parents:
diff changeset
   119
"
claus
parents:
diff changeset
   120
claus
parents:
diff changeset
   121
    HistoryManager new.
claus
parents:
diff changeset
   122
"
claus
parents:
diff changeset
   123
claus
parents:
diff changeset
   124
    "Modified: 11.08.1995 / 17:01:29 / robert"
claus
parents:
diff changeset
   125
! !
claus
parents:
diff changeset
   126
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   127
!HistoryManager class methodsFor:'accessing'!
41
claus
parents:
diff changeset
   128
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   129
fullHistoryUpdate
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   130
    "return true, if the historyManagement does full updates"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   131
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   132
    TheOneAndOnlyInstance isNil ifTrue:[^ false].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   133
    ^ TheOneAndOnlyInstance fullHistoryUpdate
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   134
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   135
    "Modified: / 27.8.1995 / 00:32:12 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   136
    "Created: / 24.10.1997 / 02:24:34 / cg"
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   137
    "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
   138
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   139
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   140
fullHistoryUpdate:aBoolean
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   141
    "set/clear, full updates"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   142
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   143
    TheOneAndOnlyInstance isNil ifTrue:[^ self].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   144
    TheOneAndOnlyInstance fullHistoryUpdate:aBoolean
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   145
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   146
    "Modified: / 27.8.1995 / 00:32:12 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   147
    "Created: / 24.10.1997 / 02:24:58 / cg"
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   148
    "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
   149
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   150
41
claus
parents:
diff changeset
   151
instance
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   152
    "return the one and only historyManager instance"
41
claus
parents:
diff changeset
   153
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   154
    ^ TheOneAndOnlyInstance
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   155
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   156
    "Modified: 20.4.1996 / 20:31:18 / cg"
41
claus
parents:
diff changeset
   157
!
claus
parents:
diff changeset
   158
claus
parents:
diff changeset
   159
isActive 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   160
    "return true, if the historyManagement is activated"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   161
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   162
    ^ TheOneAndOnlyInstance notNil
41
claus
parents:
diff changeset
   163
claus
parents:
diff changeset
   164
    "Modified: 27.8.1995 / 00:32:12 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   165
    "Modified: 20.4.1996 / 20:31:32 / cg"
41
claus
parents:
diff changeset
   166
! !
claus
parents:
diff changeset
   167
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   168
!HistoryManager class methodsFor:'activation / deactivation'!
41
claus
parents:
diff changeset
   169
claus
parents:
diff changeset
   170
activate
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   171
    "activate the HistoryManagement"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   172
41
claus
parents:
diff changeset
   173
    self new   "/ creating an instance activates me
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   174
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   175
    "
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   176
     HistoryManager activate
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   177
    "
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   178
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   179
    "Modified: 20.4.1996 / 20:31:46 / cg"
41
claus
parents:
diff changeset
   180
!
claus
parents:
diff changeset
   181
claus
parents:
diff changeset
   182
deactivate
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   183
    "deactivate the HistoryManagement"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   184
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   185
    |mgr|
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   186
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   187
    mgr := TheOneAndOnlyInstance.
532
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   188
    mgr notNil ifTrue:[
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   189
        mgr releaseDependencies.
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   190
    ].
41
claus
parents:
diff changeset
   191
    TheOneAndOnlyInstance := nil.
claus
parents:
diff changeset
   192
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   193
    "
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   194
     HistoryManager deactivate
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   195
    "
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   196
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   197
    "Modified: 8.1.1997 / 23:09:08 / cg"
41
claus
parents:
diff changeset
   198
! !
claus
parents:
diff changeset
   199
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   200
!HistoryManager class methodsFor:'change & update'!
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   201
320
661e503430ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
   202
update:what with:aParameter from:changedObject
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   203
    "intercepts system restart - reinstall mySelf as dependent of all classes"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   204
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   205
    (what == #restarted) ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   206
        TheOneAndOnlyInstance notNil ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   207
            "
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   208
             smalltalk is about to restart from an Image -
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   209
            "
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   210
"/            'HistoryManager initialize (via update)' infoPrintNL.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   211
            self initMe.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   212
        ]
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   213
    ].
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   214
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   215
    "Modified: 27.8.1995 / 16:33:02 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   216
    "Modified: 20.4.1996 / 20:33:02 / cg"
320
661e503430ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
   217
    "Created: 15.6.1996 / 15:25:53 / cg"
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   218
! !
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   219
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   220
!HistoryManager class methodsFor:'helpers'!
47
claus
parents: 46
diff changeset
   221
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   222
createInitialHistoryMethodIn:aClass
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   223
    "create an initial (empty) history method"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   224
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   225
    |histStream|
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 := '' writeStream.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   228
    histStream nextPutLine:'history'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   229
    histStream nextPutLine:(HistoryLine newCreated printString).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   230
    Compiler 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   231
        compile:(histStream contents)
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   232
        forClass:aClass 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   233
        inCategory:'documentation'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   234
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   235
    "Created: / 24.10.1997 / 02:41:43 / cg"
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
47
claus
parents: 46
diff changeset
   238
getAllHistoriesFrom:someString
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   239
    "returns anArray of HistoryLines from a string.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   240
     Usually, the argument is a methods source code."
47
claus
parents: 46
diff changeset
   241
claus
parents: 46
diff changeset
   242
    |position aReadWriteStream firstFound nextFound  aHistoryString rcOC h|
claus
parents: 46
diff changeset
   243
claus
parents: 46
diff changeset
   244
    "read begining from the end and look there for the first comment character. If there's none return"
claus
parents: 46
diff changeset
   245
claus
parents: 46
diff changeset
   246
    rcOC := OrderedCollection new.
claus
parents: 46
diff changeset
   247
    position := someString size.
claus
parents: 46
diff changeset
   248
    firstFound := false.
claus
parents: 46
diff changeset
   249
    nextFound := false.
claus
parents: 46
diff changeset
   250
claus
parents: 46
diff changeset
   251
    someString reverseDo:[ :aChar|
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   252
        position := position - 1.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   253
        aChar == $" ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   254
            firstFound ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   255
                firstFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   256
                nextFound := true.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   257
            ] ifFalse:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   258
                aReadWriteStream := ReadWriteStream on: String new.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   259
                firstFound := true.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   260
                nextFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   261
            ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   262
        ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   263
        (firstFound and: [nextFound not]) ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   264
            "now collect all up to the next comment character"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   265
            aChar == $" ifFalse:[     
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   266
                aReadWriteStream nextPut: aChar.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   267
            ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   268
        ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   269
        nextFound ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   270
            "End reached - now try to make a HistoryLine"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   271
            aHistoryString := (aReadWriteStream contents) reverse.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   272
            "
258
bf9fd9ad4687 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   273
                Transcript showCR: aHistoryString.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   274
            "
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   275
            h := HistoryLine fromString: aHistoryString at: position.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   276
            h notNil ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   277
                rcOC add:h.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   278
            ].
47
claus
parents: 46
diff changeset
   279
"/            (aHistoryString startsWith: 'Modified:') ifTrue:[
claus
parents: 46
diff changeset
   280
"/                "a history line was found - now make a NewInstance of HistoryLine"
claus
parents: 46
diff changeset
   281
"/                rcOC add: ( HistoryLine fromString: aHistoryString at: position).
claus
parents: 46
diff changeset
   282
"/            ].
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   283
            nextFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   284
        ].
47
claus
parents: 46
diff changeset
   285
    ].
claus
parents: 46
diff changeset
   286
claus
parents: 46
diff changeset
   287
    ^rcOC reverse  "the OrderedCollection with HistoryLines in the right order"
claus
parents: 46
diff changeset
   288
claus
parents: 46
diff changeset
   289
    "Modified: 21.12.1993 / 18:32:30 / M.Noell"
claus
parents: 46
diff changeset
   290
    "Modified: 9.8.1995 / 22:45:30 / R.Sailer"
claus
parents: 46
diff changeset
   291
    "Modified: 8.9.1995 / 17:54:33 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   292
    "Modified: 20.4.1996 / 20:33:22 / cg"
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   293
!
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   294
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   295
withoutHistoryLines:someString
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   296
    "given some methods sourceString, return a copy without any
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   297
     history lines"
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   298
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   299
    | pos sourceCode previousHistories |
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   300
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   301
    someString isNil ifTrue:[^ someString].
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   302
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   303
    previousHistories := self getAllHistoriesFrom:someString.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   304
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   305
    "extract source body."
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   306
    previousHistories isEmpty ifTrue: [
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   307
        sourceCode := someString withoutSeparators.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   308
    ] ifFalse: [
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   309
        pos := (previousHistories first) firstPositionInSourceCode.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   310
        sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   311
    ].
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   312
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   313
    ^ sourceCode
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   314
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   315
    "
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   316
     HistoryManager withoutHistoryLines:nil  
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   317
     HistoryManager withoutHistoryLines:''  
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   318
     HistoryManager 
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   319
        withoutHistoryLines:(HistoryManager class 
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   320
                                compiledMethodAt:#withoutHistoryLines:) source
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   321
    "
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   322
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   323
    "Created: 5.3.1996 / 15:11:12 / cg"
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   324
    "Modified: 30.4.1996 / 10:57:35 / cg"
47
claus
parents: 46
diff changeset
   325
! !
claus
parents: 46
diff changeset
   326
41
claus
parents:
diff changeset
   327
!HistoryManager methodsFor:'accessing'!
claus
parents:
diff changeset
   328
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   329
fullHistoryUpdate
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   330
    "return the fullHistoryUpdate; 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   331
     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
   332
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   333
    ^ fullHistoryUpdate
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
    "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
   336
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   337
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   338
fullHistoryUpdate:aBoolean
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   339
    "set the fullHistoryUpdate; 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   340
     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
   341
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   342
    fullHistoryUpdate := aBoolean.
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
    "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
   345
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   346
41
claus
parents:
diff changeset
   347
historyMode
claus
parents:
diff changeset
   348
    "return historyMode"
claus
parents:
diff changeset
   349
claus
parents:
diff changeset
   350
    ^ historyMode
claus
parents:
diff changeset
   351
claus
parents:
diff changeset
   352
    "Modified: 11.08.1995 / 16:51:56 / robert"
claus
parents:
diff changeset
   353
!
claus
parents:
diff changeset
   354
claus
parents:
diff changeset
   355
historyMode:something
claus
parents:
diff changeset
   356
    "set historyMode"
claus
parents:
diff changeset
   357
claus
parents:
diff changeset
   358
    historyMode := something.
claus
parents:
diff changeset
   359
claus
parents:
diff changeset
   360
    "Modified: 11.08.1995 / 16:52:12 / robert"
claus
parents:
diff changeset
   361
! !
claus
parents:
diff changeset
   362
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   363
!HistoryManager methodsFor:'change & update'!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   364
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   365
update:something with:someArgument from:changedObject
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   366
    "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
   367
     (something contains aSymbol describing what happened)"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   368
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   369
    |sourceCode newMethod fileInOrRecompiling selector oldMethod what
597
d8b3b9622b39 dont crash if oldSource is not available.
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   370
     changedClass whatChange oldSource|
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   371
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   372
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   373
    "/ no action, if disabled
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
    historyMode ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   376
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   377
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   378
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
    "/ 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
   381
    "/ (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
   382
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   383
    fileInOrRecompiling := Class updateChangeFileQuerySignal raise.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   384
    fileInOrRecompiling ifFalse:[ 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   385
"/        Transcript showCR: '* noChange in history'. 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   386
        ^ self 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   387
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   388
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
     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
   391
    "
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   392
    (something == #definition) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   393
        "/ 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
   394
        "/ 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
   395
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   396
"/        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
   397
        fullHistoryUpdate == true ifTrue:[
728
501a0a757440 oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   398
            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
   399
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   400
        ^ self
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
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   403
    "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
   404
    (something == #classVariables) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   405
        "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   406
        "/ Transcript showCR: 'classVariables changed'.
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
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   409
        "/ does not yet work;
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   410
        "/ (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
   411
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   412
        fullHistoryUpdate == true ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   413
            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
   414
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   415
        ^ self
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
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
    "/ new Class creation
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
    ((changedObject == Smalltalk) and:[something == #newClass]) ifTrue:[
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
        "/  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
   424
        "/ 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   425
        fullHistoryUpdate == true ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   426
            self createHistoryMethodFor:someArgument.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   427
            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
   428
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   429
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   430
        "/ claus: old implementation
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
"/        someArgument addDependent: self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   433
"/        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
   434
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   435
        ^ self
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
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   438
    "/ changed methods
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   439
    "/ for backward compatibility, still handle the
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   440
    "/ classes own change notification.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   441
    "/ (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
   442
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   443
    changedObject isBehavior ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   444
        changedClass := changedObject.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   445
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   446
        something == #methodDictionary ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   447
            whatChange := #methodDictionary.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   448
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   449
            someArgument isArray ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   450
                selector := someArgument at:1.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   451
                oldMethod := someArgument at:2
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   452
            ] ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   453
                selector := someArgument
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   454
            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   455
        ].
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
        something == #methodInClassRemoved ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   458
            fullHistoryUpdate == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   459
                changedClass := someArgument at:1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   460
                selector := someArgument at:2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   461
                self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   462
            ].
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   463
            ^ self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   464
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   465
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   466
        something == #comment ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   467
            whatChange := #comment.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   468
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   469
    ].
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
    "/ 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
   472
    "/ Smalltalk, to get all method changes
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   473
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   474
    (changedObject == Smalltalk
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   475
    and:[something == #methodInClass]) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   476
        changedClass := someArgument at:1.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   477
        selector := someArgument at:2.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   478
        oldMethod := someArgument at:3.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   479
        whatChange := #methodDictionary.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   480
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   481
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   482
    changedClass notNil ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   483
        whatChange == #methodDictionary ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   484
            "/ ok; it is a changed method
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   485
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   486
            "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   487
            "/ fetch sourceString of the method
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
            sourceCode := changedClass sourceCodeAt:selector.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   490
            sourceCode isNil ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   491
                "method has been deleted"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   492
"/                Transcript showCR: 'method has been deleted'.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   493
                fullHistoryUpdate == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   494
                    self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   495
                ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   496
                ^ self.
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   499
            newMethod := changedClass compiledMethodAt:selector.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   500
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   501
            oldMethod notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   502
                oldSource := oldMethod source.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   503
                oldSource notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   504
                    (oldSource asString withTabsExpanded = sourceCode asString withTabsExpanded) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   505
                         "/ no change (accepted same code again ?)
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   506
                        ^ self
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   507
                    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   508
                ]
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
            "/ dont add historylines to documentation methods ...
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
            (changedClass isMeta not
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   515
            or:[newMethod category ~= 'documentation']) ifTrue:[
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   516
                oldMethod notNil ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   517
                    what := #modification
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   518
                ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   519
                    what := #creation
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   520
                ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   521
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   522
                "/
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   523
                "/ update the history line-comment in
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   524
                "/ the methods source
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   525
                "/
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   526
            
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   527
                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
   528
                newMethod source: sourceCode.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   529
"/                    Transcript showCR: 'history updated / added'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   530
            ].
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   531
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   532
            fullHistoryUpdate == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   533
                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
   534
            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   535
            ^self
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
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   538
        whatChange == #comment ifTrue:[
594
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   539
            "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
   540
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   541
            ^ self.
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
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   544
        whatChange == #classDefinition ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   545
            "/ 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
   546
            "/ 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
   547
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   548
"/            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
   549
            fullHistoryUpdate == true ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   550
                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
   551
            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   552
            ^self
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
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   555
"/    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
   556
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   557
    ^self
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
    "Modified: 27.8.1995 / 02:14:43 / claus"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   560
    "Modified: 24.10.1997 / 01:41:19 / cg"
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   561
! !
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   562
41
claus
parents:
diff changeset
   563
!HistoryManager methodsFor:'initialization'!
claus
parents:
diff changeset
   564
claus
parents:
diff changeset
   565
exclude
46
claus
parents: 43
diff changeset
   566
    "public - return an exclusionlist for some smalltalk classes which should not be notified or historisized"
41
claus
parents:
diff changeset
   567
claus
parents:
diff changeset
   568
    | oc |
claus
parents:
diff changeset
   569
        
claus
parents:
diff changeset
   570
    oc := OrderedCollection new.
claus
parents:
diff changeset
   571
    oc add: self.
claus
parents:
diff changeset
   572
claus
parents:
diff changeset
   573
    ^oc
claus
parents:
diff changeset
   574
claus
parents:
diff changeset
   575
    "Modified: 11.08.1995 / 17:02:18 / robert"
claus
parents:
diff changeset
   576
!
claus
parents:
diff changeset
   577
claus
parents:
diff changeset
   578
initialize
46
claus
parents: 43
diff changeset
   579
    "public - make me depend on all smalltalk classes (except the exclusionList)
claus
parents: 43
diff changeset
   580
     to be notified later about changes. This intercepts source installation and allows
claus
parents: 43
diff changeset
   581
     be to patch the source-string with a historyLine."
41
claus
parents:
diff changeset
   582
53
claus
parents: 48
diff changeset
   583
    |exclusionlist|
41
claus
parents:
diff changeset
   584
claus
parents:
diff changeset
   585
    super initialize.
claus
parents:
diff changeset
   586
    historyMode := true.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   587
    fullHistoryUpdate := false.
41
claus
parents:
diff changeset
   588
    exclusionlist := self exclude.
claus
parents:
diff changeset
   589
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   590
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   591
    "/ 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
   592
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   593
"/    Smalltalk allClassesDo:[:aClass|
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   594
"/        "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
   595
"/        "aClass = self " false ifFalse: [
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   596
"/            (exclusionlist includes: aClass) ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   597
"/                aClass addDependent: self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   598
"/                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
   599
"/            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   600
"/        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   601
"/    ].
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
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   604
    "/ Smalltalk also sends class-change notifications ...
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
    Smalltalk addDependent:self.
41
claus
parents:
diff changeset
   607
claus
parents:
diff changeset
   608
    ^self
claus
parents:
diff changeset
   609
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   610
    "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
   611
    "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
   612
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   613
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   614
releaseDependencies
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   615
    "no longer depend on class changes"
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
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   618
    "/ 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
   619
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   620
"/    Smalltalk allClassesDo:[:aClass |
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   621
"/        aClass removeDependent:self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   622
"/        aClass class removeDependent:self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   623
"/    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   624
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   625
    "/ new implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   626
    "/ Smalltalk also sends class-change notifications ...
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
    Smalltalk removeDependent:self.
41
claus
parents:
diff changeset
   629
! !
claus
parents:
diff changeset
   630
claus
parents:
diff changeset
   631
!HistoryManager methodsFor:'updateHistory'!
claus
parents:
diff changeset
   632
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   633
addHistory:what with:argument to:someString filter:doFilter
41
claus
parents:
diff changeset
   634
    "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
   635
     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
   636
     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
   637
     'Modified' or 'Created' lines."
41
claus
parents:
diff changeset
   638
53
claus
parents: 48
diff changeset
   639
    | histLines pos wStream sourceCode previousHistories
47
claus
parents: 46
diff changeset
   640
      newLine |
41
claus
parents:
diff changeset
   641
53
claus
parents: 48
diff changeset
   642
    "Check whether we want a history to be added"    
claus
parents: 48
diff changeset
   643
    historyMode ifFalse:[
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   644
        ^ someString
53
claus
parents: 48
diff changeset
   645
    ].
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   646
47
claus
parents: 46
diff changeset
   647
    previousHistories := self class getAllHistoriesFrom:someString.
41
claus
parents:
diff changeset
   648
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   649
    newLine := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   650
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   651
    what == #creation ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   652
        newLine isForCreation.
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   653
    ] ifFalse:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   654
        what == #deletion ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   655
            newLine isForDeletion.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   656
        ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   657
            what == #addition ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   658
                newLine isForAddition.
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 == #modification ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   661
                    newLine isForModification.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   662
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   663
            ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   664
        ]
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
    argument notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   667
        newLine what:argument
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   668
    ].
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   669
41
claus
parents:
diff changeset
   670
    "extract source body."
claus
parents:
diff changeset
   671
    previousHistories isEmpty ifTrue: [
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   672
        sourceCode := someString withoutSeparators.
41
claus
parents:
diff changeset
   673
    ] ifFalse: [
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   674
        pos := (previousHistories first) firstPositionInSourceCode.
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   675
        sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators.
41
claus
parents:
diff changeset
   676
    ].
claus
parents:
diff changeset
   677
claus
parents:
diff changeset
   678
    "add the actual user's historyLine."
47
claus
parents: 46
diff changeset
   679
    previousHistories add:newLine.
41
claus
parents:
diff changeset
   680
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   681
    doFilter ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   682
        "Filtering historyLines (each user with one entry)."
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   683
        histLines := HistoryLine filterHistoryLines: previousHistories.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   684
    ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   685
        histLines := previousHistories
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   686
    ].
41
claus
parents:
diff changeset
   687
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   688
    "create new method body with added historyLine"
41
claus
parents:
diff changeset
   689
    wStream := WriteStream on: String new.
claus
parents:
diff changeset
   690
    wStream nextPutAll: sourceCode; cr.
claus
parents:
diff changeset
   691
claus
parents:
diff changeset
   692
    "append the historyLines to the source"
claus
parents:
diff changeset
   693
    wStream cr.
claus
parents:
diff changeset
   694
    histLines do: [:hl |
512
d38e6339cddb use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 504
diff changeset
   695
       wStream nextPutLine:hl printString.
41
claus
parents:
diff changeset
   696
    ].
claus
parents:
diff changeset
   697
512
d38e6339cddb use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 504
diff changeset
   698
    ^ wStream contents.
41
claus
parents:
diff changeset
   699
47
claus
parents: 46
diff changeset
   700
    "Modified: 11.8.1995 / 16:51:50 / robert"
claus
parents: 46
diff changeset
   701
    "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
   702
    "Created: 24.10.1997 / 00:16:38 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   703
    "Modified: 24.10.1997 / 01:27:21 / cg"
41
claus
parents:
diff changeset
   704
!
claus
parents:
diff changeset
   705
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   706
addHistory:what with:arg toHistoryMethodOf:aClass
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   707
    "private - add a historyLine at end of the classes history methods
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   708
     source - if there is one"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   709
53
claus
parents: 48
diff changeset
   710
    |cls historyMethod oldSource newSource|
claus
parents: 48
diff changeset
   711
claus
parents: 48
diff changeset
   712
    aClass isMeta ifFalse:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   713
        cls := aClass class.
53
claus
parents: 48
diff changeset
   714
    ] ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   715
        cls := aClass
53
claus
parents: 48
diff changeset
   716
    ].
claus
parents: 48
diff changeset
   717
    historyMethod := cls compiledMethodAt: #history.
claus
parents: 48
diff changeset
   718
    historyMethod notNil ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   719
        oldSource := historyMethod source.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   720
        oldSource notNil ifTrue:[
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   721
            newSource := self 
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   722
                            addHistory:what
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   723
                            with:arg
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   724
                            to:oldSource
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   725
                            filter:false. 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   726
            historyMethod source:newSource.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   727
        ]
53
claus
parents: 48
diff changeset
   728
    ]
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
   729
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   730
    "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
   731
    "Modified: 24.10.1997 / 00:14:33 / cg"
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   732
!
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   733
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   734
createHistoryMethodFor:aClass
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   735
    "private - create a history method"
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
    |cls|
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   738
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   739
    aClass isMeta ifFalse:[
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   740
        cls := aClass class.
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   741
    ] ifTrue:[
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   742
        cls := aClass
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   743
    ].
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   744
497
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   745
    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
   746
        Compiler
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   747
            compile:'history' 
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   748
            forClass:cls 
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   749
            inCategory:'documentation'
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   750
    ].
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   751
497
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   752
    "Modified: 14.10.1996 / 16:58:20 / cg"
41
claus
parents:
diff changeset
   753
! !
claus
parents:
diff changeset
   754
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   755
!HistoryManager::HistoryLine class methodsFor:'converting'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   756
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   757
convertAStringToADate: aString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   758
   "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
   759
690
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   760
    | s day month year coll |
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   761
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   762
    "delete delimiter from the date string"
690
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   763
    s := aString copyReplaceAll: $. with:(Character space) .
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   764
    coll := s asArrayOfSubstrings.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   765
    day := (coll at: 1) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   766
    month := (coll at: 2 ) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   767
    year := (coll at: 3 ) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   768
690
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   769
    ^ Date newDay: day month: month year: year.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   770
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   771
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   772
     HistoryLine convertAStringToADate:'18.10.1995'
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   773
     HistoryLine convertAStringToADate:'18.10.95'
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
690
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   776
    "Modified: / 23.8.1995 / 21:28:58 / robert"
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   777
    "Modified: / 16.9.1997 / 14:35:03 / stefan"
44eb8ffe27b9 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   778
    "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
   779
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   780
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   781
convertAStringToATime: aString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   782
   "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
   783
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   784
    | h m s|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   785
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   786
    h := (aString copyFrom: 1 to: 2) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   787
    m := (aString copyFrom: 4 to: 5) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   788
    s := (aString copyFrom: 7 to: 8) asNumber.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   789
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   790
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   791
    ^Time hour:h  minutes: m seconds: s.        
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
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   794
     HistoryLine convertAStringToATime:'18:23:15' 
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
    "Modified: 15.08.1995 / 18:56:18 / robert"
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
!HistoryManager::HistoryLine class methodsFor:'documentation'!
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
copyright 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   803
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   804
 COPYRIGHT (c) 1995 by AEG Industry Automation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   805
 COPYRIGHT (c) 1995 by Claus Gittinger
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   806
	      All Rights Reserved
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   807
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   808
 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
   809
 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
   810
 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
   811
 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
   812
 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
   813
 hereby transferred.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   814
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   815
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   816
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   817
documentation
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
    The class HistoryLine is part of the HistoryManagerProjcet.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   820
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   821
    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
   822
    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
   823
    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
   824
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   825
    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
   826
    ST/X class delivery.
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
    [see also:]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   829
        HistoryManager
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
    [author:]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   832
        Robert Sailer - AEG
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
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   835
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   836
examples
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
    HistoryLine initialize.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   839
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   840
    HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   841
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   842
    HistoryLine for: 'R.Sailer'.    for integration purposes ONLY
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   843
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   844
    HistoryLine deleted.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   845
"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   848
version
728
501a0a757440 oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   849
    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.43 1998-11-09 20:38:01 cg Exp $'
624
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   852
!HistoryManager::HistoryLine class methodsFor:'filtering'!
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
filterHistoryLines:  aCollectionOfHistoryLines
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   855
    "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
   856
     and remove all but the youngest (per user)."
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   857
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   858
    |newCollection|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   859
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   860
    newCollection := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   861
    aCollectionOfHistoryLines keysAndValuesDo:[:index :histLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   862
        |skip|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   863
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   864
        skip := false.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   865
        histLine isModified ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   866
            "/ if there is another one, skip this
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   867
            aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   868
                anotherHistLine isModified ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   869
                    anotherHistLine user = histLine user ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   870
                        skip := true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   871
                    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   872
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   873
            ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   874
        ] ifFalse:[
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
            "/ filter out multiple created messages
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   877
            "/ (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
   878
            "/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   879
            histLine isCreated ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   880
                aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   881
                    anotherHistLine isCreated ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   882
                        skip := true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   883
                    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   884
                ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   885
            ].
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
        skip ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   888
            newCollection add:histLine.
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
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   891
    ^ newCollection.
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
"/    | allUsers newCollection aHistLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   894
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   895
"/    allUsers := Set new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   896
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   897
"/    anOrderdCollectionOfHistoryLines do:[ :hl| allUsers add: hl user ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   898
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   899
"/    allUsers size ~~ anOrderdCollectionOfHistoryLines ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   900
"/        "there is at least one user twice"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   901
"/        newCollection := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   902
"/        1 to: (anOrderdCollectionOfHistoryLines size - 1) do:[ :index|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   903
"/            aHistLine :=(anOrderdCollectionOfHistoryLines at: index).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   904
"/            allUsers last = aHistLine user ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   905
"/                newCollection add: aHistLine.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   906
"/            ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   907
"/        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   908
"/        "add the last element with the actucal HistoryLine"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   909
"/        newCollection add: anOrderdCollectionOfHistoryLines last.
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
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   912
"/        "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
   913
"/
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   914
"/        ^newCollection.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   915
"/    ].
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
"/    ^ anOrderdCollectionOfHistoryLines
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
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   921
     |u1 u2 u3 u4 u5 oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   922
     u1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   923
     u2 := HistoryLine for: 'claus'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   924
     u3 := HistoryLine for: 'chris'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   925
     u4 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   926
     u5 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   927
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   928
     oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   929
     oc add: u1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   930
     oc add: u2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   931
     oc add: u3.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   932
     oc add: u4.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   933
     oc add: u5.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   934
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   935
     oc inspect.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   936
     (HistoryLine filterHistoryLines: oc) inspect 
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   939
    "Modified: 8.9.1995 / 17:20:40 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   940
    "Modified: 20.4.1996 / 20:23:07 / cg"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   943
!HistoryManager::HistoryLine class methodsFor:'initialization'!
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
initialize
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   946
    "setup class variables"
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
    Quote isNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   949
        Quote := '"'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   950
        Separator := '/'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   951
        ModifiedString := 'Modified:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   952
        DeletedString := 'Deleted:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   953
        CreatedString := 'Created:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   954
        AddedString := 'Added:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   955
        IndentString := '    '.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   956
        UseGECOS := false.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   957
    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   958
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   959
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   960
     HistoryLine initialize
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
    "Modified: 23.8.1995 / 22:14:03 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   964
    "Modified: 20.4.1996 / 20:23:29 / cg"
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: 24.10.1997 / 01:18:56 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   967
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   968
    "Modified: / 24.10.1997 / 02:01:20 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   969
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   970
    "Modified:  24.10.1997  02:07:16  cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   971
! !
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
!HistoryManager::HistoryLine class methodsFor:'instance creation'!
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
fromString: aString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   976
    "parses the argument, aString; 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   977
     create & return a new Instance with the values" 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   978
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   979
    ^ self fromString: aString at: 0.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   980
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
     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
   983
     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
   984
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   985
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   986
    "Modified: 23.8.1995 / 22:14:13 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   987
    "Modified: 20.4.1996 / 20:24:47 / cg"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   990
fromString: aString at: position
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   991
    "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
   992
     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
   993
     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
   994
728
501a0a757440 oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   995
    | 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
   996
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   997
    inst := self basicNew.  
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   998
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   999
    anArray := aString asArrayOfSubstrings.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1000
    anArray size < 5 ifTrue:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1001
    anArray := anArray collect:[:word | word withoutSpaces].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1002
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1003
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1004
        Modified / Deleted / Created
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1005
        [what]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1006
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1007
        date asString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1008
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1009
        time asString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1010
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1011
        UserName ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1012
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1013
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1014
    type := anArray at:1.
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
    ((Array 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1017
        with:ModifiedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1018
        with:DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1019
        with:CreatedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1020
        with:AddedString) includes:type) ifFalse:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1021
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1022
    inst type:type.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1023
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1024
    "/ sigh backward compatibility ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1025
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1026
    (anArray at:2) first isDigit ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1027
        "/ date follows ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1028
        idx := 2
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1029
    ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1030
        idx := anArray indexOf:Separator startingAt:2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1031
        idx == 0 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1032
            "/ not a valid history string
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1033
            ^ nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1034
        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1035
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1036
        idx ~~ 2 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1037
            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
  1038
            inst what:what.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1039
        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1040
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1041
        idx := idx + 1.
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
    aDate := self convertAStringToADate: (anArray at: idx).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1044
    inst date: aDate.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1045
    (anArray at:idx+1) ~= Separator ifTrue:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1046
    idx := idx + 2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1047
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1048
    aTime := self convertAStringToATime: (anArray at: idx).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1049
    inst time: aTime.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1050
    (anArray at:idx+1) ~= Separator ifTrue:[^ nil].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1051
    idx := idx + 2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1052
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1053
    "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
  1054
    userName := (anArray copyFrom:idx) asStringWith:Character space.
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
    inst user:userName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1057
    inst firstPositionInSourceCode:position.
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1060
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
     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
  1063
     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
  1064
     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
  1065
     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
  1066
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1067
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1068
    "Modified: / 23.8.1995 / 22:24:47 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1069
    "Modified: / 19.9.1995 / 14:14:48 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1070
    "Modified: / 24.10.1997 / 02:10:01 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1071
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1072
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1073
new
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1074
    "get a new history line. 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1075
     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
  1076
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1077
    ^ self type:ModifiedString what:nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1078
!
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
newCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1081
    "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
  1082
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1083
    ^ self type:CreatedString what:nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1084
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
     HistoryLine newCreated
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
    "Modified: 23.8.1995 / 22:14:24 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1090
    "Modified: 24.10.1997 / 00:18:30 / cg"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1093
!HistoryManager::HistoryLine class methodsFor:'private'!
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
currentUserName
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1096
    "return the current users name - 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1097
     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
  1098
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1099
    UseGECOS == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1100
        ^ OperatingSystem getFullUserName.
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
    ^ (OperatingSystem getLoginName).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1103
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
     HistoryLine currentUserName
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
    "Modified: 15.7.1996 / 12:43:14 / cg"
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
type:type what:what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1112
    "private - for integration purposes only"
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
    | inst |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1115
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1116
    inst := self basicNew.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1117
    inst date: Date today.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1118
    inst time: Time now.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1119
    inst firstPositionInSourceCode: 0.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1120
    inst user:(self currentUserName).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1121
    inst type:type.    
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1122
    inst what:what.    
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1123
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1124
    ^ inst
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1125
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1126
    "Modified: 23.08.1995 / 21:35:44 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1127
! !
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
!HistoryManager::HistoryLine methodsFor:'accessing'!
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
date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1132
    "return the date"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1136
    "Modified: 20.4.1996 / 20:22:12 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1137
!
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
date:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1140
    "set the date"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1144
    "Modified: 20.4.1996 / 20:22:16 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1145
!
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
firstPositionInSourceCode
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1148
    "return firstPositionInSourceCode"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1152
firstPositionInSourceCode:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1153
    "set 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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1157
isForAddition
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1158
    type := AddedString
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1161
isForCreation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1162
    type := CreatedString
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1165
isForDeletion
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1166
    type := DeletedString
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1169
isForModification
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1170
    type := ModifiedString
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1173
time
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1174
    "return the time"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1178
    "Modified: 20.4.1996 / 20:22:04 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1179
!
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
time:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1182
    "set the time"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1186
    "Modified: 20.4.1996 / 20:21:58 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1187
!
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
type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1190
    "return the type"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1194
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1195
!
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
type:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1198
    "set the type"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1202
    "Modified: 20.4.1996 / 20:21:39 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1203
!
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
user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1206
    "return the user"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1210
    "Modified: 20.4.1996 / 20:21:45 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1211
!
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
user:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1214
    "set the user"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1218
    "Modified: 20.4.1996 / 20:21:48 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1219
!
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
what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1222
    "return the what-changed info"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1226
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1227
    "Created: 24.10.1997 / 00:20:33 / cg"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1230
what:someStringOrSelector
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1231
    "set the what-changed info"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1235
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1236
    "Created: 24.10.1997 / 00:21:00 / cg"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1239
!HistoryManager::HistoryLine methodsFor:'comparing'!
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
= aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1242
    "compares two instances of HistoryLine"
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 user = self user) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1245
        (aHistoryLine date = self date) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1246
            (aHistoryLine time = self time) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1247
                (aHistoryLine type = self type) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1248
                    (aHistoryLine what = self what) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1249
                        ^ true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1250
                    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1251
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1252
            ]
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
    ^ false
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
    | h1 h2 |
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
    h1 := HistoryLine for: OperatingSystem getLoginName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1262
    h2 := h1 copy.
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 = h2 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1265
        InfoBox new title: 'users are equal'; show.
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1268
    h2 := HistoryLine for: OperatingSystem getLoginName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1269
    h1 = h2 ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1270
        InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1271
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1272
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1273
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1274
    "Modified: 23.8.1995 / 22:26:40 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1275
    "Modified: 24.10.1997 / 00:22:09 / cg"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1278
hash
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1279
    "return a hash key for the receiver"
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
    ^user hash        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1282
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
    Check hashCode
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
    |h1 h2 oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1287
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1288
    h1 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1289
    h2 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1290
    oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1291
    oc add: h1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1292
    oc add: h2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1293
    ^oc
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1294
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1295
    using hash in a set:
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1296
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1297
    | h1 h2 aSet oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1298
    h1 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1299
    h2 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1300
    oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1301
    oc add: h1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1302
    oc add: h2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1303
    aSet := oc asSet.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1304
    ^aSet
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1305
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1306
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1307
    "Modified: 23.08.1995 / 22:26:44 / robert"
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
sameDate: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1311
    "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
  1312
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1313
    ^aHistoryLine date = date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1314
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
    | h1 h2 |
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
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1319
    h2 := h1 copy.
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 sameDate: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1322
	InfoBox new title: 'Dates are equal'; show.
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1325
    h2 := HistoryLine for: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1326
    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
  1327
    (h1 sameDate: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1328
	InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1329
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1330
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1331
"
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
    "Modified: 23.08.1995 / 22:26:47 / robert"
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
sameType: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1337
    "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
  1338
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1339
    ^aHistoryLine type = type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1340
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
    | h1 h2 |
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
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1345
    h2 := h1 copy.
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 sameType: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1348
	InfoBox new title: 'Types are equal'; show.
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1351
    h2 := HistoryLine createdBy: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1352
    (h1 sameType: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1353
	InfoBox new title: 'Types are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1354
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1355
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1356
"
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
    "Modified: 23.08.1995 / 22:26:49 / robert"
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
sameUser: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1362
    "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
  1363
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1364
    ^aHistoryLine user = user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1365
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
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1368
    | h1 h2 |
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
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1371
    h2 := h1 copy.
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 sameUser: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1374
	InfoBox new title: 'users are equal'; show.
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1377
    h2 := HistoryLine for: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1378
    (h1 sameUser: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1379
	InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1380
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1381
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1382
"
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
    "Modified: 23.08.1995 / 22:26:51 / robert"
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
sameWhat: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1388
    "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
  1389
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1390
    ^aHistoryLine what = what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1391
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1392
    "Created: 24.10.1997 / 00:21:46 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1393
! !
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
!HistoryManager::HistoryLine methodsFor:'printing & storing'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1396
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1397
printOn:aStream
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1398
    "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
  1399
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1400
    aStream nextPutAll:IndentString.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1401
    aStream nextPutAll:Quote.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1402
    aStream nextPutAll:type.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1403
    what notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1404
        aStream space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1405
        aStream nextPutAll:what.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1406
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1407
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1408
    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
  1409
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1410
    time print24HourFormatOn:aStream. 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1411
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1412
    aStream nextPutAll:user.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1413
    aStream nextPutAll:Quote.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1414
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1415
    "
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1416
     self new printOn:Transcript
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1417
    "
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1418
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1419
    "Modified: / 24.10.1997 / 02:07:23 / cg"
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1420
    "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
  1421
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1422
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1423
!HistoryManager::HistoryLine methodsFor:'queries'!
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
isCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1426
    "returns true if the bodytext is CreatedString"
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
    ^type = CreatedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1429
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1432
        HistoryLine new isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1433
        (HistoryLine for: 'R.Sailer') isCreated 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1434
        (HistoryLine createdBy: 'R.Sailer') isCreated 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1435
        HistoryLine deleted isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1436
        (HistoryLine deletedBy: 'M.Noell') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1437
        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1438
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1439
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1440
    "Modified: 23.8.1995 / 22:30:23 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1441
    "Modified: 20.4.1996 / 20:20:36 / cg"
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1444
isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1445
    "returns true if the bodytext is DeletedString"
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
    ^type = DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1448
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1451
        HistoryLine deleted isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1452
        HistoryLine new isDeleted
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1455
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
    "Modified: 20.4.1996 / 20:20:32 / cg"
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
isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1462
    "returns true if the bodytext is ModifiedString"
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
    ^type = ModifiedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1465
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1468
        HistoryLine new isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1469
        (HistoryLine for: 'R.Sailer') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1470
        HistoryLine deleted isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1471
        (HistoryLine deletedBy: 'M.Noell') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1472
        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1473
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1474
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1475
    "Modified: 20.4.1996 / 20:20:29 / cg"
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
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
  1478
!HistoryManager class methodsFor:'documentation'!
119
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1479
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1480
version
728
501a0a757440 oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
  1481
    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.43 1998-11-09 20:38:01 cg Exp $'
119
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1482
! !
41
claus
parents:
diff changeset
  1483
HistoryManager initialize!