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