Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 6140:47e6d5d5913a
Simplify utils.walkrepos().
author | Walter Doerwald <walter@livinglogic.de> |
---|---|
date | Tue, 28 Aug 2007 18:00:07 +0200 |
parents | 989467e8e3a9 |
children | 09a8be3e5bfb |
comparison
equal
deleted
inserted
replaced
6139:989467e8e3a9 | 6140:47e6d5d5913a |
---|---|
1702 def errhandler(err): | 1702 def errhandler(err): |
1703 if err.filename == path: | 1703 if err.filename == path: |
1704 raise err | 1704 raise err |
1705 | 1705 |
1706 for root, dirs, files in os.walk(path, onerror=errhandler): | 1706 for root, dirs, files in os.walk(path, onerror=errhandler): |
1707 for d in dirs: | 1707 if '.hg' in dirs: |
1708 if d == '.hg': | 1708 dirs[:] = [] # don't descend further |
1709 yield root | 1709 yield root # found a repository |
1710 dirs[:] = [] | |
1711 break | |
1712 | 1710 |
1713 _rcpath = None | 1711 _rcpath = None |
1714 | 1712 |
1715 def os_rcpath(): | 1713 def os_rcpath(): |
1716 '''return default os-specific hgrc search path''' | 1714 '''return default os-specific hgrc search path''' |