# HG changeset patch # User Nicolas Dumazet # Date 1278050721 -32400 # Node ID be5e86c80628491d012a605276280e7784d6453c # Parent 0a2762d83c5326abf729f7b91ab3ef339620ff95 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. diff -r 0a2762d83c53 -r be5e86c80628 mercurial/hg.py --- 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) diff -r 0a2762d83c53 -r be5e86c80628 tests/test-clone --- 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 < 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 diff -r 0a2762d83c53 -r be5e86c80628 tests/test-clone.out --- 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