HistoryManager.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 28 Mar 2013 12:22:48 +0000
branchjv
changeset 3158 f8c56a311307
parent 3128 87750af738dc
parent 2875 4fe2f4522753
child 3838 474d8ec95b33
permissions -rw-r--r--
Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
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'
2095
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    17
	classVariableNames:'TheOneAndOnlyInstance EnforcedUserName'
149
f7d66ab71259 filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
    18
	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
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
    25
		UseGECOS CreatedString AddedString EnforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
    26
		FormattedString CommentedString VariableRenamedString'
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    27
	poolDictionaries:''
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    28
	privateIn:HistoryManager
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    29
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    30
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    31
!HistoryManager class methodsFor:'documentation'!
41
claus
parents:
diff changeset
    32
46
claus
parents: 43
diff changeset
    33
copyright 
claus
parents: 43
diff changeset
    34
"
claus
parents: 43
diff changeset
    35
 COPYRIGHT (c) 1995 by AEG Industry Automation
claus
parents: 43
diff changeset
    36
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents: 43
diff changeset
    37
	      All Rights Reserved
claus
parents: 43
diff changeset
    38
claus
parents: 43
diff changeset
    39
 This software is furnished under a license and may be used
claus
parents: 43
diff changeset
    40
 only in accordance with the terms of that license and with the
claus
parents: 43
diff changeset
    41
 inclusion of the above copyright notice.   This software may not
claus
parents: 43
diff changeset
    42
 be provided or otherwise made available to, or used by, any
claus
parents: 43
diff changeset
    43
 other person.  No title to or ownership of the software is
claus
parents: 43
diff changeset
    44
 hereby transferred.
claus
parents: 43
diff changeset
    45
"
claus
parents: 43
diff changeset
    46
!
claus
parents: 43
diff changeset
    47
41
claus
parents:
diff changeset
    48
documentation
claus
parents:
diff changeset
    49
"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    50
    This class is part of the HistoryManagerProject.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    51
    It helps to keep track of changes made to methods.
41
claus
parents:
diff changeset
    52
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    53
    All Methods and Classes in the system get a HistroyLine which 
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    54
    contains a timestamp and the name of the changing user. 
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
    55
    This is acually the Unix loginname.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    56
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    57
    The Manager registers itself to get notifications 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    58
    on change, intercepts them and appends a historyLine to the methods
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    59
    code.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
    60
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    61
    The HistoryManager can be turned on/off from aprivate.rc script,
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    62
    or via the Launcher menu.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    63
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
    64
    The method's history line is filtered, to only contain one
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    65
    entry per modifying user, containing the date of the last change.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    66
    If fullHistoryMode is on, the classes history-ethod is also updated for
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    67
    every change (containing every change).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    68
    Full mode is enabled via:
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    69
        HistoryManager fullHistoryUpdate:true
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    70
    or via the Launchers compilation-settings dialog.
41
claus
parents:
diff changeset
    71
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    72
    claus:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    73
        I changed things to avoid depending on every class in the system.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    74
        Now also catch Smalltalk change messages, related to class changes.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
    75
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
    76
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 214
diff changeset
    77
        Robert Sailer - AEG
243
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    78
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    79
    [see also:]
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    80
        HistoryLine
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    81
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    82
    [start with:]
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    83
         HistoryManager activate
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    84
         HistoryManager deactivate
2d375fb526f6 examples
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    85
41
claus
parents:
diff changeset
    86
"
claus
parents:
diff changeset
    87
! !
claus
parents:
diff changeset
    88
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
    89
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    90
!HistoryManager class methodsFor:'initialization'!
41
claus
parents:
diff changeset
    91
2095
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    92
enforcedUserName
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    93
    ^ EnforcedUserName
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    94
!
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    95
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    96
enforcedUserName:aStringOrNil
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    97
    EnforcedUserName := aStringOrNil
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    98
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
    99
    "
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   100
     self enforcedUserName:'fm'
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   101
     self enforcedUserName:nil
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   102
    "
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   103
!
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
   104
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   105
initMe
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   106
    "setup theOneAndOnly instance of myself (if not already present"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   107
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   108
    ^self new.
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   109
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   110
    "Modified: 14.8.1995 / 09:02:00 / robert"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   111
    "Modified: 20.4.1996 / 20:33:44 / cg"
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   112
!
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   113
41
claus
parents:
diff changeset
   114
initialize
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   115
    "add myself as a dependent of ObjectMemory to be told about image restarts"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   116
41
claus
parents:
diff changeset
   117
    ObjectMemory addDependent: self.
claus
parents:
diff changeset
   118
1504
cfeab1ed934d no history update unless done by user
Claus Gittinger <cg@exept.de>
parents: 1495
diff changeset
   119
    "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
   120
    "Modified: / 05-07-2006 / 17:36:47 / cg"
41
claus
parents:
diff changeset
   121
! !
claus
parents:
diff changeset
   122
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   123
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   124
!HistoryManager class methodsFor:'instance creation'!
41
claus
parents:
diff changeset
   125
claus
parents:
diff changeset
   126
new
46
claus
parents: 43
diff changeset
   127
    "because there can be only ONE HistoryManager, new must me redefiend"
41
claus
parents:
diff changeset
   128
claus
parents:
diff changeset
   129
    TheOneAndOnlyInstance isNil ifTrue:[
2641
e15145843efe changed: #new
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   130
        TheOneAndOnlyInstance := self basicNew initialize.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   131
        HistoryLine initialize.
41
claus
parents:
diff changeset
   132
    ].
claus
parents:
diff changeset
   133
claus
parents:
diff changeset
   134
   ^ TheOneAndOnlyInstance
claus
parents:
diff changeset
   135
claus
parents:
diff changeset
   136
"
claus
parents:
diff changeset
   137
claus
parents:
diff changeset
   138
    HistoryManager new.
claus
parents:
diff changeset
   139
"
claus
parents:
diff changeset
   140
2641
e15145843efe changed: #new
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   141
    "Modified: / 11-08-1995 / 17:01:29 / robert"
e15145843efe changed: #new
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   142
    "Modified: / 04-12-2011 / 08:54:22 / cg"
41
claus
parents:
diff changeset
   143
! !
claus
parents:
diff changeset
   144
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   145
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   146
!HistoryManager class methodsFor:'accessing'!
41
claus
parents:
diff changeset
   147
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   148
fullHistoryUpdate
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   149
    "return true, if the historyManagement does full updates"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   150
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   151
    TheOneAndOnlyInstance isNil ifTrue:[^ false].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   152
    ^ TheOneAndOnlyInstance fullHistoryUpdate
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   153
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   154
    "Modified: / 27.8.1995 / 00:32:12 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   155
    "Created: / 24.10.1997 / 02:24:34 / cg"
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   156
    "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
   157
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   158
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   159
fullHistoryUpdate:aBoolean
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   160
    "set/clear, full updates"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   161
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   162
    TheOneAndOnlyInstance isNil ifTrue:[^ self].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   163
    TheOneAndOnlyInstance fullHistoryUpdate:aBoolean
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   164
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   165
    "Modified: / 27.8.1995 / 00:32:12 / claus"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   166
    "Created: / 24.10.1997 / 02:24:58 / cg"
626
2f5b65e11183 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   167
    "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
   168
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   169
41
claus
parents:
diff changeset
   170
instance
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   171
    "return the one and only historyManager instance"
41
claus
parents:
diff changeset
   172
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   173
    ^ TheOneAndOnlyInstance
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   174
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   175
    "Modified: 20.4.1996 / 20:31:18 / cg"
41
claus
parents:
diff changeset
   176
!
claus
parents:
diff changeset
   177
claus
parents:
diff changeset
   178
isActive 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   179
    "return true, if the historyManagement is activated"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   180
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   181
    ^ TheOneAndOnlyInstance notNil
41
claus
parents:
diff changeset
   182
claus
parents:
diff changeset
   183
    "Modified: 27.8.1995 / 00:32:12 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   184
    "Modified: 20.4.1996 / 20:31:32 / cg"
41
claus
parents:
diff changeset
   185
! !
claus
parents:
diff changeset
   186
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   187
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   188
!HistoryManager class methodsFor:'activation / deactivation'!
41
claus
parents:
diff changeset
   189
claus
parents:
diff changeset
   190
activate
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   191
    "activate the HistoryManagement"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   192
41
claus
parents:
diff changeset
   193
    self new   "/ creating an instance activates me
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
    "
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   196
     HistoryManager activate
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   197
    "
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   198
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   199
    "Modified: 20.4.1996 / 20:31:46 / cg"
41
claus
parents:
diff changeset
   200
!
claus
parents:
diff changeset
   201
claus
parents:
diff changeset
   202
