Staging
v0.5.1
https://foss.heptapod.net/mercurial/hgview
Revision 4ad802e7597c3fd2c03ce42e6541b9cd51189f07 authored by Pierre-Yves David on 11 September 2013, 23:39:40 UTC, committed by Pierre-Yves David on 11 September 2013, 23:39:40 UTC
We extract the part about revset execution in a dedicated function. This part of
the code is more complicated than it could be because we have to be compatible
with all supported version of Mercurial:

- version older than 2.1 does not have the `repo.revs` methods
- version older than 2.5 need to apply hidden changeset filtering by hand.

So we move it in a dedicated function. That will help use to split the building
of the revset and it's execution. Revision filtering in hgview needs to provides
its own revset.
1 parent ce23403
Raw File
Tip revision: 4ad802e7597c3fd2c03ce42e6541b9cd51189f07 authored by Pierre-Yves David on 11 September 2013, 23:39:40 UTC
[hggraph] revset execution in a dedicated query
Tip revision: 4ad802e
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