mercurial/HGBranch.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 01 Feb 2013 12:02:22 +0000
changeset 210 54a73fa50d40
parent 152 9068fe7a5795
child 335 7e19ab19148b
permissions -rw-r--r--
Added copyright notice.

"
 COPYRIGHT (c) 2012-2013 by Jan Vrany
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libscm/mercurial' }"

HGRepositoryObject subclass:#HGBranch
	instanceVariableNames:'name active closed'
	classVariableNames:''
	poolDictionaries:''
	category:'SCM-Mercurial-Core'
!

!HGBranch class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2012-2013 by Jan Vrany
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!HGBranch methodsFor:'accessing'!

heads
    "Returns a list of heads (as HGChangeset) of receicer"

    ^repository heads select:[:cs|cs branches includes: self].

    "Created: / 27-11-2012 / 21:38:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

name
    "Returns a branche's name"
    ^ name

    "Modified (comment): / 22-10-2012 / 19:59:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGBranch methodsFor:'initialization'!

initialize
    "Invoked when a new instance is created."

    active := true.
    closed := false.

    "Created: / 27-11-2012 / 19:34:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

setActive: aBoolean
    active := aBoolean

    "Created: / 27-11-2012 / 19:31:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

setClosed: aBoolean
    closed := aBoolean

    "Created: / 27-11-2012 / 19:31:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

setName: aString
    name := aString

    "Created: / 22-10-2012 / 20:00:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGBranch methodsFor:'printing & storing'!

printOn:aStream
    "append a printed representation if the receiver to the argument, aStream"

    super printOn:aStream.
    aStream nextPutAll:'('.
    name printOn:aStream.
    aStream nextPutAll:')'.

    "Modified: / 10-12-2012 / 03:17:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGBranch methodsFor:'testing'!

isActive
    ^active

    "Created: / 27-11-2012 / 19:32:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

isClosed
    ^closed

    "Created: / 27-11-2012 / 19:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGBranch class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ '§Id::                                                                                                                        §'
! !