changeset 5239:76c4cadb49fc

clone: remove "file://" before making the path absolute This avoids writing bogus paths to .hgrc. Fixes issue695.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 27 Aug 2007 01:44:35 -0300
parents 20817af258d8
children 438ff951df70
files mercurial/hg.py tests/test-clone tests/test-clone.out
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -141,7 +141,7 @@ def clone(ui, source, dest=None, pull=Fa
     abspath = origsource
     copy = False
     if src_repo.local() and islocal(dest):
-        abspath = os.path.abspath(origsource)
+        abspath = os.path.abspath(util.drop_scheme('file', origsource))
         copy = not pull and not rev
 
     src_lock, dest_lock = None, None
--- a/tests/test-clone
+++ b/tests/test-clone
@@ -25,3 +25,11 @@ cd ../d
 hg clone ../a
 cd a
 hg cat a
+
+# check that we drop the file:// from the path before
+# writing the .hgrc
+cd ../..
+hg clone file://a e
+grep 'file:' e/.hg/hgrc
+
+exit 0
--- a/tests/test-clone.out
+++ b/tests/test-clone.out
@@ -14,3 +14,4 @@ 1 files, 1 changesets, 1 total revisions
 destination directory: a
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 a
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved