ChangeDeltaInformation.st
author Claus Gittinger <cg@exept.de>
Sun, 14 Apr 2013 20:24:14 +0200
changeset 3215 b2aed720bfd8
parent 2493 457dd1375734
child 3219 92e64a42ab4e
child 3442 b1ba67bb6c9c
permissions -rw-r--r--
class: ChangeDeltaInformation class definition added: #conflict changed: #initialize
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:libbasic3' }"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
Object subclass:#ChangeDeltaInformation
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	instanceVariableNames:'shortDeltaSymbol'
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	classVariableNames:'Unknown Identical Different Added Removed IdenticalButWhiteSpace
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
     6
		IdenticalButFormat IdenticalSemantically Conflict'
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	poolDictionaries:''
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	category:'System-Changes'
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
!ChangeDeltaInformation class methodsFor:'documentation'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
documentation
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
    delta used to return a symbol (#=, #~, #+ or #-);
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
    for more detail, use instances of me:
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
        Unknown                 delta is unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
        Identical               exactly the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
        IdenticalButWhiteSpace  code is formatted different, but AST is the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
        SemanticallyIdentical   code is different, but semantically the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
                                (for example, ifNil: -> isNil ifTrue:)
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
        Different               code is different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
        Added                   method/class is added by change
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
        Removed                 method/class is removed by change
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!ChangeDeltaInformation class methodsFor:'initialization'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
initialize
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
    Unknown                 := self new shortDeltaSymbol:#'?'.    "/ delta is unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    Identical               := self new shortDeltaSymbol:#'='.    "/ exactly the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
    IdenticalButWhiteSpace  := self new shortDeltaSymbol:#'W'.    "/ code is the same except for indentation
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
    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
    35
    IdenticalSemantically   := self new shortDeltaSymbol:#'%'.    "/ code is different, but semantically the same
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
                                                                  "/ (for example, ifNil: -> isNil ifTrue:)
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
    Different               := self new shortDeltaSymbol:#'~'.    "/ code is different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
    Added                   := self new shortDeltaSymbol:#'+'.    "/ method/class is added by change
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    Removed                 := self new shortDeltaSymbol:#'-'.    "/ method/class is removed by change
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    40
    Conflict                := self new shortDeltaSymbol:#'!!'.    "/ package conflict - overwrites existing method
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    "Created: / 31-08-2011 / 10:09:24 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
!ChangeDeltaInformation class methodsFor:'accessing'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
added
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    "method/class is added by change"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    ^ Added
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    "Modified (comment): / 31-08-2011 / 10:20:51 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    55
conflict
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    56
    "method overwrites existing method from another package"
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    57
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    58
    ^ Conflict
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    59
!
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    60
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    "code is different"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    ^ Different
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    "Modified (comment): / 31-08-2011 / 10:21:07 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
identical
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    "exactly the same"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    ^ Identical
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "Modified (comment): / 31-08-2011 / 10:21:18 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
identicalButFormat
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    "code is formatted different, but AST is the same"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    ^ IdenticalButFormat
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "Created: / 31-08-2011 / 10:23:18 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
identicalButWhiteSpace
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "code is the same except for indentation"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    ^ IdenticalButWhiteSpace
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "Modified (comment): / 31-08-2011 / 10:23:49 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
identicalSemantically
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "code is different, but semantically the same.
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
     (for example, ifNil: -> isNil ifTrue:)"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    ^ IdenticalSemantically
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "Modified (comment): / 31-08-2011 / 10:24:04 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
removed
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "method/class is removed by change"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    ^ Removed
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "Modified (comment): / 31-08-2011 / 10:24:14 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    "another change / cannot figure out what has changed"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    ^ Unknown
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    "Created: / 31-08-2011 / 10:20:13 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
!ChangeDeltaInformation methodsFor:'accessing'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
shortDeltaSymbol
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    ^ shortDeltaSymbol
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "Created: / 31-08-2011 / 10:39:01 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
shortDeltaSymbol:something
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    shortDeltaSymbol := something.
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "Created: / 31-08-2011 / 10:39:05 / cg"
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
!ChangeDeltaInformation class methodsFor:'documentation'!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
version
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
   135
    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeDeltaInformation.st,v 1.2 2013-04-14 18:24:14 cg Exp $'
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
!
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
version_CVS
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
   139
    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeDeltaInformation.st,v 1.2 2013-04-14 18:24:14 cg Exp $'
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
! !
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
3215
b2aed720bfd8 class: ChangeDeltaInformation
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
   142
2493
457dd1375734 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
ChangeDeltaInformation initialize!