# HG changeset patch # User Dirkjan Ochtman # Date 1231092642 -3600 # Node ID 5f162f61e4798d89bee6127e7e7819cc55bb7883 # Parent f1af59451c0c46c5d691a70d715f0e29722b69cd hgweb: fix problems with empty repositories diff -r f1af59451c0c -r 5f162f61e479 mercurial/graphmod.py --- a/mercurial/graphmod.py Sat Jan 03 20:16:10 2009 +0100 +++ b/mercurial/graphmod.py Sun Jan 04 19:10:42 2009 +0100 @@ -26,6 +26,9 @@ - The changeset date/time """ + if start_rev == nullrev and not stop_rev: + return + assert start_rev >= stop_rev assert stop_rev >= 0 curr_rev = start_rev diff -r f1af59451c0c -r 5f162f61e479 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Sat Jan 03 20:16:10 2009 +0100 +++ b/mercurial/hgweb/webcommands.py Sun Jan 04 19:10:42 2009 +0100 @@ -292,7 +292,7 @@ break h[None] = None # denotes files present - if not files and not dirs: + if mf and not files and not dirs: raise ErrorResponse(HTTP_NOT_FOUND, 'path not found: ' + path) def filelist(**map): diff -r f1af59451c0c -r 5f162f61e479 tests/test-hgweb-empty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hgweb-empty Sun Jan 04 19:10:42 2009 +0100 @@ -0,0 +1,12 @@ +#!/bin/sh +# Some tests for hgweb in an empty repository + +hg init test +cd test +hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log +cat hg.pid >> $DAEMON_PIDS + +("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/shortlog') +("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log') +("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/graph') +("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file') diff -r f1af59451c0c -r 5f162f61e479 tests/test-hgweb-empty.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hgweb-empty.out Sun Jan 04 19:10:42 2009 +0100 @@ -0,0 +1,348 @@ +200 Script output follows + + + + + + + + + +test: log + + + + + +
+ + +
+

test

+

log

+ + + + + + + + + + + + +
ageauthordescription
+ + +
+
+ + + + + + +200 Script output follows + + + + + + + + + +test: log + + + + + +
+ + +
+

test

+

log

+ + + + + + + + + + + + +
ageauthordescription
+ + +
+
+ + + + + + +200 Script output follows + + + + + + + + + +test: revision graph + + + + + + +
+ + +
+

test

+

graph

+ + + + + + + +
+
    + +
      +
      + + + + + + +
      +
      + + + + + + +200 Script output follows + + + + + + + + + +test: 000000000000 / + + + +
      + + +
      +

      test

      +

      directory / @ -1:000000000000 tip

      + + + + + + + + + + + + + + + + +
      namesizepermissions
      [up]drwxr-xr-x
      +
      +
      + + + + +