[PATCH 4 of 4] clone: show unescaped destination paths (issue2983)

Mads Kiilerich mads at kiilerich.com
Thu Dec 8 09:39:26 CST 2011


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1323358746 -3600
# Node ID edeef9cddc0f917f030a918fbffe1a0a57f687ab
# Parent  2ea90c856cf5f05cd5b3815fdd1d41e42cc19dc2
clone: show unescaped destination paths (issue2983)

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -252,13 +252,11 @@
     rev, checkout = addbranchrevs(srcrepo, srcrepo, branch, rev)
 
     if dest is None:
-        dest = defaultdest(source)
+        dest = defaultdest(util.urllocalpath(source))
         ui.status(_("destination directory: %s\n") % dest)
     else:
         dest = ui.expandpath(dest)
-
-    dest = util.urllocalpath(dest)
-    source = util.urllocalpath(source)
+        dest = util.urllocalpath(dest)
 
     if os.path.exists(dest):
         if not os.path.isdir(dest):
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -287,7 +287,7 @@
   abort: no suitable response from remote hg!
   [255]
   $ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg clone --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP/a repo\"" "ssh://user@dummy/a repo"
-  destination directory: a%20repo
+  destination directory: a repo
   abort: destination 'a repo' is not empty
   [255]
 


More information about the Mercurial-devel mailing list