clone: make things work when source is a repo object
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Wed, 13 Feb 2008 18:37:38 -0200
changeset 6089 28054773438c
parent 6088 3b96cefc1b2b
child 6090 152b6c5c1574
child 6098 65340b8231eb
clone: make things work when source is a repo object
mercurial/hg.py
--- a/mercurial/hg.py	Wed Feb 13 18:37:38 2008 -0200
+++ b/mercurial/hg.py	Wed Feb 13 18:37:38 2008 -0200
@@ -105,14 +105,14 @@
     destination is local repository
     """
 
-    origsource = ui.expandpath(source)
-    source, rev, checkout = parseurl(origsource, rev)
-
     if isinstance(source, str):
+        origsource = ui.expandpath(source)
+        source, rev, checkout = parseurl(origsource, rev)
         src_repo = repository(ui, source)
     else:
         src_repo = source
-        source = src_repo.url()
+        origsource = source = src_repo.url()
+        checkout = None
 
     if dest is None:
         dest = defaultdest(source)