Staging
v0.4.2
https://foss.heptapod.net/mercurial/hgview
Raw File
Tip revision: 1850a087c1b6cb026470c738b2c7f82c6fada06d authored by Mads Kiilerich on 04 April 2020, 02:27:44 UTC
qt5: renaming of references to hgviewlib/qt5, finishing up the Qt5 port
Tip revision: 1850a08
hgview
#!/usr/bin/env python3
# hgview: visual mercurial graphlog browser in PyQt5
#
# 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