deactivate
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   203
    "deactivate the HistoryManagement"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   204
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   205
    |mgr|
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   206
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   207
    mgr := TheOneAndOnlyInstance.
532
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   208
    mgr notNil ifTrue:[
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   209
        mgr releaseDependencies.
4595667ad448 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   210
    ].
41
claus
parents:
diff changeset
   211
    TheOneAndOnlyInstance := nil.
claus
parents:
diff changeset
   212
178
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   213
    "
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   214
     HistoryManager deactivate
daae23ef8c93 slight optimization
Claus Gittinger <cg@exept.de>
parents: 154
diff changeset
   215
    "
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   216
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   217
    "Modified: 8.1.1997 / 23:09:08 / cg"
41
claus
parents:
diff changeset
   218
! !
claus
parents:
diff changeset
   219
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   220
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   221
!HistoryManager class methodsFor:'change & update'!
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   222
320
661e503430ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
   223
update:what with:aParameter from:changedObject
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   224
    "intercepts system restart - reinstall mySelf as dependent of all classes"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   225
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   226
    (what == #restarted) ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   227
        TheOneAndOnlyInstance notNil ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   228
            "
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   229
             smalltalk is about to restart from an Image -
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   230
            "
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   231
"/            'HistoryManager initialize (via update)' infoPrintNL.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   232
            self initMe.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   233
        ]
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   234
    ].
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   235
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   236
    "Modified: 27.8.1995 / 16:33:02 / claus"
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   237
    "Modified: 20.4.1996 / 20:33:02 / cg"
320
661e503430ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
   238
    "Created: 15.6.1996 / 15:25:53 / cg"
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   239
! !
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   240
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   241
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
   242
!HistoryManager class methodsFor:'helpers'!
47
claus
parents: 46
diff changeset
   243
1386
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   244
codeForInitialHistoryMethodIn:aClass
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   245
    "create an initial (empty) history method"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   246
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   247
    |histStream|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   248
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   249
    histStream := '' writeStream.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   250
    histStream nextPutLine:'history'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   251
    histStream nextPutLine:(HistoryLine newCreated printString).
1386
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   252
    ^ histStream contents
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   253
!
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   254
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   255
createInitialHistoryMethodIn:aClass
2081
a2e06c2dea4e Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 2062
diff changeset
   256
    <resource: #obsolete>
1386
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   257
    "create an initial (empty) history method"
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   258
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   259
    self obsoleteMethodWarning.
2317
d62da5a37fc3 CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   260
    SmalltalkCodeGeneratorTool
1386
6d703c316472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1384
diff changeset
   261
        compile:(self codeForInitialHistoryMethodIn:aClass)
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   262
        forClass:aClass 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   263
        inCategory:'documentation'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   264
2317
d62da5a37fc3 CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   265
    "Created: / 24-10-1997 / 02:41:43 / cg"
d62da5a37fc3 CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   266
    "Modified: / 31-01-2011 / 18:28:51 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   267
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   268
47
claus
parents: 46
diff changeset
   269
getAllHistoriesFrom:someString
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   270
    "returns anArray of HistoryLines from a string.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   271
     Usually, the argument is a methods source code."
47
claus
parents: 46
diff changeset
   272
claus
parents: 46
diff changeset
   273
    |position aReadWriteStream firstFound nextFound  aHistoryString rcOC h|
claus
parents: 46
diff changeset
   274
2062
b2cfe78be5e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
   275
    rcOC := OrderedCollection new.
b2cfe78be5e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
   276
b2cfe78be5e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
   277
    someString isNil ifTrue:[
b2cfe78be5e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
   278
        ^ rcOC
b2cfe78be5e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
   279
    ].
b2cfe78be5e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
   280
47
claus
parents: 46
diff changeset
   281
    "read begining from the end and look there for the first comment character. If there's none return"
claus
parents: 46
diff changeset
   282
claus
parents: 46
diff changeset
   283
    position := someString size.
claus
parents: 46
diff changeset
   284
    firstFound := false.
claus
parents: 46
diff changeset
   285
    nextFound := false.
claus
parents: 46
diff changeset
   286
claus
parents: 46
diff changeset
   287
    someString reverseDo:[ :aChar|
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   288
        position := position - 1.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   289
        aChar == $" ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   290
            firstFound ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   291
                firstFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   292
                nextFound := true.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   293
            ] ifFalse:[
1807
035fbf03765b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1511
diff changeset
   294
                aReadWriteStream := ReadWriteStream on: (someString species) new.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   295
                firstFound := true.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   296
                nextFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   297
            ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   298
        ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   299
        (firstFound and: [nextFound not]) ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   300
            "now collect all up to the next comment character"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   301
            aChar == $" ifFalse:[     
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   302
                aReadWriteStream nextPut: aChar.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   303
            ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   304
        ].
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   305
        nextFound ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   306
            "End reached - now try to make a HistoryLine"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   307
            aHistoryString := (aReadWriteStream contents) reverse.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   308
            "
258
bf9fd9ad4687 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   309
                Transcript showCR: aHistoryString.
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   310
            "
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   311
            h := HistoryLine fromString: aHistoryString at: position.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   312
            h notNil ifTrue:[
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   313
                rcOC add:h.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   314
            ].
47
claus
parents: 46
diff changeset
   315
"/            (aHistoryString startsWith: 'Modified:') ifTrue:[
claus
parents: 46
diff changeset
   316
"/                "a history line was found - now make a NewInstance of HistoryLine"
claus
parents: 46
diff changeset
   317
"/                rcOC add: ( HistoryLine fromString: aHistoryString at: position).
claus
parents: 46
diff changeset
   318
"/            ].
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   319
            nextFound := false.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   320
        ].
47
claus
parents: 46
diff changeset
   321
    ].
claus
parents: 46
diff changeset
   322
claus
parents: 46
diff changeset
   323
    ^rcOC reverse  "the OrderedCollection with HistoryLines in the right order"
claus
parents: 46
diff changeset
   324
1807
035fbf03765b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1511
diff changeset
   325
    "Modified: / 21-12-1993 / 18:32:30 / M.Noell"
035fbf03765b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1511
diff changeset
   326
    "Modified: / 09-08-1995 / 22:45:30 / R.Sailer"
035fbf03765b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1511
diff changeset
   327
    "Modified: / 08-09-1995 / 17:54:33 / claus"
