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

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 11, 2013, 12:23 a.m.
Message ID <98f9b2c7ca0e28e657fd.1357863828@yamac.lan>
Download mbox | patch
Permalink /patch/532/
State Superseded
Headers show

Comments

Pierre-Yves David - Jan. 11, 2013, 12:23 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1357853835 -3600
# Node ID 98f9b2c7ca0e28e657fd93d298d24ef3ad8810c2
# Parent  f474b1184d82e9ad72b624541bbfe02bc9d2efe3
hgweb: do not compute graph is there is no revision to graph

Patch

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: