# HG changeset patch # User Alexis S. L. Carvalho # Date 1188189875 10800 # Node ID 76c4cadb49fc0e9555078dbc0a204fa98a3a4ebc # Parent 20817af258d87f0262a9c4f933ee134689d40b3c clone: remove "file://" before making the path absolute This avoids writing bogus paths to .hgrc. Fixes issue695. diff -r 20817af258d8 -r 76c4cadb49fc mercurial/hg.py --- 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 diff -r 20817af258d8 -r 76c4cadb49fc tests/test-clone --- 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 diff -r 20817af258d8 -r 76c4cadb49fc tests/test-clone.out --- 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