035fbf03765b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1511
diff changeset
   328
    "Modified: / 18-09-2006 / 20:48:19 / cg"
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   329
!
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   330
2102
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   331
getLastHistoryLineFrom:someString
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   332
    "returns the last HistoryLine, if no HistoryLine available, return nil"
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   333
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   334
    |hist|
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   335
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   336
    hist := self getAllHistoriesFrom: someString.
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   337
    hist isEmpty ifTrue: [ ^ nil].
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   338
    ^ hist last
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   339
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   340
    "Created: 19.1.1996 / 13:08:57 / werner"
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   341
!
c8a7c7f580a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
   342
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   343
withoutHistoryLines:someString
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   344
    "given some methods sourceString, return a copy without any
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   345
     history lines"
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   346
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   347
    | pos sourceCode previousHistories |
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   348
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   349
    someString isNil ifTrue:[^ someString].
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   350
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   351
    previousHistories := self getAllHistoriesFrom:someString.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   352
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   353
    "extract source body."
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   354
    previousHistories isEmpty ifTrue: [
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   355
        sourceCode := someString withoutSeparators.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   356
    ] ifFalse: [
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   357
        pos := (previousHistories first) firstPositionInSourceCode.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   358
        sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators.
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   359
    ].
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   360
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   361
    ^ sourceCode
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   362
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   363
    "
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   364
     HistoryManager withoutHistoryLines:nil  
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   365
     HistoryManager withoutHistoryLines:''  
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   366
     HistoryManager 
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   367
        withoutHistoryLines:(HistoryManager class 
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   368
                                compiledMethodAt:#withoutHistoryLines:) source
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   369
    "
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   370
192
dcd1e06e9727 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 178
diff changeset
   371
    "Created: 5.3.1996 / 15:11:12 / cg"
245
f475bf72217a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   372
    "Modified: 30.4.1996 / 10:57:35 / cg"
47
claus
parents: 46
diff changeset
   373
! !
claus
parents: 46
diff changeset
   374
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   375
2875
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   376
!HistoryManager class methodsFor:'others'!
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   377
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   378
version_CVS
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   379
    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.83 2012-07-31 12:31:47 vrany Exp $'
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   380
! !
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   381
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   382
41
claus
parents:
diff changeset
   383
!HistoryManager methodsFor:'accessing'!
claus
parents:
diff changeset
   384
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   385
fullHistoryUpdate
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   386
    "return the fullHistoryUpdate; 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   387
     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
   388
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   389
    ^ fullHistoryUpdate
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   390
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   391
    "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
   392
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   393
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   394
fullHistoryUpdate:aBoolean
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   395
    "set the fullHistoryUpdate; 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   396
     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
   397
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   398
    fullHistoryUpdate := aBoolean.
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
    "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
   401
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   402
41
claus
parents:
diff changeset
   403
historyMode
claus
parents:
diff changeset
   404
    "return historyMode"
claus
parents:
diff changeset
   405
claus
parents:
diff changeset
   406
    ^ historyMode
claus
parents:
diff changeset
   407
claus
parents:
diff changeset
   408
    "Modified: 11.08.1995 / 16:51:56 / robert"
claus
parents:
diff changeset
   409
!
claus
parents:
diff changeset
   410
claus
parents:
diff changeset
   411
historyMode:something
claus
parents:
diff changeset
   412
    "set historyMode"
claus
parents:
diff changeset
   413
claus
parents:
diff changeset
   414
    historyMode := something.
claus
parents:
diff changeset
   415
claus
parents:
diff changeset
   416
    "Modified: 11.08.1995 / 16:52:12 / robert"
claus
parents:
diff changeset
   417
! !
claus
parents:
diff changeset
   418
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   419
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   420
!HistoryManager methodsFor:'change & update'!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   421
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   422
update:something with:someArgument from:changedObject
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   423
    "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
   424
     (something contains aSymbol describing what happened)"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   425
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   426
    |selector oldMethod changedClass whatChange|
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   427
2467
ae4ca4708620 changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 2452
diff changeset
   428
    something == #methodCoverageInfo ifTrue:[^ self].
ae4ca4708620 changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 2452
diff changeset
   429
    something == #methodTrap ifTrue:[^ self].
ae4ca4708620 changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 2452
diff changeset
   430
531
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
    "/ no action, if disabled
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
    historyMode ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   435
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   436
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   437
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   438
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   439
    "/ 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
   440
    "/ (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
   441
    "/
1504
cfeab1ed934d no history update unless done by user
Claus Gittinger <cg@exept.de>
parents: 1495
diff changeset
   442
    (Class updateChangeFileQuerySignal query) ifFalse:[ 
cfeab1ed934d no history update unless done by user
Claus Gittinger <cg@exept.de>
parents: 1495
diff changeset
   443
"/        Transcript showCR: '* noChange in history'. 
cfeab1ed934d no history update unless done by user
Claus Gittinger <cg@exept.de>
parents: 1495
diff changeset
   444
        ^ self 
cfeab1ed934d no history update unless done by user
Claus Gittinger <cg@exept.de>
parents: 1495
diff changeset
   445
    ].
cfeab1ed934d no history update unless done by user
Claus Gittinger <cg@exept.de>
parents: 1495
diff changeset
   446
    Class updateHistoryLineQuerySignal query ifFalse:[ 
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   447
"/        Transcript showCR: '* noChange in history'. 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   448
        ^ self 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   449
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   450
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   451
    "                  
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   452
     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
   453
    "
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   454
    (something == #definition) ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   455
        "/ 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
   456
        "/ add a line to the history method; if present
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   457
        self updateAfterClassChange:'class definition' in:changedObject.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   458
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   459
    ].
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
    "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
   462
    (something == #classVariables) ifTrue:[
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   463
        self updateAfterClassChange:'class variables' in:changedObject.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   464
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   465
    ].    
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   466
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   467
    "/
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   468
    "/ new Class creation
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
    ((changedObject == Smalltalk) and:[something == #newClass]) ifTrue:[
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
        "/  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
   473
        "/ 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   474
        fullHistoryUpdate == true ifTrue:[
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   475
            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
   476
            self createHistoryMethodFor:someArgument.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   477
            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
   478
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   479
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   480
        "/ claus: old implementation
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   481
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   482
"/        someArgument addDependent: self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   483
"/        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
   484
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   485
        ^ self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   486
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   487
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   488
    "/ changed methods
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   489
    "/ for backward compatibility, still handle the
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   490
    "/ classes own change notification.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   491
    "/ (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
   492
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   493
    changedObject isBehavior ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   494
        changedClass := changedObject.
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   495
        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
   496
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   497
        something == #methodDictionary ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   498
            whatChange := #methodDictionary.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   499
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   500
            someArgument isArray ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   501
                selector := someArgument at:1.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   502
                oldMethod := someArgument at:2
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   503
            ] ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   504
                selector := someArgument
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
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   507
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   508
        something == #methodInClassRemoved ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   509
            fullHistoryUpdate == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   510
                changedClass := someArgument at:1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   511
                selector := someArgument at:2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   512
                self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   513
            ].
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   514
            ^ self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   515
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   516
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   517
        something == #comment ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   518
            whatChange := #comment.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   519
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   520
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   521
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   522
    "/ 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
   523
    "/ Smalltalk, to get all method changes
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   524
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   525
    (changedObject == Smalltalk and:[something == #methodInClass]) ifTrue:[
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   526
        changedClass := someArgument at:1.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   527
        selector := someArgument at:2.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   528
        oldMethod := someArgument at:3.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   529
        whatChange := #methodDictionary.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   530
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   532
    changedClass notNil ifTrue:[
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   533
        changedClass theMetaclass compilerClass == Compiler ifFalse:[^ self].
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   534
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   535
        whatChange == #methodDictionary ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   536
            "/ ok; it is a changed method
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   537
            self updateAfterMethodChange:selector from:oldMethod in:changedClass.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   538
            ^self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   539
        ]. 
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   540
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   541
        whatChange == #comment ifTrue:[
594
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   542
            "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
   543
            ^ self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   544
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   545
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   546
        whatChange == #classDefinition ifTrue:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   547
            "/ it is a class definition that has changed
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   548
            "/ add a line to the history method; if present
2467
ae4ca4708620 changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 2452
diff changeset
   549
            self updateAfterClassChange:'class definition' in:changedClass.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   550
            ^self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   551
        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   552
    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   553
"/    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
   554
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   555
    ^self
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   556
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   557
    "Created: / 30-06-2011 / 16:43:46 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   558
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   559
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   560
updateAfterClassChange:whatChange in:aClass 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   561
    "/ it is a class definition that has changed
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   562
    "/ add a line to the history method; if present
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   563
    "/        Transcript show: 'Class definition: ', changedClass printString;cr.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   564
    
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   565
    fullHistoryUpdate == true ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   566
        "/ check for the programming-language...
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   567
        aClass theMetaclass compilerClass == Compiler ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   568
            ^ self
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   569
        ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   570
        self 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   571
            addHistory:#modification
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   572
            with:whatChange
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   573
            toHistoryMethodOf:aClass.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   574
    ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   575
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   576
    "Modified (Format): / 30-06-2011 / 16:27:23 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   577
    "Created: / 30-06-2011 / 16:28:22 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   578
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   579
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   580
updateAfterMethodChange:selector from:oldMethod in:changedClass
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   581
    |newSource newSourceWithoutHistory newHistories newMethod newTree newComments
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   582
     oldSource oldSourceWithoutHistory oldHistories oldTree oldComments
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   583
     renamedVariables
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   584
     whatChange pos|
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   585
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   586
    changedClass theMetaclass compilerClass == Compiler ifFalse:[^ self].
2452
ec6efa0f7f16 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2435
diff changeset
   587
    (oldMethod notNil and:[oldMethod compilerClass ~~ Compiler]) ifTrue:[^ self].
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   588
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   589
    "/ ok; it is a changed method
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   590
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   591
    "/
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   592
    "/ fetch sourceString of the method
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   593
    "/
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   594
    newSource := changedClass sourceCodeAt:selector.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   595
    newSource isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   596
        "method has been deleted"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   597
"/                Transcript showCR: 'method has been deleted'.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   598
        fullHistoryUpdate == true ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   599
            self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   600
        ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   601
        ^ self.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   602
    ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   603
    newHistories := self class getAllHistoriesFrom:newSource.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   604
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   605
    newMethod := changedClass compiledMethodAt:selector.
2452
ec6efa0f7f16 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2435
diff changeset
   606
    newMethod compilerClass == Compiler ifFalse:[^ self].
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   607
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   608
    oldMethod isNil ifTrue:[
3089
f03ce272ea4e - HistoryManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3078
diff changeset
   609
        whatChange := #creation.
f03ce272ea4e - HistoryManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3078
diff changeset
   610
        newHistories := OrderedCollection new.
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   611
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   612
        whatChange := #modification.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   613
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   614
        oldSource := oldMethod source.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   615
        oldSource notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   616
            (oldSource asString withTabsExpanded = newSource asString withTabsExpanded) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   617
                 "/ no change (accepted same code again ?)
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   618
                ^ self
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   619
            ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   620
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   621
            oldHistories := self class getAllHistoriesFrom:oldSource.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   622
            oldHistories notEmptyOrNil ifTrue: [
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   623
                "/ compare source without history...
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   624
                pos := (oldHistories first) firstPositionInSourceCode.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   625
                oldSourceWithoutHistory := (oldSource copyFrom:1 to:pos - 1) withoutSeparators.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   626
            ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   627
                oldSourceWithoutHistory := oldSource
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   628
            ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   629
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   630
            newHistories notEmptyOrNil ifTrue: [
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   631
                "/ compare source without history...
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   632
                pos := (newHistories first) firstPositionInSourceCode.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   633
                newSourceWithoutHistory := (newSource copyFrom:1 to:pos - 1) withoutSeparators.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   634
            ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   635
                newSourceWithoutHistory := newSource
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   636
            ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   637
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   638
            (oldSourceWithoutHistory asString withTabsExpanded = newSourceWithoutHistory asString withTabsExpanded) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   639
                 "/ no change (except for history lines)
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   640
                UserPreferences current historyManagerAllowEditOfHistory ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   641
                    newMethod source: oldSource.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   642
                ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   643
                ^ self
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   644
            ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   645
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   646
            RBParser notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   647
                "/ same structure?
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   648
                oldTree := RBParser parseMethod:oldSourceWithoutHistory onError:[:aString :pos | nil].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   649
                newTree := RBParser parseMethod:newSourceWithoutHistory onError:[:aString :pos | nil].
2517
71374f69ec64 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2467
diff changeset
   650
                (oldTree notNil 
71374f69ec64 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2467
diff changeset
   651
                and:[newTree notNil
71374f69ec64 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2467
diff changeset
   652
                and:[oldTree equalTo:newTree withMapping:(renamedVariables := Dictionary new)]]) ifTrue:[
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   653
                    "/ only formatting?
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   654
                        (renamedVariables keysAndValuesSelect:[:k :v | k ~= v]) isEmpty ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   655
                        "/ only formatting...
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   656
                        whatChange := #formatted.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   657
                        oldComments := oldTree allComments.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   658
                        newComments := newTree allComments.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   659
                        (oldComments size ~= newComments size
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   660
                        or:[ oldComments with:newComments contains:[:ca :cb | ca characters ~= cb characters]]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   661
                            whatChange := #commented.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   662
                        ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   663
                    ] ifFalse:[
2423
a64020036dc3 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2405
diff changeset
   664
                        renamedVariables := renamedVariables associations select:[:assoc | assoc key ~= assoc value].
a64020036dc3 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2405
diff changeset
   665
                        "/ should figure out, if only local vars have been renamed;
a64020036dc3 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2405
diff changeset
   666
                        "/ could make it a nicer modified(var names) then
a64020036dc3 changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents: 2405
diff changeset
   667
                        "/ renamedVariables halt.    
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   668
                    ]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   669
                ]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   670
            ]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   671
        ]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   672
    ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   673
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   674
    "/
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   675
    "/ don't add historylines to documentation methods on the class side...
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   676
    "/
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   677
    (changedClass isMeta 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   678
    and:[newMethod category = 'documentation']) ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   679
        "/
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   680
        "/ update the history line-comment in
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   681
        "/ the methods source
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   682
        "/            
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   683
        newSource := self addHistory:whatChange with:nil to:oldHistories inSource:newSource filter:true.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   684
        newMethod source: newSource.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   685
        "/ Transcript showCR: 'history updated / added'.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   686
    ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   687
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   688
    fullHistoryUpdate == true ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   689
        self addHistory:whatChange with:('#' , selector) toHistoryMethodOf:changedClass.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   690
    ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   691
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   692
    "Created: / 30-06-2011 / 16:51:19 / cg"
3089
f03ce272ea4e - HistoryManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3078
diff changeset
   693
    "Modified: / 02-10-2012 / 13:22:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   694
! !
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   695
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   696
41
claus
parents:
diff changeset
   697
!HistoryManager methodsFor:'initialization'!
claus
parents:
diff changeset
   698
claus
parents:
diff changeset
   699
exclude
46
claus
parents: 43
diff changeset
   700
    "public - return an exclusionlist for some smalltalk classes which should not be notified or historisized"
41
claus
parents:
diff changeset
   701
claus
parents:
diff changeset
   702
    | oc |
claus
parents:
diff changeset
   703
        
claus
parents:
diff changeset
   704
    oc := OrderedCollection new.
claus
parents:
diff changeset
   705
    oc add: self.
claus
parents:
diff changeset
   706
claus
parents:
diff changeset
   707
    ^oc
claus
parents:
diff changeset
   708
claus
parents:
diff changeset
   709
    "Modified: 11.08.1995 / 17:02:18 / robert"
claus
parents:
diff changeset
   710
!
claus
parents:
diff changeset
   711
claus
parents:
diff changeset
   712
initialize
46
claus
parents: 43
diff changeset
   713
    "public - make me depend on all smalltalk classes (except the exclusionList)
claus
parents: 43
diff changeset
   714
     to be notified later about changes. This intercepts source installation and allows
claus
parents: 43
diff changeset
   715
     be to patch the source-string with a historyLine."
41
claus
parents:
diff changeset
   716
53
claus
parents: 48
diff changeset
   717
    |exclusionlist|
41
claus
parents:
diff changeset
   718
claus
parents:
diff changeset
   719
    super initialize.
claus
parents:
diff changeset
   720
    historyMode := true.
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   721
    fullHistoryUpdate := false.
41
claus
parents:
diff changeset
   722
    exclusionlist := self exclude.
claus
parents:
diff changeset
   723
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   724
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   725
    "/ 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
   726
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   727
"/    Smalltalk allClassesDo:[:aClass|
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   728
"/        "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
   729
"/        "aClass = self " false ifFalse: [
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   730
"/            (exclusionlist includes: aClass) ifFalse:[
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   731
"/                aClass addDependent: self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   732
"/                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
   733
"/            ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   734
"/        ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   735
"/    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   736
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   737
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   738
    "/ Smalltalk also sends class-change notifications ...
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   739
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   740
    Smalltalk addDependent:self.
41
claus
parents:
diff changeset
   741
claus
parents:
diff changeset
   742
    ^self
claus
parents:
diff changeset
   743
531
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   744
    "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
   745
    "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
   746
!
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   747
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   748
releaseDependencies
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   749
    "no longer depend on class changes"
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   750
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   751
    "/ old implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   752
    "/ 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
   753
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   754
"/    Smalltalk allClassesDo:[:aClass |
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   755
"/        aClass removeDependent:self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   756
"/        aClass class removeDependent:self.
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   757
"/    ].
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   758
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   759
    "/ new implementation:
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   760
    "/ Smalltalk also sends class-change notifications ...
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   761
b0d7a291474d changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   762
    Smalltalk removeDependent:self.
41
claus
parents:
diff changeset
   763
! !
claus
parents:
diff changeset
   764
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   765
41
claus
parents:
diff changeset
   766
!HistoryManager methodsFor:'updateHistory'!
claus
parents:
diff changeset
   767
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   768
addHistory:what with:argument to:someString filter:doFilter
41
claus
parents:
diff changeset
   769
    "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
   770
     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
   771
     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
   772
     'Modified' or 'Created' lines."
41
claus
parents:
diff changeset
   773
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   774
    |previousHistories|
41
claus
parents:
diff changeset
   775
53
claus
parents: 48
diff changeset
   776
    "Check whether we want a history to be added"    
claus
parents: 48
diff changeset
   777
    historyMode ifFalse:[
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   778
        ^ someString
53
claus
parents: 48
diff changeset
   779
    ].
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   780
47
claus
parents: 46
diff changeset
   781
    previousHistories := self class getAllHistoriesFrom:someString.
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   782
    ^ self addHistory:what with:argument to:previousHistories inSource:someString filter:doFilter
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   783
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   784
    "Modified: / 30-06-2011 / 16:54:27 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   785
    "Modified (Format): / 30-06-2011 / 18:17:58 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   786
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   787
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   788
addHistory:what with:argument to:previousHistories inSource:someString filter:doFilter
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   789
    "private - add a historyLine at end to the sourceCode;
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   790
     check for multiple lines of the same user and merge into one.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   791
     What may be one of #modification or #creation, to choose among
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   792
     'Modified' or 'Created' lines."
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   793
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   794
    |histories histLines pos wStream sourceCode newLine |
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   795
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   796
    "Check whether we want a history to be added"    
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   797
    historyMode ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   798
        ^ someString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   799
    ].
41
claus
parents:
diff changeset
   800
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   801
    newLine := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   802
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   803
    what == #creation ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   804
        newLine isForCreation.
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   805
    ] ifFalse:[ what == #deletion ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   806
        newLine isForDeletion.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   807
    ] ifFalse:[ what == #addition ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   808
        newLine isForAddition.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   809
    ] ifFalse:[ what == #modification ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   810
        newLine isForModification.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   811
    ] ifFalse:[ what == #formatted ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   812
        newLine isForFormatted.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   813
    ] ifFalse:[ what == #commented ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   814
        newLine isForCommented.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   815
    ] ifFalse:[ what == #variableRenamed ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   816
        newLine isForVariableRenamed
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   817
    ] ifFalse:[ 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   818
        self breakPoint:#cg
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   819
    ]]]]]]].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   820
    argument notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   821
        newLine what:argument
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   822
    ].
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   823
41
claus
parents:
diff changeset
   824
    "extract source body."
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   825
    histories := self class getAllHistoriesFrom:someString.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   826
    histories isEmpty ifTrue: [
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   827
        sourceCode := someString withoutSeparators.
41
claus
parents:
diff changeset
   828
    ] ifFalse: [
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   829
        pos := (histories first) firstPositionInSourceCode.
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   830
        sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators.
41
claus
parents:
diff changeset
   831
    ].
