diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -857,8 +857,11 @@ def graph(web, req, tmpl): downrev = max(0, rev - revcount) changenav = webutil.revnav(web.repo).gen(pos, revcount, count) - dag = graphmod.dagwalker(web.repo, range(start, end)[::-1]) - tree = list(graphmod.colored(dag, web.repo)) + tree = [] + if start < end: + revs = list(web.repo.changelog.revs(end - 1, start)) + dag = graphmod.dagwalker(web.repo, revs) + tree = list(graphmod.colored(dag, web.repo)) def getcolumns(tree): cols = 0 diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -684,15 +684,15 @@ check changelog view $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/' 200 Script output follows -#check graph view -# -# $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph' -# 200 Script output follows +check graph view + + $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph' + 200 Script output follows + check filelog view $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar' 200 Script output follows - $ kill `cat hg.pid` Checking _enable=False warning if obsolete marker exists