diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py --- a/mercurial/graphmod.py +++ b/mercurial/graphmod.py @@ -26,6 +26,9 @@ def graph(repo, start_rev, stop_rev): - 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 --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -292,7 +292,7 @@ def manifest(web, req, tmpl): 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 --git a/tests/test-hgweb-empty b/tests/test-hgweb-empty new file mode 100755 --- /dev/null +++ b/tests/test-hgweb-empty @@ -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 --git a/tests/test-hgweb-empty.out b/tests/test-hgweb-empty.out new file mode 100644 --- /dev/null +++ b/tests/test-hgweb-empty.out @@ -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
      +
      +
      + + + + +