claus
parents:
diff changeset
   832
claus
parents:
diff changeset
   833
    "add the actual user's historyLine."
2875
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   834
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   835
    "JV@2012-04-03: Add previous histories if we are updating
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   836
     existing method (avoids having bogus entries when taking
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   837
     existing method as template and then accepting with a different
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   838
     selector and/or in a different class"
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   839
    what == #creation ifTrue:[
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   840
        histLines := OrderedCollection new.
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   841
    ] ifFalse:[
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   842
        histLines := (previousHistories ? histories).
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   843
    ].
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   844
    histLines add:newLine.
41
claus
parents:
diff changeset
   845
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   846
    doFilter ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   847
        "Filtering historyLines (each user with one entry)."
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   848
        histLines := HistoryLine filterHistoryLines: histLines.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   849
    ].
41
claus
parents:
diff changeset
   850
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   851
    "create new method body with added historyLine"
1807
035fbf03765b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1511
diff changeset
   852
    wStream := WriteStream on: (sourceCode species) new.
41
claus
parents:
diff changeset
   853
    wStream nextPutAll: sourceCode; cr.
claus
parents:
diff changeset
   854
claus
parents:
diff changeset
   855
    "append the historyLines to the source"
claus
parents:
diff changeset
   856
    wStream cr.
