diff --git a/mercurial/templates/gitweb/manifest.tmpl b/mercurial/templates/gitweb/manifest.tmpl
--- a/mercurial/templates/gitweb/manifest.tmpl
+++ b/mercurial/templates/gitweb/manifest.tmpl
@@ -30,13 +30,7 @@ files |
{path|escape} {alltags}
-
-drwxr-xr-x |
- |
- |
-[up] |
- |
-
+{ifeq(path, up, '', updirentry)}
{dentries%direntry}
{fentries%fileentry}
diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -59,6 +59,16 @@ fileellipses = '...'
changelogentry = changelogentry.tmpl
changeset = changeset.tmpl
manifest = manifest.tmpl
+updirentry = '
+
+ drwxr-xr-x |
+ |
+ |
+
+ [up]
+ |
+ |
+
'
direntry = '
drwxr-xr-x |
diff --git a/tests/test-hgweb-descend-empties.t b/tests/test-hgweb-descend-empties.t
--- a/tests/test-hgweb-descend-empties.t
+++ b/tests/test-hgweb-descend-empties.t
@@ -425,13 +425,7 @@ manifest with descending (gitweb)
/ draft default tip
-
- drwxr-xr-x |
- |
- |
- [up] |
- |
-
+
drwxr-xr-x |
diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t
--- a/tests/test-hgweb-symrev.t
+++ b/tests/test-hgweb-symrev.t
@@ -516,7 +516,6 @@ Set up the repo
$ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=gitweb' | egrep $REVLINKS
changeset | zip |
- [up] |
dir
files
@@ -590,7 +589,6 @@ Set up the repo
$ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=gitweb' | egrep $REVLINKS
changeset | zip |
- [up] |
dir
files
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -808,6 +808,10 @@ no '[up]' entry in file view when in roo
[1]
$ get-with-headers.py localhost:$HGPORT 'file/tip/da?style=coal' | grep -F '[up]'
[up]
+ $ get-with-headers.py localhost:$HGPORT 'file/tip?style=gitweb' | grep -F '[up]'
+ [1]
+ $ get-with-headers.py localhost:$HGPORT 'file/tip/da?style=gitweb' | grep -F '[up]'
+ [up]
no style can be loaded from directories other than the specified paths