diff mercurial/hgweb/hgwebdir_mod.py @ 42343:d8e55c0c642c

util: make util.dirs() and util.finddirs() include root directory (API) This changes the behavior of test-origbackup-conflict.t so it no longer errors out when the backup path points to an existing file. Instead, it replaces the file by a directory. That seems reasonable to me. Differential Revision: https://phab.mercurial-scm.org/D6403
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 16 May 2017 11:00:38 -0700
parents 876494fd967d
children 2372284d9457
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Thu Jul 13 23:43:16 2017 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Tue May 16 11:00:38 2017 -0700
@@ -414,14 +414,10 @@
                     return self.makeindex(req, res, tmpl, subdir)
 
             def _virtualdirs():
-                # Check the full virtual path, each parent, and the root ('')
-                if virtual != '':
-                    yield virtual
-
-                    for p in util.finddirs(virtual):
-                        yield p
-
-                yield ''
+                # Check the full virtual path, and each parent
+                yield virtual
+                for p in util.finddirs(virtual):
+                    yield p
 
             for virtualrepo in _virtualdirs():
                 real = repos.get(virtualrepo)