hgwebdir: fix [collections] evaluation under Windows
authorPatrick Mezard <pmezard@gmail.com>
Thu, 21 May 2009 20:32:45 +0200
changeset 8536 6796d41be421
parent 8426 2ff17c4de1da
child 8537 b48a1e081f23
child 8560 107af208ed0b
child 8722 48da69ff79bd
hgwebdir: fix [collections] evaluation under Windows Virtual and real path separators are not the same under Windows.
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun May 17 19:54:26 2009 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Thu May 21 20:32:45 2009 +0200
@@ -72,12 +72,13 @@
                         self.repos.append((name, path))
             if cp.has_section('collections'):
                 for prefix, root in cp.items('collections'):
+                    prefix = util.pconvert(prefix)
                     for path in util.walkrepos(root, followsym=True):
                         repo = os.path.normpath(path)
-                        name = repo
+                        name = util.pconvert(repo)
                         if name.startswith(prefix):
                             name = name[len(prefix):]
-                        self.repos.append((name.lstrip(os.sep), repo))
+                        self.repos.append((name.lstrip('/'), repo))
             self.repos.sort()
 
     def run(self):