--- a/mercurial/hg.py Thu Aug 12 18:30:06 2010 +0200
+++ b/mercurial/hg.py Thu Aug 12 18:30:24 2010 +0200
@@ -221,7 +221,7 @@
src_repo = repository(ui, source)
else:
src_repo = source
- branch = (None, [])
+ branch = (None, branch or [])
origsource = source = src_repo.url()
rev, checkout = addbranchrevs(src_repo, src_repo, branch, rev)
--- a/tests/test-clone.t Thu Aug 12 18:30:06 2010 +0200
+++ b/tests/test-clone.t Thu Aug 12 18:30:24 2010 +0200
@@ -431,3 +431,13 @@
$ rm -r ua
+cat <<EOF > branchclone.py
+from mercurial import ui, hg
+myui = ui.ui()
+repo = hg.repository(myui, 'a')
+hg.clone(myui, repo, dest="ua", branch=["stable",])
+EOF
+
+python branchclone.py
+rm -r ua
+