changeset 11544:be5e86c80628 stable

hg.clone: fix branch value when passing a repo object (issue2267) Since 3d6915f5a2bb the branch argument for addbranchrevs should be a tuple: (hashbranch, branches) The right empty value therefore is (None, []) instead of None.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Fri, 02 Jul 2010 15:05:21 +0900
parents 0a2762d83c53
children db9d16233787
files mercurial/hg.py tests/test-clone tests/test-clone.out
diffstat 3 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Tue Jul 06 15:05:03 2010 +0900
+++ b/mercurial/hg.py	Fri Jul 02 15:05:21 2010 +0900
@@ -221,7 +221,7 @@
         src_repo = repository(ui, source)
     else:
         src_repo = source
-        branch = None
+        branch = (None, [])
         origsource = source = src_repo.url()
     rev, checkout = addbranchrevs(src_repo, src_repo, branch, rev)
 
--- a/tests/test-clone	Tue Jul 06 15:05:03 2010 +0900
+++ b/tests/test-clone	Fri Jul 02 15:05:21 2010 +0900
@@ -199,4 +199,14 @@
 hg -R ua parents --template "{node|short}\n"
 rm -r ua
 
+cat <<EOF > simpleclone.py
+from mercurial import ui, hg
+myui = ui.ui()
+repo = hg.repository(myui, 'a')
+hg.clone(myui, repo, dest="ua")
+EOF
+
+python simpleclone.py
+rm -r ua
+
 exit 0
--- a/tests/test-clone.out	Tue Jul 06 15:05:03 2010 +0900
+++ b/tests/test-clone.out	Fri Jul 02 15:05:21 2010 +0900
@@ -312,3 +312,5 @@
 % same revision checked out in repo a and ua
 e8ece76546a6
 e8ece76546a6
+updating to branch default
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved