diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -263,6 +263,8 @@ def clone(ui, peeropts, source, dest=Non dest = util.urllocalpath(dest) source = util.urllocalpath(source) + if not dest: + raise util.Abort(_("empty destination path is not valid")) if os.path.exists(dest): if not os.path.isdir(dest): raise util.Abort(_("destination '%s' already exists") % dest) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -60,8 +60,8 @@ class localrepository(repo.repository): if not os.path.isdir(self.path): if create: - if not os.path.exists(path): - util.makedirs(path) + if not os.path.exists(self.root): + util.makedirs(self.root) util.makedir(self.path, notindexed=True) requirements = self._baserequirements(create) if self.ui.configbool('format', 'usestore', True): diff --git a/tests/test-bundle.t b/tests/test-bundle.t --- a/tests/test-bundle.t +++ b/tests/test-bundle.t @@ -420,7 +420,7 @@ When cloning from a non-copiable reposit recurse infinitely (issue 2528) $ hg clone full.hg '' - abort: * (glob) + abort: empty destination path is not valid [255] test for http://mercurial.selenic.com/bts/issue216 diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -43,7 +43,7 @@ Default operation: Invalid dest '' must abort: $ hg clone . '' - abort: * (glob) + abort: empty destination path is not valid [255] No update, with debug option: @@ -112,7 +112,7 @@ Use --pull: Invalid dest '' with --pull must abort (issue2528): $ hg clone --pull a '' - abort: * (glob) + abort: empty destination path is not valid [255] Clone to '.':