mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
hg.clone: do not ignore branch argument when source is a repo object
This is a revert of f6aa66376f81. The "bug" mentioned in this changeset is unclear: hopefully using a test to cover this usage should prevent any bugs.
This commit is contained in:
parent
14ab4a3d21
commit
bd660e421e
@ -221,7 +221,7 @@ def clone(ui, source, dest=None, pull=False, rev=None, update=True,
|
||||
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)
|
||||
|
||||
|
@ -209,4 +209,14 @@ EOF
|
||||
python simpleclone.py
|
||||
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
|
||||
|
||||
exit 0
|
||||
|
@ -314,3 +314,10 @@ e8ece76546a6
|
||||
e8ece76546a6
|
||||
updating to branch default
|
||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
requesting all changes
|
||||
adding changesets
|
||||
adding manifests
|
||||
adding file changes
|
||||
added 14 changesets with 14 changes to 3 files
|
||||
updating to branch stable
|
||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
|
Loading…
Reference in New Issue
Block a user