Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 1829:b0f6af327fd4
hgwebdir: export collections of repos
now you can use [collections] section in hgweb.config to export entire
tree of repos.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 10 Feb 2006 11:25:07 -0800 |
parents | ae61937c61c5 |
children | 4ced57680ce7 |
line wrap: on
line diff
--- a/mercurial/util.py Thu Feb 09 17:18:43 2006 -0600 +++ b/mercurial/util.py Fri Feb 10 11:25:07 2006 -0800 @@ -690,3 +690,16 @@ (time.strftime(format, time.gmtime(float(t) - tz)), -tz / 3600, ((-tz % 3600) / 60))) + +def walkrepos(path): + '''yield every hg repository under path, recursively.''' + def errhandler(err): + if err.filename == path: + raise err + + for root, dirs, files in os.walk(path, onerror=errhandler): + for d in dirs: + if d == '.hg': + yield root + dirs[:] = [] + break