# HG changeset patch # User Mads Kiilerich # Date 2011-08-21 22:42:38 # Node ID ff3e9368630663194c00bf47bee7097936fb4b51 # Parent 79a861b8f55346f773fa0e96888e655eea966c86 util.makedirs: make recursion simpler and more stable (issue2948) Before, makedirs could call itself recursively with the same path name it was given, relying on sane file system behavior to terminate the recursion. That could cause infinite recursion on insane file systems. Instead we now call mkdir explicitly after having created parent directory recursively. Exceptions from this mkdir is not swallowed. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -789,7 +789,7 @@ def makedirs(name, mode=None): if not name or parent == name or err.errno != errno.ENOENT: raise makedirs(parent, mode) - makedirs(name, mode) + os.mkdir(name) if mode is not None: os.chmod(name, mode)