[PATCH 03 of 23 Series-D] hgweb: do not compute graph is there is no revision to graph

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Jan 10 18:23:48 CST 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1357853835 -3600
# Node ID 98f9b2c7ca0e28e657fd93d298d24ef3ad8810c2
# Parent  f474b1184d82e9ad72b624541bbfe02bc9d2efe3
hgweb: do not compute graph is there is no revision to graph

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -850,12 +850,14 @@ def graph(web, req, tmpl):
 
     uprev = min(max(0, count - 1), rev + revcount)
     downrev = max(0, rev - revcount)
     changenav = webutil.revnavgen(pos, revcount, count, web.repo.changectx)
 
-    dag = graphmod.dagwalker(web.repo, range(start, end)[::-1])
-    tree = list(graphmod.colored(dag, web.repo))
+    tree = []
+    if start < end:
+        dag = graphmod.dagwalker(web.repo, range(start, end)[::-1])
+        tree = list(graphmod.colored(dag, web.repo))
 
     def getcolumns(tree):
         cols = 0
         for (id, type, ctx, vtx, edges) in tree:
             if type != graphmod.CHANGESET:


More information about the Mercurial-devel mailing list