MCLazyVersionInfo.st
author Claus Gittinger <cg@exept.de>
Sat, 20 Aug 2011 13:52:38 +0200
changeset 268 5778c85179ee
child 341 2f6e029166a1
permissions -rw-r--r--
initial checkin

"{ Package: 'stx:goodies/monticello' }"

MCVersionInfo subclass:#MCLazyVersionInfo
	instanceVariableNames:'ancestorsProps stepChildrenProps'
	classVariableNames:''
	poolDictionaries:''
	category:'Monticello-St/X support'
!


!MCLazyVersionInfo class methodsFor:'instance creation'!

withProperties: properties

    ^self new initializeWithProperties: properties

    "Created: / 28-10-2010 / 15:34:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!MCLazyVersionInfo methodsFor:'accessing'!

ancestors

    ancestors ifNil:
        [ancestorsProps ifNotNil:
            [ancestors := ancestorsProps collect:[:p|MCLazyVersionInfo withProperties:p].
            ancestorsProps := nil]].
    ^super ancestors

    "Created: / 28-10-2010 / 17:51:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

stepChildren

    stepChildren ifNil:
        [stepChildrenProps ifNotNil:
            [stepChildren := stepChildrenProps collect:[:p|MCLazyVersionInfo withProperties:p].
            stepChildrenProps := nil]].
    ^super stepChildren

    "Created: / 28-10-2010 / 17:52:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!MCLazyVersionInfo methodsFor:'initialization'!

initializeWithProperties: dict

    name:= (dict at: #name ifAbsent: ['']).
    id:= (UUID fromString: (dict at: #id)).
    message:= (dict at: #message ifAbsent: ['']).
    date:= ([Date fromString: (dict at: #date) ] on: Error do: [ :ex | ex return: nil ]).
    time:= ([ Time fromString:(dict at: #time)] on: Error do: [ :ex | ex return: nil ]).
    author:= (dict at: #author ifAbsent: ['']).

    ancestorsProps:= dict at: #ancestors ifAbsent:[#()].
    stepChildrenProps:= dict at: #stepChildren ifAbsent: [#()].

    "Created: / 28-10-2010 / 15:36:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 28-10-2010 / 17:49:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!MCLazyVersionInfo class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyVersionInfo.st,v 1.1 2011-08-20 11:52:38 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyVersionInfo.st,v 1.1 2011-08-20 11:52:38 cg Exp $'
!

version_SVN
    ^ '§Id: MCLazyVersionInfo.st 23 2010-10-29 14:41:24Z vranyj1 §'
! !