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.
--- 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