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