Looking at the code, it appears that if the bzrdir exists but there is no branch, but there *is* a repository, we end up in this code path:
if br_to is None:
# We have a repository but no branch, copy the revisions, and then
# create a branch. repository_to.fetch(source.repository, revision_id=revision_id)
br_to = source.clone(self, revision_id=revision_id)
if source.get_push_location() is None or remember: source.set_push_location(br_to.base) push_result.stacked_on = None push_result.branch_push_result = None push_result.old_revno = None push_result.old_revid = _mod_revision.NULL_REVISION push_result.target_branch = br_to push_result.master_branch = None push_result.workingtree_updated = False
If we *do* have a branch we use: push_result.branch_push_result = source.push(br_to, overwrite, stop_revision=revision_id)
This ends up going through InterBranch.push() which winds around again through '_basic_push' and seems to end up in InterBranch.update_revisions (only now having swapped source and target, so it is target.update_revisions(source)), which seems to indicate that we call
remote_branch.fetch(local_branch, stop_revision)
(note that I'm quite horribly confused by the double indirection through InterBranch, and the fact that the default .update_revisions does this:
def update_revisions(self, other, stop_revision=None, overwrite=False, graph=None):
...
return InterBranch.get(other, self).update_revisions(stop_revision, overwrite, graph)
^- Which as near as I can tell makes 'other' the self.source attribute for InterBranch, which looking at update_revisions hints that it would then be fetching "remote => local" which certainly doesn't make any sense.
And if we don't have a bzrdir we use:
br_to = br_from.create_clone_on_transport(to_transport, revision_id=revision_id, stacked_on=stacked_on, create_prefix=create_prefix, use_existing_dir=use_existing_dir)
Looking at the code, it appears that if the bzrdir exists but there is no branch, but there *is* a repository, we end up in this code path:
if br_to is None:
repository _to.fetch( source. repository, revision_ id=revision_ id) id=revision_ id) get_push_ location( ) is None or remember:
source. set_push_ location( br_to.base)
push_ result. stacked_ on = None
push_ result. branch_ push_result = None
push_ result. old_revno = None
push_ result. old_revid = _mod_revision. NULL_REVISION
push_ result. target_ branch = br_to
push_ result. master_ branch = None
push_ result. workingtree_ updated = False
# We have a repository but no branch, copy the revisions, and then
# create a branch.
br_to = source.clone(self, revision_
if source.
If we *do* have a branch we use:
push_ result. branch_ push_result = source.push(br_to,
overwrite , stop_revision= revision_ id)
This ends up going through InterBranch.push() which winds around again through '_basic_push' and seems to end up in InterBranch. update_ revisions (only now having swapped source and target, so it is target. update_ revisions( source) ), which seems to indicate that we call branch. fetch(local_ branch, stop_revision)
remote_
(note that I'm quite horribly confused by the double indirection through InterBranch, and the fact that the default .update_revisions does this: revisions( self, other, stop_revision=None, overwrite=False,
graph= None): get(other, self).update_ revisions( stop_revision,
overwrite, graph)
def update_
...
return InterBranch.
^- Which as near as I can tell makes 'other' the self.source attribute for InterBranch, which looking at update_revisions hints that it would then be fetching "remote => local" which certainly doesn't make any sense.
And if we don't have a bzrdir we use: create_ clone_on_ transport( to_transport,
revision_ id=revision_ id, stacked_ on=stacked_ on,
create_ prefix= create_ prefix, use_existing_ dir=use_ existing_ dir)
br_to = br_from.