changeset 3333:8ec80c1b8f0b

hgweb: globally default to tip if no revision is specified
author Brendan Cully <brendan@kublai.com>
date Wed, 11 Oct 2006 11:30:59 -0700
parents a5209a1e53d8
children 534806df5b5a
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Wed Oct 11 09:27:57 2006 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Oct 11 11:30:59 2006 -0700
@@ -772,8 +772,11 @@
     def changectx(self, req):
         if req.form.has_key('node'):
             changeid = req.form['node'][0]
+        elif req.form.has_key('manifest'):
+            changeid = req.form['manifest'][0]
         else:
-            changeid = req.form['manifest'][0]
+            changeid = self.repo.changelog.count() - 1
+
         try:
             ctx = self.repo.changectx(changeid)
         except hg.RepoError:
@@ -848,8 +851,7 @@
         self.do_changelog(req, shortlog = True)
 
     def do_changeset(self, req):
-        ctx = self.repo.changectx(req.form['node'][0])
-        req.write(self.changeset(ctx))
+        req.write(self.changeset(self.changectx(req)))
 
     def do_manifest(self, req):
         req.write(self.manifest(self.changectx(req),