claus
parents:
diff changeset
   857
    histLines do: [:hl |
512
d38e6339cddb use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 504
diff changeset
   858
       wStream nextPutLine:hl printString.
41
claus
parents:
diff changeset
   859
    ].
claus
parents:
diff changeset
   860
512
d38e6339cddb use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 504
diff changeset
   861
    ^ wStream contents.
41
claus
parents:
diff changeset
   862
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   863
    "Modified: / 30-06-2011 / 17:07:18 / cg"
2875
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   864
    "Modified: / 03-04-2012 / 16:35:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
   865
    "Modified (comment): / 31-07-2012 / 13:31:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41
claus
parents:
diff changeset
   866
!
claus
parents:
diff changeset
   867
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   868
addHistory:what with:arg toHistoryMethodOf:aClass
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   869
    "private - add a historyLine at end of the classes history methods
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   870
     source - if there is one"
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   871
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   872
    |meta historyMethod oldSource newSource|
53
claus
parents: 48
diff changeset
   873
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   874
    meta := aClass theMetaclass.
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   875
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   876
    historyMethod := meta compiledMethodAt: #history.
53
claus
parents: 48
diff changeset
   877
    historyMethod notNil ifTrue:[
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   878
        oldSource := historyMethod source.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   879
        oldSource notNil ifTrue:[
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   880
            newSource := self 
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   881
                            addHistory:what
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   882
                            with:arg
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   883
                            to:oldSource
1397
3c62fc69c1ca enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1386
diff changeset
   884
                            filter:true. 
214
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   885
            historyMethod source:newSource.
f1220f2a24f7 commentary
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   886
        ]
53
claus
parents: 48
diff changeset
   887
    ]
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
   888
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   889
    "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
   890
    "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
   891
    "Modified: / 13-07-2006 / 17:42:03 / cg"
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   892
!
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   893
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   894
createHistoryMethodFor:aClass
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   895
    "private - create a history method"
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   896
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   897
    |meta|
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   898
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   899
    meta := aClass theMetaclass.
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   900
1413
b9087201c7aa Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 1398
diff changeset
   901
    (Class updateChangeFileQuerySignal, Class updateChangeListQuerySignal) answer:false do:[
b9087201c7aa Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 1398
diff changeset
   902
        Compiler
b9087201c7aa Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 1398
diff changeset
   903
            compile:'history' 
1505
44c303e3558a do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents: 1504
diff changeset
   904
            forClass:meta 
1413
b9087201c7aa Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 1398
diff changeset
   905
            inCategory:'documentation'
497
abebd0d145e5 dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
   906
    ].
494
6bc61cd32f7c historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   907
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   908
    "Modified (Format): / 30-06-2011 / 17:11:38 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   909
    "Modified (Format): / 30-06-2011 / 17:11:42 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   910
    "Modified (Format): / 30-06-2011 / 17:11:45 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   911
    "Modified (Format): / 30-06-2011 / 17:11:47 / cg"
41
claus
parents:
diff changeset
   912
! !
claus
parents:
diff changeset
   913
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   914
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   915
!HistoryManager::HistoryLine class methodsFor:'converting'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   916
1958
25e29a626264 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
   917
convertStringToDate: aString
25e29a626264 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
   918
    "kludge"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   919
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   920
    | day month year words firstNumber |
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   921
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   922
    "delete delimiter from the date string"
2103
61e20ffc4ddf asNumber eliminated
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
   923
    words := aString asCollectionOfSubstringsSeparatedByAny:'.-/'.
1958
25e29a626264 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
   924
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   925
    "/ figure out if european or yyyy-mm-dd format
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   926
    firstNumber := Number readFromString:(words at: 1).
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   927
    firstNumber > 1900 ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   928
        year := firstNumber.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   929
        month := Number readFrom:(words at: 2 ) onError:nil.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   930
        day := Number readFromString:(words at: 3 ).
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   931
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   932
        day := firstNumber.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   933
        month := Number readFrom:(words at: 2 ) onError:nil.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   934
        year := Number readFromString:(words at: 3 ).
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   935
        (year between:0 and:99) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   936
            year := UserPreferences current twoDigitDateHandler value:year.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   937
        ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   938
    ].
1383
e243ae633fac handle monthname in history line
Claus Gittinger <cg@exept.de>
parents: 1382
diff changeset
   939
    month isNil ifTrue:[
2103
61e20ffc4ddf asNumber eliminated
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
   940
        month := Date indexOfMonth:(words at:2) language:#en.
1383
e243ae633fac handle monthname in history line
Claus Gittinger <cg@exept.de>
parents: 1382
diff changeset
   941
        month == 0 ifTrue:[
2103
61e20ffc4ddf asNumber eliminated
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
   942
            month := Date indexOfMonth:(words at:2).
1383
e243ae633fac handle monthname in history line
Claus Gittinger <cg@exept.de>
parents: 1382
diff changeset
   943
        ].
e243ae633fac handle monthname in history line
Claus Gittinger <cg@exept.de>
parents: 1382
diff changeset
   944
        month == 0 ifTrue:[
1384
4e05f325b284 handle bad month in history line
Claus Gittinger <cg@exept.de>
parents: 1383
diff changeset
   945
            self halt:'invalid month in history line'.
4e05f325b284 handle bad month in history line
Claus Gittinger <cg@exept.de>
parents: 1383
diff changeset
   946
            ^ Date today.
1383
e243ae633fac handle monthname in history line
Claus Gittinger <cg@exept.de>
parents: 1382
diff changeset
   947
        ].
e243ae633fac handle monthname in history line
Claus Gittinger <cg@exept.de>
parents: 1382
diff changeset
   948
    ].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   949
739
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   950
    ^ Date newDay:day month:month year:year.
624
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
    "
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   953
     HistoryLine convertStringToDate:'18.10.1995' 
2103
61e20ffc4ddf asNumber eliminated
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
   954
     HistoryLine convertStringToDate:'18.10.95'    
61e20ffc4ddf asNumber eliminated
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
   955
     HistoryLine convertStringToDate:'18.10.01'    
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   956
     HistoryLine convertStringToDate:'2001-03-01'    
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   957
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   958
1382
d6cb0f200d52 handle other date formats.
Claus Gittinger <cg@exept.de>
parents: 1371
diff changeset
   959
    "Modified: / 23-08-1995 / 21:28:58 / robert"
d6cb0f200d52 handle other date formats.
Claus Gittinger <cg@exept.de>
parents: 1371
diff changeset
   960
    "Modified: / 16-09-1997 / 14:35:03 / stefan"
