1164
1164
def create_clone_on_transport(self, to_transport, revision_id=None,
1165
stacked_on=None, create_prefix=False, use_existing_dir=False):
1166
1166
"""Create a clone of this branch and its bzrdir.
1168
1168
:param to_transport: The transport to clone onto.
1169
1169
:param revision_id: The revision id to use as tip in the new branch.
1170
1170
If None the tip is obtained from this branch.
1171
1171
:param stacked_on: An optional URL to stack the clone on.
1172
:param create_prefix: Create any missing directories leading up to
1174
:param use_existing_dir: Use an existing directory if one exists.
1173
1176
# XXX: Fix the bzrdir API to allow getting the branch back from the
1174
1177
# clone call. Or something. 20090224 RBC/spiv.
1175
dir_to = self.bzrdir.clone_on_transport(to_transport,
1176
revision_id=revision_id, stacked_on=stacked_on)
1178
if revision_id is None:
1179
revision_id = self.last_revision()
1181
dir_to = self.bzrdir.clone_on_transport(to_transport,
1182
revision_id=revision_id, stacked_on=stacked_on,
1183
create_prefix=create_prefix, use_existing_dir=use_existing_dir)
1184
except errors.FileExists:
1185
if not use_existing_dir:
1187
except errors.NoSuchFile:
1188
if not create_prefix:
1177
1190
return dir_to.open_branch()
1179
1192
def create_checkout(self, to_location, revision_id=None,