mercurial/hg.py
changeset 20800 8253e55930a3
parent 20799 069bf1b821c8
child 20829 9a09a625bc93
--- 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)