mercurial/HGDebugFlags.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 09 Feb 2014 20:03:13 +0000
changeset 368 00c2d0fda82b
parent 335 7e19ab19148b
child 441 032641fb1e6d
child 495 ff3e296098e5
permissions -rw-r--r--
Minor improvements in debugging support. Added accessors to HGDebugFlags. When Debug flag is set, then full back trace is printed when an exception is propagated to command's main thread.

"
stx:libscm - a new source code management library for Smalltalk/X
Copyright (C) 2012-2013 Jan Vrany

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License. 

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
"
"{ Package: 'stx:libscm/mercurial' }"

SharedPool subclass:#HGDebugFlags
	instanceVariableNames:''
	classVariableNames:'Debug Trace'
	poolDictionaries:''
	category:'SCM-Mercurial-Internal'
!

!HGDebugFlags class methodsFor:'documentation'!

copyright
"
stx:libscm - a new source code management library for Smalltalk/X
Copyright (C) 2012-2013 Jan Vrany

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License. 

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
"
! !

!HGDebugFlags class methodsFor:'accessing'!

debug
    ^Debug

    "Created: / 08-02-2014 / 11:37:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

debug: aBoolean
    Debug := aBoolean

    "Created: / 08-02-2014 / 11:36:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

trace
    ^Trace

    "Created: / 03-03-2013 / 17:20:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

trace: aBoolean
    Trace := aBoolean

    "Created: / 08-02-2014 / 11:36:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGDebugFlags class methodsFor:'class initialization'!

initialize
    | debug trace |

    debug := OperatingSystem getEnvironment:'STX_LIBSCM_MERCURIAL_DEBUG'.
    Debug := debug notNil and:[debug ~= '0'].

    trace := OperatingSystem getEnvironment:'STX_LIBSCM_MERCURIAL_TRACE'.
    Trace := trace notNil and:[trace ~= '0'].

    "
     HGDebugFlags initialize
    "

    "Modified: / 09-03-2013 / 22:11:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGDebugFlags class methodsFor:'documentation'!

version_HG

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


HGDebugFlags initialize!