util: do not recurse in makedirs if name is '' (issue2528)

This commit is contained in:
Nicolas Dumazet 2010-11-30 17:48:12 +09:00
parent 120ad3c801
commit 0885c6dc3f
2 changed files with 8 additions and 1 deletions

View File

@ -841,7 +841,7 @@ def makedirs(name, mode=None):
except OSError, err:
if err.errno == errno.EEXIST:
return
if err.errno != errno.ENOENT:
if not name or err.errno != errno.ENOENT:
raise
parent = os.path.abspath(os.path.dirname(name))
makedirs(parent, mode)

View File

@ -399,6 +399,13 @@ Direct clone from bundle (all-history)
$ rm -r full-clone
When cloning from a non-copiable repository into '', do not
recurse infinitely (issue 2528)
$ hg clone full.hg ''
abort: No such file or directory
[255]
test for http://mercurial.selenic.com/bts/issue216
Unbundle incremental bundles into fresh empty in one go