Patchwork [09,of,22,V2-Series-D] hgweb: do not access first changeset with a string

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 14, 2013, 8:35 p.m.
Message ID <0e1549221853543dc811.1358195741@yamac.lan>
Download mbox | patch
Permalink /patch/605/
State Accepted
Commit 39616410aa32d95d9b1827db9210cf5c93abd146
Headers show

Comments

Pierre-Yves David - Jan. 14, 2013, 8:35 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1357840550 -3600
# Node ID 0e1549221853543dc811b2e6e70f8f772ac570a3
# Parent  0c0c858fb41574fb4c3c34080d2719aa5023df4c
hgweb: do not access first changeset with a string

There is not reason not to use an int

Patch

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -76,11 +76,11 @@  class revnav(object):
             if pos - f >= 0:
                 navbefore.insert(0, ("-%d" % f, self.hex(pos - f)))
 
         navafter.append(("tip", "tip"))
         try:
-            navbefore.insert(0, ("(0)", self.hex('0')))
+            navbefore.insert(0, ("(0)", self.hex(0)))
         except error.RepoError:
             pass
 
         def gen(l):
             def f(**map):