ChangeDeltaInformation.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 17 Feb 2021 15:24:09 +0100
branchjv
changeset 4568 524471ef6575
parent 4330 998eb03f0736
permissions -rw-r--r--
Changing the encoding style header for fileOutAs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3442
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     1
"
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
4330
998eb03f0736 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3922
diff changeset
     3
 COPYRIGHT (c) 2015 Jan Vrany
3442
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     4
              All Rights Reserved
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     5
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     6
 This software is furnished under a license and may be used
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     7
 only in accordance with the terms of that license and with the
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
     9
 be provided or otherwise made available to, or used by, any
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    10
 other person.  No title to or ownership of the software is
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    11
 hereby transferred.
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    12
"
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
3862
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
    15
"{ NameSpace: Smalltalk }"
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
    16
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
Object subclass:#ChangeDeltaInformation
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	instanceVariableNames:'shortDeltaSymbol'
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:'Unknown Identical Different Added Removed IdenticalButWhiteSpace
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    20
		IdenticalButFormat IdenticalSemantically Conflict'
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'System-Changes'
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!ChangeDeltaInformation class methodsFor:'documentation'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
3442
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    27
copyright
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    28
"
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    29
 COPYRIGHT (c) 2006 by eXept Software AG
4330
998eb03f0736 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3922
diff changeset
    30
 COPYRIGHT (c) 2015 Jan Vrany
3442
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    31
              All Rights Reserved
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    32
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    33
 This software is furnished under a license and may be used
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    34
 only in accordance with the terms of that license and with the
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    36
 be provided or otherwise made available to, or used by, any
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    37
 other person.  No title to or ownership of the software is
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    38
 hereby transferred.
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    39
"
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    40
!
b1ba67bb6c9c merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3215
diff changeset
    41
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
documentation
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    delta used to return a symbol (#=, #~, #+ or #-);
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    for more detail, use instances of me:
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
        Unknown                 delta is unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        Identical               exactly the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        IdenticalButWhiteSpace  code is formatted different, but AST is the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        SemanticallyIdentical   code is different, but semantically the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
                                (for example, ifNil: -> isNil ifTrue:)
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
        Different               code is different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
        Added                   method/class is added by change
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
        Removed                 method/class is removed by change
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!ChangeDeltaInformation class methodsFor:'initialization'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
initialize
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    Unknown                 := self new shortDeltaSymbol:#'?'.    "/ delta is unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    Identical               := self new shortDeltaSymbol:#'='.    "/ exactly the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    IdenticalButWhiteSpace  := self new shortDeltaSymbol:#'W'.    "/ code is the same except for indentation
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    IdenticalButFormat      := self new shortDeltaSymbol:#'F'.    "/ code is formatted different, but AST is the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    IdenticalSemantically   := self new shortDeltaSymbol:#'%'.    "/ code is different, but semantically the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
                                                                  "/ (for example, ifNil: -> isNil ifTrue:)
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    Different               := self new shortDeltaSymbol:#'~'.    "/ code is different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    Added                   := self new shortDeltaSymbol:#'+'.    "/ method/class is added by change
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    Removed                 := self new shortDeltaSymbol:#'-'.    "/ method/class is removed by change
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    69
    Conflict                := self new shortDeltaSymbol:#'!!'.    "/ package conflict - overwrites existing method
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    "Created: / 31-08-2011 / 10:09:24 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
!ChangeDeltaInformation class methodsFor:'accessing'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
added
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    "method/class is added by change"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    ^ Added
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    "Modified (comment): / 31-08-2011 / 10:20:51 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    84
conflict
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    85
    "method overwrites existing method from another package"
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    86
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    87
    ^ Conflict
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    88
!
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    89
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    "code is different"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    ^ Different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "Modified (comment): / 31-08-2011 / 10:21:07 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
identical
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "exactly the same"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    ^ Identical
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "Modified (comment): / 31-08-2011 / 10:21:18 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
identicalButFormat
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "code is formatted different, but AST is the same"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    ^ IdenticalButFormat
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    "Created: / 31-08-2011 / 10:23:18 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
identicalButWhiteSpace
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    "code is the same except for indentation"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    ^ IdenticalButWhiteSpace
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    "Modified (comment): / 31-08-2011 / 10:23:49 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
identicalSemantically
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "code is different, but semantically the same.
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
     (for example, ifNil: -> isNil ifTrue:)"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    ^ IdenticalSemantically
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    "Modified (comment): / 31-08-2011 / 10:24:04 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
removed
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    "method/class is removed by change"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    ^ Removed
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    "Modified (comment): / 31-08-2011 / 10:24:14 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    "another change / cannot figure out what has changed"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    ^ Unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    "Created: / 31-08-2011 / 10:20:13 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
3682
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   147
!ChangeDeltaInformation class methodsFor:'utilities'!
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   148
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   149
changeDeltaFor:changeText changeClass:changeClass selector:methodSelector
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   150
    "utility: give a changed method's source, compare against the current version in the system"
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   151
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   152
    |currentText method t1 t2|
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   153
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   154
    changeClass isNil ifTrue:[ ^ '+'].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   155
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   156
    (methodSelector isNil or:[changeClass theNonMetaclass isLoaded not]) ifTrue:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   157
        ^ '?'
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   158
    ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   159
    (changeClass includesSelector:methodSelector asSymbol) ifFalse:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   160
        ^ '+'.
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   161
    ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   162
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   163
    method := changeClass compiledMethodAt:methodSelector asSymbol.
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   164
    Error handle:[:ex |
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   165
        Transcript showCR:'Error while accessing methods current source: ',ex description.
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   166
    ] do:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   167
        currentText := method source.
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   168
    ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   169
    currentText isNil ifTrue:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   170
        "/ cannot access the source code - assume changed
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   171
        ^ '!!'.
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   172
    ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   173
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   174
    changeText asString string withoutTrailingSeparators = currentText asString string withoutTrailingSeparators ifTrue:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   175
        ^ '='
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   176
    ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   177
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   178
    t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   179
    t2 := changeText asCollectionOfLines collect:[:s | s withTabsExpanded].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   180
    t1 = t2 ifTrue:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   181
        ^ '='
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   182
    ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   183
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   184
    RBParser notNil ifTrue:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   185
        |tree1 tree2|
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   186
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   187
        tree1 := RBParser parseMethod:currentText onError:[:aString :pos | ^ '!!'].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   188
        tree2 := RBParser parseMethod:changeText onError:[:aString :pos | ^ '!!'].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   189
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   190
        tree1 = tree2 ifTrue:[
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   191
            ^ '~'
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   192
        ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   193
    ].
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   194
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   195
    ^ ' '
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   196
! !
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   197
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!ChangeDeltaInformation methodsFor:'accessing'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
shortDeltaSymbol
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    ^ shortDeltaSymbol
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    "Created: / 31-08-2011 / 10:39:01 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
shortDeltaSymbol:something
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    shortDeltaSymbol := something.
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    "Created: / 31-08-2011 / 10:39:05 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
3862
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   212
!ChangeDeltaInformation methodsFor:'printing & storing'!
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   213
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   214
printOn:aStream
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   215
    "append a printed representation if the receiver to the argument, aStream"
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   216
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   217
    super printOn:aStream.
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   218
    aStream nextPut:$(.
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   219
    shortDeltaSymbol printOn:aStream.
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   220
    aStream nextPut:$).
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   221
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   222
    "Modified: / 23-04-2015 / 08:50:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   223
! !
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   224
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
!ChangeDeltaInformation class methodsFor:'documentation'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
version
3682
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   228
    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeDeltaInformation.st,v 1.4 2014-12-11 20:47:41 cg Exp $'
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
version_CVS
3682
a590e9e018e3 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
   232
    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeDeltaInformation.st,v 1.4 2014-12-11 20:47:41 cg Exp $'
3922
ae8879b8ba67 Refactored and improved support for writing Bee packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   233
!
ae8879b8ba67 Refactored and improved support for writing Bee packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   234
ae8879b8ba67 Refactored and improved support for writing Bee packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   235
version_HG
ae8879b8ba67 Refactored and improved support for writing Bee packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   236
ae8879b8ba67 Refactored and improved support for writing Bee packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   237
    ^ '$Changeset: <not expanded> $'
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
   240
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
ChangeDeltaInformation initialize!