remote-bzr: add fallback check for a partial clone

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Felipe Contreras 2013-05-24 21:24:26 -05:00 committed by Junio C Hamano
parent e56660a73f
commit 85f931d3d5

View File

@ -766,7 +766,10 @@ def do_list(parser):
print
def clone(path, remote_branch):
bdir = bzrlib.bzrdir.BzrDir.create(path)
try:
bdir = bzrlib.bzrdir.BzrDir.create(path)
except bzrlib.errors.AlreadyControlDirError:
bdir = bzrlib.bzrdir.BzrDir.open(path)
repo = bdir.find_repository()
repo.fetch(remote_branch.repository)
return remote_branch.sprout(bdir, repository=repo)