MCLazyVersionInfo.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 12 May 2015 01:07:30 +0100
branchjv
changeset 999 679cac09d882
parent 635 85074a06c86b
child 1003 0ebeea1cdeeb
permissions -rw-r--r--
Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing ...so lazy-loading of ancestry works.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/monticello' }"
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
999
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
     3
"{ NameSpace: Smalltalk }"
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
     4
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
MCVersionInfo subclass:#MCLazyVersionInfo
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:'ancestorsProps stepChildrenProps'
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
635
85074a06c86b category change
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
     9
	category:'SCM-Monticello-St/X support'
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!MCLazyVersionInfo class methodsFor:'instance creation'!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
withProperties: properties
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
    ^self new initializeWithProperties: properties
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
    "Created: / 28-10-2010 / 15:34:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
! !
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!MCLazyVersionInfo methodsFor:'accessing'!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
ancestors
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
    ancestors ifNil:
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
        [ancestorsProps ifNotNil:
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
            [ancestors := ancestorsProps collect:[:p|MCLazyVersionInfo withProperties:p].
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
            ancestorsProps := nil]].
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
    ^super ancestors
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    "Created: / 28-10-2010 / 17:51:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
stepChildren
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
    stepChildren ifNil:
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
        [stepChildrenProps ifNotNil:
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
            [stepChildren := stepChildrenProps collect:[:p|MCLazyVersionInfo withProperties:p].
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
            stepChildrenProps := nil]].
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    ^super stepChildren
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    "Created: / 28-10-2010 / 17:52:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
! !
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
!MCLazyVersionInfo methodsFor:'initialization'!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
initializeWithProperties: dict
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    name:= (dict at: #name ifAbsent: ['']).
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    id:= (UUID fromString: (dict at: #id)).
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    message:= (dict at: #message ifAbsent: ['']).
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    date:= ([Date fromString: (dict at: #date) ] on: Error do: [ :ex | ex return: nil ]).
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    time:= ([ Time fromString:(dict at: #time)] on: Error do: [ :ex | ex return: nil ]).
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    author:= (dict at: #author ifAbsent: ['']).
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
999
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    57
    (dict includesKey: #ancestors) ifTrue:[ 
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    58
        ancestorsProps:= dict at: #ancestors.
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    59
        ancestors := nil.
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    60
    ].
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    stepChildrenProps:= dict at: #stepChildren ifAbsent: [#()].
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "Created: / 28-10-2010 / 15:36:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
999
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    64
    "Modified: / 12-05-2015 / 01:05:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
! !
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!MCLazyVersionInfo class methodsFor:'documentation'!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
version
635
85074a06c86b category change
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
    70
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyVersionInfo.st,v 1.3 2012-09-11 21:22:41 cg Exp $'
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
version_CVS
635
85074a06c86b category change
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
    74
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyVersionInfo.st,v 1.3 2012-09-11 21:22:41 cg Exp $'
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
!
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
999
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    77
version_HG
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    78
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    79
    ^ '$Changeset: <not expanded> $'
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    80
!
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    81
268
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
version_SVN
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    ^ '§Id: MCLazyVersionInfo.st 23 2010-10-29 14:41:24Z vranyj1 §'
5778c85179ee initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
! !
999
679cac09d882 Fix in MCLazyVersionInfo: set ancestor instvar to nil when initializing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 635
diff changeset
    85