--- a/mercurial/hg.py Sat Mar 22 00:46:08 2014 +0900
+++ b/mercurial/hg.py Sat Mar 22 00:46:12 2014 +0900
@@ -132,13 +132,16 @@
>>> defaultdest('/')
''
>>> defaultdest('')
- '.'
+ ''
>>> defaultdest('http://example.org/')
- '.'
+ ''
>>> defaultdest('http://example.org/foo/')
'foo'
'''
- return os.path.basename(os.path.normpath(util.url(source).path or ''))
+ path = util.url(source).path
+ if not path:
+ return ''
+ return os.path.basename(os.path.normpath(path))
def share(ui, source, dest=None, update=True):
'''create a shared repository'''
@@ -290,7 +293,8 @@
if dest is None:
dest = defaultdest(source)
- ui.status(_("destination directory: %s\n") % dest)
+ if dest:
+ ui.status(_("destination directory: %s\n") % dest)
else:
dest = ui.expandpath(dest)