comparison mercurial/hgweb/hgwebdir_mod.py @ 42365: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
comparison
equal deleted inserted replaced
42364:448486e12c13 42365:d8e55c0c642c
412 subdir = virtual[:-len('index')] 412 subdir = virtual[:-len('index')]
413 if any(r.startswith(subdir) for r in repos): 413 if any(r.startswith(subdir) for r in repos):
414 return self.makeindex(req, res, tmpl, subdir) 414 return self.makeindex(req, res, tmpl, subdir)
415 415
416 def _virtualdirs(): 416 def _virtualdirs():
417 # Check the full virtual path, each parent, and the root ('') 417 # Check the full virtual path, and each parent
418 if virtual != '': 418 yield virtual
419 yield virtual 419 for p in util.finddirs(virtual):
420 420 yield p
421 for p in util.finddirs(virtual):
422 yield p
423
424 yield ''
425 421
426 for virtualrepo in _virtualdirs(): 422 for virtualrepo in _virtualdirs():
427 real = repos.get(virtualrepo) 423 real = repos.get(virtualrepo)
428 if real: 424 if real:
429 # Re-parse the WSGI environment to take into account our 425 # Re-parse the WSGI environment to take into account our