Mercurial > public > mercurial-scm > hg
diff mercurial/util.py @ 13068:adff480db558 stable
makedirs: abort if parent == name (issue2531)
catches unknown drive letters on Windows
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Wed, 01 Dec 2010 21:15:31 +0100 |
parents | e98581d44f0b |
children | 8c6b7a5f38c4 dbc546811dd6 |
line wrap: on
line diff
--- a/mercurial/util.py Fri Nov 19 18:07:15 2010 +0900 +++ b/mercurial/util.py Wed Dec 01 21:15:31 2010 +0100 @@ -833,6 +833,7 @@ def makedirs(name, mode=None): """recursive directory creation with parent mode inheritance""" + parent = os.path.abspath(os.path.dirname(name)) try: os.mkdir(name) if mode is not None: @@ -841,9 +842,8 @@ except OSError, err: if err.errno == errno.EEXIST: return - if not name or err.errno != errno.ENOENT: + if not name or parent == name or err.errno != errno.ENOENT: raise - parent = os.path.abspath(os.path.dirname(name)) makedirs(parent, mode) makedirs(name, mode)