Staging
v0.5.1
https://foss.heptapod.net/mercurial/hgview
Revision d5fa1d5c7ba96e783e5242d8babc53b83f48db8b authored by Sean Farley on 15 November 2013, 20:02:09 UTC, committed by Sean Farley on 15 November 2013, 20:02:09 UTC
Previously, the 'status' variable was initialized with the integer '1' so that
the 'if status is None' statement would fail and then a default value of
'status.lower()' was used but this would fail since status is an integer. After
this patch, we try to convert from an integer first, then fall back to using a
default value.
1 parent ef4401e
Raw File
Tip revision: d5fa1d5c7ba96e783e5242d8babc53b83f48db8b authored by Sean Farley on 15 November 2013, 20:02:09 UTC
hgrepoviewer: fix int conversion
Tip revision: d5fa1d5
hgview
#!/usr/bin/env python
# hgview: visual mercurial graphlog browser in PyQt4
#
# Copyright 2008-2010 Logilab
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.

"""
Hg repository log browser.

This may be used as a standalone application or as a hg extension. See
README file included.
"""

import sys
from os import readlink, lstat
from os.path import join, dirname, abspath, pardir, exists
from imp import load_package
import stat


execpath = abspath(__file__)
#   resolve symbolic links
statinfo = lstat(execpath)
if stat.S_ISLNK(statinfo.st_mode):
    execpath = join(dirname(execpath), readlink(execpath))
    execpath = abspath(execpath)
# if standalone, import manually
setuppath = join(dirname(dirname(execpath)), 'setup.py')
if exists(setuppath): # standalone if setup.py found in src dir
    hgviewlibpath = join(dirname(dirname(execpath)), 'hgviewlib')
    hgviewlibpath = abspath(hgviewlibpath)
    load_package('hgviewlib', hgviewlibpath)

from hgviewlib.application import main

main()
back to top