clone: remove "file://" before making the path absolute
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Mon, 27 Aug 2007 01:44:35 -0300
changeset 5225 76c4cadb49fc
parent 5224 20817af258d8
child 5226 438ff951df70
clone: remove "file://" before making the path absolute This avoids writing bogus paths to .hgrc. Fixes issue695.
mercurial/hg.py
tests/test-clone
tests/test-clone.out
--- a/mercurial/hg.py	Mon Aug 27 01:44:35 2007 -0300
+++ b/mercurial/hg.py	Mon Aug 27 01:44:35 2007 -0300
@@ -141,7 +141,7 @@
     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	Mon Aug 27 01:44:35 2007 -0300
+++ b/tests/test-clone	Mon Aug 27 01:44:35 2007 -0300
@@ -25,3 +25,11 @@
 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	Mon Aug 27 01:44:35 2007 -0300
+++ b/tests/test-clone.out	Mon Aug 27 01:44:35 2007 -0300
@@ -14,3 +14,4 @@
 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