diff mercurial/hg.py @ 5276:aea35488ea66

merge with crew-stable
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 31 Aug 2007 22:31:43 +0200
parents d3874a286b51 76c4cadb49fc
children a32a8e50d233
line wrap: on
line diff
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -99,7 +99,7 @@ def clone(ui, source, dest=None, pull=Fa
     """
 
     origsource = source
-    source, rev = cmdutil.parseurl(ui.expandpath(source), rev)
+    source, rev, checkout = cmdutil.parseurl(ui.expandpath(source), rev)
 
     if isinstance(source, str):
         src_repo = repository(ui, source)
@@ -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
@@ -229,10 +229,11 @@ def clone(ui, source, dest=None, pull=Fa
             dest_lock.release()
 
         if update:
-            try:
-                checkout = dest_repo.lookup("default")
-            except:
-                checkout = dest_repo.changelog.tip()
+            if not checkout:
+                try:
+                    checkout = dest_repo.lookup("default")
+                except:
+                    checkout = dest_repo.changelog.tip()
             _update(dest_repo, checkout)
 
     return src_repo, dest_repo