1958
25e29a626264 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
   961
    "Created: / 06-03-2007 / 17:04:34 / cg"
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
   962
    "Modified (Comment): / 30-06-2011 / 18:37:09 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   963
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   964
1958
25e29a626264 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
   965
convertStringToTime: aString
25e29a626264 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
   966
   "kludge"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   967
739
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   968
    |h m s|
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   969
1953
bd4151ee6b67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
   970
    h := Number readFromString:(aString copyFrom:1 to:2) onError:[^ Time now].
bd4151ee6b67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
   971
    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
   972
    aString size >= 8 ifTrue:[
2103
61e20ffc4ddf asNumber eliminated
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
   973
        s := Number readFromString:(aString copyFrom:7 to:8).
1511
8eec89cf2149 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1505
diff changeset
   974
    ] ifFalse:[
8eec89cf2149 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1505
diff changeset
   975
        s := 0.
8eec89cf2149 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1505
diff changeset
   976
    ].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   977
739
00043008b63c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   978
    ^Time hours:h minutes:m seconds:s.
624
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
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   981
     HistoryLine convertAStringToATime:'18:23:15' 
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
1511
8eec89cf2149 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1505
diff changeset
   984
    "Modified: / 15-08-1995 / 18:56:18 / robert"
1958
25e29a626264 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
   985
    "Created: / 06-03-2007 / 17:05:03 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   986
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   987
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
   988
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   989
!HistoryManager::HistoryLine class methodsFor:'documentation'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   990
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   991
copyright 
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
 COPYRIGHT (c) 1995 by AEG Industry Automation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   994
 COPYRIGHT (c) 1995 by Claus Gittinger
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   995
	      All Rights Reserved
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   996
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   997
 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
   998
 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
   999
 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
  1000
 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
  1001
 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
  1002
 hereby transferred.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1003
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1004
!
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
documentation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1007
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1008
    The class HistoryLine is part of the HistoryManagerProjcet.
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
    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
  1011
    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
  1012
    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
  1013
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1014
    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
  1015
    ST/X class delivery.
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
    [see also:]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1018
        HistoryManager
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1019
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1020
    [author:]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1021
        Robert Sailer - AEG
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
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1025
examples
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1026
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1027
    HistoryLine initialize.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1028
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1029
    HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1030
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1031
    HistoryLine for: 'R.Sailer'.    for integration purposes ONLY
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
    HistoryLine deleted.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1034
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1035
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1036
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1037
version
2875
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
  1038
    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.83 2012-07-31 12:31:47 vrany Exp $'
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1039
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1040
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1041
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1042
!HistoryManager::HistoryLine class methodsFor:'filtering'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1043
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1044
filterHistoryLines:aCollectionOfHistoryLines
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1045
    "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
  1046
     and remove all but the youngest (per user)."
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1047
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1048
    |newCollection skipNext|
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1049
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1050
    skipNext := false.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1051
    newCollection := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1052
    aCollectionOfHistoryLines keysAndValuesDo:[:index :histLine |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1053
        |skip|
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1054
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1055
        skip := skipNext.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1056
        skipNext := false.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1057
        histLine isKindOfModified ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1058
            aCollectionOfHistoryLines do: [:anotherHistLine |
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1059
                (anotherHistLine isCreated and: [anotherHistLine user = histLine user])
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1060
                ifTrue: [
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1061
                    (self timeIsShortFrom:histLine to:anotherHistLine) ifTrue: [skip := true]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1062
                ]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1063
            ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1064
1398
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1065
            skip ifFalse: [
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1066
               "/ if there is another one, skip this
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1067
                aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine |
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1068
                    (anotherHistLine isKindOfModified 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1069
                    and:[anotherHistLine user = histLine user
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1070
                    and:[anotherHistLine what = histLine what]])
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1071
                    ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1072
                        "/ don't replace a modified by a modified format
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1073
                        (histLine isModified not or:[anotherHistLine isModified]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1074
                            skip := true
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1075
                        ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1076
                            "/ remove next comment/format modification if this is a modified
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1077
                            (histLine isModified and:[anotherHistLine isModified not]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1078
                                (self timeIsShortFrom:histLine to:anotherHistLine) ifTrue: [skip := true]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1079
                            ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1080
                        ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1081
                    ]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1082
                ].
1398
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1083
            ]
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1084
        ] ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1085
            "/ filter out multiple created messages
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1086
            "/ (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
  1087
            histLine isCreated ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1088
                aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine |
2404
9cfb670a7b72 do not remove multiple creates
Claus Gittinger <cg@exept.de>
parents: 2394
diff changeset
  1089
                    (anotherHistLine isCreated 
9cfb670a7b72 do not remove multiple creates
Claus Gittinger <cg@exept.de>
parents: 2394
diff changeset
  1090
                    and:[(anotherHistLine what = histLine what)
9cfb670a7b72 do not remove multiple creates
Claus Gittinger <cg@exept.de>
parents: 2394
diff changeset
  1091
                    and:[anotherHistLine user = histLine user]]) 
2405
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
  1092
                        ifTrue:[skip := true]
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1093
                ].
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1094
                skip ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1095
                    "/ create followed by a modification, within the historyManagerModificationLimit:
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1096
                    "/ skip the modified message
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1097
                    (index+1) == aCollectionOfHistoryLines size ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1098
                        | anotherHistLine |
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1099
                        anotherHistLine := aCollectionOfHistoryLines at:index+1.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1100
                        (anotherHistLine isKindOfModified and:[anotherHistLine user = histLine user]) 
3090
94c427846620 Fix in HistoryManager::HistoryLine class>>filterHistoryLines:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3089
diff changeset
  1101
                            ifTrue:[skipNext := (self timeIsShortFrom:histLine to:anotherHistLine)]
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1102
                    ].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1103
                ].
624
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
        skip ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1107
            newCollection add:histLine.
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
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1110
    ^ newCollection.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1111
1981
cc94d4dc1c50 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1958
diff changeset
  1112
    "Modified: / 08-09-1995 / 17:20:40 / claus"
cc94d4dc1c50 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1958
diff changeset
  1113
    "Modified: / 20-06-2004 / 16:36:00 / masca"
cc94d4dc1c50 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1958
diff changeset
  1114
    "Modified: / 01-09-2004 / 20:20:42 / janfrog"
2405
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
  1115
    "Modified: / 05-07-2011 / 23:09:01 / cg"
3090
94c427846620 Fix in HistoryManager::HistoryLine class>>filterHistoryLines:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3089
diff changeset
  1116
    "Modified: / 08-10-2012 / 14:59:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1398
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1117
!
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1118
1398
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1119
modificationLimit
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1120
    "Answer the number of seconds between creation and
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1121
     modifcation of a method within which the modification
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1122
     line won't be added."
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1123
1398
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1124
    ^ 3600 "/one hour
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1125
1398
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1126
    "Created: / 20.6.2004 / 16:32:35 / masca"
21787ad15a01 enhancements by Jan
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
  1127
    "Modified: / 2.9.2004 / 15:33:09 / janfrog"
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1128
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1129
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1130
timeIsShortFrom:histLine1 to:histLine2
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1131
    |t1 t2|
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1132
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1133
    t1 := (Timestamp fromDate: histLine1 date andTime: histLine1 time).
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1134
    t2 := (Timestamp fromDate: histLine2 date andTime: histLine2 time).
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1135
    ^ (t1 secondDeltaFrom:t2) abs < self modificationLimit
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1136
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1137
    "Created: / 30-06-2011 / 18:23:04 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1138
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1139
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1140
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1141
!HistoryManager::HistoryLine class methodsFor:'initialization'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1142
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1143
initialize
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1144
    "setup class variables"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1145
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1146
    Quote isNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1147
        Quote := '"'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1148
        Separator := '/'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1149
        ModifiedString := 'Modified:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1150
        DeletedString := 'Deleted:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1151
        CreatedString := 'Created:'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1152
        AddedString := 'Added:'.
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1153
        FormattedString := 'Modified (format):'.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1154
        CommentedString := 'Modified (comment):'.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1155
        VariableRenamedString := 'Modified (variable name):'.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1156
        IndentString := '    '.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1157
        UseGECOS := false.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1158
    ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1159
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1160
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1161
     HistoryLine initialize
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
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1164
    "Modified: / 23-08-1995 / 22:14:03 / robert"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1165
    "Modified: / 30-06-2011 / 12:28:43 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1166
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1167
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1168
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1169
!HistoryManager::HistoryLine class methodsFor:'instance creation'!
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
fromString: aString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1172
    "parses the argument, aString; 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1173
     create & return a new Instance with the values" 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1174
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1175
    ^ self fromString: aString at: 0.
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
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1178
     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
  1179
     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
  1180
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1181
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1182
    "Modified: 23.8.1995 / 22:14:13 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1183
    "Modified: 20.4.1996 / 20:24:47 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1184
!
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
fromString: aString at: position
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1187
    "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
  1188
     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
  1189
     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
  1190
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1191
    |inst array type aTime aDate userName idx what|
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1192
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1193
    inst := self basicNew.  
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1194
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1195
    array := aString asArrayOfSubstrings.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1196
    array size < 5 ifTrue:[^ nil].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1197
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1198
    array := array collect:[:word | word withoutSpaces].
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1199
    type := array at:1.
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1200
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1201
    "/ kludge for the 'Modified (what)' strings
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1202
    ((array at:2) startsWith:'(') ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1203
        type := type , ' ' , (array at:2).
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1204
        array := (Array with:type) , (array copyFrom:3)
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1205
    ].
624
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
    "
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1208
     Modified [(detail)] / Deleted / Created
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1209
        [what]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1210
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1211
        date asString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1212
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1213
        time asString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1214
        Separator
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1215
        UserName ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1216
    "
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
    ((Array 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1219
        with:ModifiedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1220
        with:DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1221
        with:CreatedString
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1222
        with:AddedString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1223
        with:FormattedString 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1224
        with:CommentedString 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1225
        with:VariableRenamedString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1226
    ) includes:type) ifFalse:[^ nil].
624
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
    inst type:type.
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
    "/ sigh backward compatibility ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1231
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1232
    (array at:2) first isDigit ifTrue:[
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1233
        "/ date follows ...
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1234
        idx := 2
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1235
    ] ifFalse:[
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1236
        idx := array indexOf:Separator startingAt:2.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1237
        idx == 0 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1238
            "/ not a valid history string
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1239
            ^ nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1240
        ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1241
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1242
        idx ~~ 2 ifTrue:[
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1243
            what := (array copyFrom:2 to:(idx-1)) asStringWith:(Character space).
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1244
            inst what:what.
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
        idx := idx + 1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1248
    ].
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1249
    aDate := self convertStringToDate: (array at: idx).
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1250
    inst date: aDate.
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1251
    (array at:idx+1) ~= Separator ifTrue:[^ nil].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1252
    idx := idx + 2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1253
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1254
    aTime := self convertStringToTime: (array at: idx).
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1255
    inst time: aTime.
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1256
    (array at:idx+1) ~= Separator ifTrue:[^ nil].
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1257
    idx := idx + 2.
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
    "the user's name may be more that one word"
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1260
    userName := (array copyFrom:idx) asStringWith:Character space.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1261
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1262
    inst user:userName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1263
    inst firstPositionInSourceCode:position.
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
    ^ inst
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1266
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1267
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1268
     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
  1269
     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
  1270
     HistoryLine fromString: 'Deleted: 21.12.93 / 18:32:30 / Astrid Weisseise'
3ef0160ad564 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1192
diff changeset
  1271
     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
  1272
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1273
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1274
    "Modified: / 23-08-1995 / 22:24:47 / robert"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1275
    "Modified: / 19-09-1995 / 14:14:48 / claus"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1276
    "Modified: / 30-06-2011 / 16:09:16 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1277
    "Modified (Comment): / 30-06-2011 / 19:08:22 / cg"
624
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
new
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1281
    "get a new history line. 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1282
     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
  1283
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1284
    ^ self type:ModifiedString what:nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1285
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1286
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1287
newCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1288
    "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
  1289
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1290
    ^ self type:CreatedString what:nil
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1291
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1292
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1293
     HistoryLine newCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1294
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1295
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1296
    "Modified: 23.8.1995 / 22:14:24 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1297
    "Modified: 24.10.1997 / 00:18:30 / cg"
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
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1300
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1301
!HistoryManager::HistoryLine class methodsFor:'private'!
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
currentUserName
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1304
    "return the current users name - 
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1305
     that's either the userInfos-gecos field, or the users login name."
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1306
2095
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
  1307
    |nm|
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
  1308
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
  1309
    (nm := HistoryManager enforcedUserName) notNil ifTrue:[
71dae0da5f44 enforcedUserName
Claus Gittinger <cg@exept.de>
parents: 2081
diff changeset
  1310
        ^ nm
1495
37d6cbe61da8 *** empty log message ***
fm
parents: 1430
diff changeset
  1311
    ].
2435
68d8d3b3db29 HistoryManager fixes (takes user signature from preferences)
vrany
parents: 2423
diff changeset
  1312
68d8d3b3db29 HistoryManager fixes (takes user signature from preferences)
vrany
parents: 2423
diff changeset
  1313
    (nm := UserPreferences current historyManagerSignature) notNil ifTrue:[
68d8d3b3db29 HistoryManager fixes (takes user signature from preferences)
vrany
parents: 2423
diff changeset
  1314
        ^ nm
68d8d3b3db29 HistoryManager fixes (takes user signature from preferences)
vrany
parents: 2423
diff changeset
  1315
    ].
68d8d3b3db29 HistoryManager fixes (takes user signature from preferences)
vrany
parents: 2423
diff changeset
  1316
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1317
    UseGECOS == true ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1318
        ^ OperatingSystem getFullUserName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1319
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1320
    ^ (OperatingSystem getLoginName).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1321
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1322
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1323
     HistoryLine currentUserName
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1324
    "
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1325
1495
37d6cbe61da8 *** empty log message ***
fm
parents: 1430
diff changeset
  1326
    "Modified: / 15-07-1996 / 12:43:14 / cg"
37d6cbe61da8 *** empty log message ***
fm
parents: 1430
diff changeset
  1327
    "Modified: / 20-06-2006 / 13:26:49 / User"
2435
68d8d3b3db29 HistoryManager fixes (takes user signature from preferences)
vrany
parents: 2423
diff changeset
  1328
    "Modified: / 08-07-2011 / 10:24:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1329
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1330
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1331
type:type what:what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1332
    "private - for integration purposes only"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1333
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1334
    | inst |
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
    inst := self basicNew.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1337
    inst date: Date today.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1338
    inst time: Time now.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1339
    inst firstPositionInSourceCode: 0.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1340
    inst user:(self currentUserName).
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1341
    inst type:type.    
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1342
    inst what:what.    
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
    ^ inst
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1345
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1346
    "Modified: 23.08.1995 / 21:35:44 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1347
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1348
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1349
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1350
!HistoryManager::HistoryLine methodsFor:'accessing'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1351
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1352
date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1353
    "return the date"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1354
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1355
    ^ date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1356
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1357
    "Modified (Format): / 30-06-2011 / 16:23:15 / cg"
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1358
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1359
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1360
date:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1361
    "set the date"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1362
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1363
    date := something.
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
    "Modified: 20.4.1996 / 20:22:16 / cg"
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
firstPositionInSourceCode
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1369
    "return firstPositionInSourceCode"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1370
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
  1371
    ^ firstPositionInSourceCode
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
  1372
!
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1373
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1374
firstPositionInSourceCode:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1375
    "set firstPositionInSourceCode"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1376
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
  1377
    firstPositionInSourceCode := something.
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
  1378
!
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1379
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1380
isForAddition
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1381
    type := AddedString
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
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1384
isForCommented
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1385
    type := CommentedString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1386
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1387
    "Created: / 30-06-2011 / 12:24:22 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1388
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1389
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1390
isForCreation
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1391
    type := CreatedString
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
isForDeletion
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1395
    type := DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1396
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1397
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1398
isForFormatted
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1399
    type := FormattedString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1400
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1401
    "Created: / 30-06-2011 / 12:24:11 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1402
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1403
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1404
isForModification
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1405
    type := ModifiedString
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
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1408
isForVariableRenamed
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1409
    type := VariableRenamedString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1410
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1411
    "Created: / 30-06-2011 / 12:24:36 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1412
    "Modified (Format): / 30-06-2011 / 12:28:27 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1413
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1414
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1415
time
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1416
    "return the time"
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
    ^ time
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
    "Modified: 20.4.1996 / 20:22:04 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1421
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1422
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1423
time:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1424
    "set the time"
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
    time := something.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1427
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1428
    "Modified: 20.4.1996 / 20:21:58 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1429
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1430
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1431
type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1432
    "return the type"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1433
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1434
    ^ type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1435
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1436
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1437
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1438
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1439
type:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1440
    "set the type"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1441
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1442
    type := something.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1443
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1444
    "Modified: 20.4.1996 / 20:21:39 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1445
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1446
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1447
user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1448
    "return the user"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1449
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1450
    ^ user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1451
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1452
    "Modified: 20.4.1996 / 20:21:45 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1453
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1454
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1455
user:something
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1456
    "set the user"
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
    user := something.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1459
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1460
    "Modified: 20.4.1996 / 20:21:48 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1461
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1462
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1463
what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1464
    "return the what-changed info"
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
    ^ what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1467
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1468
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1469
    "Created: 24.10.1997 / 00:20:33 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1470
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1471
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1472
what:someStringOrSelector
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1473
    "set the what-changed info"
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
    what := someStringOrSelector
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
    "Modified: 20.4.1996 / 20:21:54 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1478
    "Created: 24.10.1997 / 00:21:00 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1479
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1480
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1481
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1482
!HistoryManager::HistoryLine methodsFor:'comparing'!
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
= aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1485
    "compares two instances of HistoryLine"
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
    (aHistoryLine user = self user) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1488
        (aHistoryLine date = self date) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1489
            (aHistoryLine time = self time) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1490
                (aHistoryLine type = self type) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1491
                    (aHistoryLine what = self what) ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1492
                        ^ true
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
                ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1495
            ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1496
        ]
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1497
    ].
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
    ^ false
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
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1502
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1503
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1504
    h1 := HistoryLine for: OperatingSystem getLoginName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1505
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1506
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1507
    h1 = h2 ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1508
        InfoBox new title: 'users are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1509
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1510
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1511
    h2 := HistoryLine for: OperatingSystem getLoginName.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1512
    h1 = h2 ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1513
        InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1514
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1515
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1516
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1517
    "Modified: 23.8.1995 / 22:26:40 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1518
    "Modified: 24.10.1997 / 00:22:09 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1519
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1520
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1521
hash
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1522
    "return a hash key for the receiver"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1523
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1524
    ^user hash        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1525
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1526
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1527
    Check hashCode
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1528
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1529
    |h1 h2 oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1530
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1531
    h1 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1532
    h2 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1533
    oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1534
    oc add: h1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1535
    oc add: h2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1536
    ^oc
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1537
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1538
    using hash in a set:
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1539
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1540
    | h1 h2 aSet oc |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1541
    h1 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1542
    h2 := HistoryLine new hash.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1543
    oc := OrderedCollection new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1544
    oc add: h1.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1545
    oc add: h2.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1546
    aSet := oc asSet.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1547
    ^aSet
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1548
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1549
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1550
    "Modified: 23.08.1995 / 22:26:44 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1551
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1552
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1553
sameDate: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1554
    "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
  1555
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1556
    ^aHistoryLine date = date
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1557
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1558
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1559
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1560
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1561
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1562
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1563
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1564
    (h1 sameDate: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1565
	InfoBox new title: 'Dates are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1566
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1567
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1568
    h2 := HistoryLine for: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1569
    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
  1570
    (h1 sameDate: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1571
	InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1572
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1573
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1574
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1575
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1576
    "Modified: 23.08.1995 / 22:26:47 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1577
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1578
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1579
sameType: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1580
    "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
  1581
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1582
    ^aHistoryLine type = type
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1583
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1584
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1585
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1586
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1587
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1588
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1589
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1590
    (h1 sameType: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1591
	InfoBox new title: 'Types are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1592
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1593
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1594
    h2 := HistoryLine createdBy: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1595
    (h1 sameType: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1596
	InfoBox new title: 'Types are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1597
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1598
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1599
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1600
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1601
    "Modified: 23.08.1995 / 22:26:49 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1602
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1603
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1604
sameUser: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1605
    "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
  1606
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1607
    ^aHistoryLine user = user
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1608
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1609
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1610
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1611
    | h1 h2 |
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1612
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1613
    h1 := HistoryLine new.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1614
    h2 := h1 copy.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1615
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1616
    (h1 sameUser: h2)  ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1617
	InfoBox new title: 'users are equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1618
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1619
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1620
    h2 := HistoryLine for: 'R.Sailer'.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1621
    (h1 sameUser: h2) ifFalse:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1622
	InfoBox new title: 'users are not equal'; show.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1623
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1625
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1626
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1627
    "Modified: 23.08.1995 / 22:26:51 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1628
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1629
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1630
sameWhat: aHistoryLine
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1631
    "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
  1632
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1633
    ^aHistoryLine what = what
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1634
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1635
    "Created: 24.10.1997 / 00:21:46 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1636
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1637
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1638
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1639
!HistoryManager::HistoryLine methodsFor:'printing & storing'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1640
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1641
printOn:aStream
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1642
    "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
  1643
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1644
    aStream nextPutAll:IndentString.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1645
    aStream nextPutAll:Quote.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1646
    aStream nextPutAll:type.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1647
    what notNil ifTrue:[
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1648
        aStream space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1649
        aStream nextPutAll:what.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1650
    ].
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1651
    aStream space; nextPutAll:Separator; space.
1371
e537165f5215 date printing (language specifics)
Claus Gittinger <cg@exept.de>
parents: 1204
diff changeset
  1652
    date printOn:aStream language:#en.
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1653
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1654
    time print24HourFormatOn:aStream. 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1655
    aStream space; nextPutAll:Separator; space.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1656
    aStream nextPutAll:user.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1657
    aStream nextPutAll:Quote.
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1658
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1659
    "
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1660
     self new printOn:Transcript
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1661
    "
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1662
643
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1663
    "Modified: / 24.10.1997 / 02:07:23 / cg"
360e30f96f4b Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents: 635
diff changeset
  1664
    "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
  1665
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1666
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1667
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1668
!HistoryManager::HistoryLine methodsFor:'queries'!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1669
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1670
isCreated
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1671
    "returns true if the bodytext is CreatedString"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1672
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1673
    ^type = CreatedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1674
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1675
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1676
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1677
        HistoryLine new isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1678
        (HistoryLine for: 'R.Sailer') isCreated 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1679
        (HistoryLine createdBy: 'R.Sailer') isCreated 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1680
        HistoryLine deleted isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1681
        (HistoryLine deletedBy: 'M.Noell') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1682
        
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1683
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1684
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1685
    "Modified: 23.8.1995 / 22:30:23 / robert"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1686
    "Modified: 20.4.1996 / 20:20:36 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1687
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1688
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1689
isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1690
    "returns true if the bodytext is DeletedString"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1691
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1692
    ^type = DeletedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1693
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1694
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1695
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1696
        HistoryLine deleted isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1697
        HistoryLine new isDeleted
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1698
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1699
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1700
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1701
"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1702
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1703
    "Modified: 20.4.1996 / 20:20:32 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1704
!
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1705
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1706
isKindOfModified
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1707
    "returns true if the bodytext is ModifiedString"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1708
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1709
    ^ self isModified 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1710
        or:[ type = CommentedString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1711
        or:[ type = FormattedString
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1712
        or:[ type = VariableRenamedString ]]]
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1713
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1714
    "
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1715
        HistoryLine new isModified
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1716
        (HistoryLine for: 'R.Sailer') isModified 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1717
        HistoryLine deleted isModified 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1718
        (HistoryLine deletedBy: 'M.Noell') isModified 
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1719
    "
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1720
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1721
    "Created: / 30-06-2011 / 17:15:12 / cg"
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1722
!
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1723
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1724
isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1725
    "returns true if the bodytext is ModifiedString"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1726
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1727
    ^type = ModifiedString
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1728
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1729
    "
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1730
        HistoryLine new isModified
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1731
        (HistoryLine for: 'R.Sailer') isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1732
        HistoryLine deleted isModified 
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1733
        (HistoryLine deletedBy: 'M.Noell') isModified 
2394
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1734
    "
624
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1735
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1736
    "Modified: 20.4.1996 / 20:20:29 / cg"
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1737
! !
93c286b0509a much better history in history method
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1738
3158
f8c56a311307 Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128 2875
diff changeset
  1739
504
b77d99f3bdb6 category rename
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
  1740
!HistoryManager class methodsFor:'documentation'!
119
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1741
3069
89d2cfee177f - stx_libbasic3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3044
diff changeset
  1742
version
3121
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3090
diff changeset
  1743
    ^ '$Header: HistoryManager.st 1974 2012-10-08 13:01:07Z vranyj1 $'
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3090
diff changeset
  1744
!
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3090
diff changeset
  1745
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3090
diff changeset
  1746
version_HG
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3090
diff changeset
  1747
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3090
diff changeset
  1748
    ^ '$Changeset: <not expanded> $'
3012
4f40b8304d54 Added InvalidChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3011
diff changeset
  1749
!
4f40b8304d54 Added InvalidChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3011
diff changeset
  1750
2875
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
  1751
version_SVN
4fe2f4522753 Merged from SVN
vrany
parents: 2641
diff changeset
  1752
    ^ '§Id: HistoryManager.st 1911 2012-04-03 17:14:36Z vranyj1 §'
119
1a9c5a761edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1753
! !
1192
5aea356953d7 Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents: 1153
diff changeset
  1754
3121
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3090
diff changeset
  1755
41
claus
parents:
diff changeset
  1756
HistoryManager initialize!
1192
5aea356953d7 Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents: 1153
diff changeset
  1757
HistoryManager::HistoryLine initialize!