~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clone.py

[merge] much integrated work from robert and john

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
            os.mkdir(to_location)
88
88
        branch_to = Branch.initialize(to_location)
89
89
        mutter("copy branch from %s to %s", branch_from, branch_to)
90
 
        branch_to.set_root_id(branch_from.get_root_id())
 
90
        branch_to.working_tree().set_root_id(branch_from.get_root_id())
91
91
        branch_to.append_revision(*history)
92
92
        _copy_control_weaves(branch_from, branch_to)
93
93
        _copy_text_weaves(branch_from, branch_to)
100
100
        branch_from.unlock()
101
101
 
102
102
 
103
 
def _get_truncated_history(branch_from, revision):
 
103
def _get_truncated_history(branch_from, revision_id):
104
104
    history = branch_from.revision_history()
105
 
    if revision is None:
 
105
    if revision_id is None:
106
106
        return history
107
107
    try:
108
 
        idx = history.index(revision)
 
108
        idx = history.index(revision_id)
109
109
    except ValueError:
110
110
        raise InvalidRevisionId(revision_id=revision, branch=branch_from)
111
111
    return history[:idx+1]
151
151
    mutter("copy branch from %s to %s", branch_from, br_to)
152
152
    if basis_branch is not None:
153
153
        basis_branch.push_stores(br_to)
154
 
    br_to.set_root_id(branch_from.get_root_id())
 
154
    br_to.working_tree().set_root_id(branch_from.get_root_id())
155
155
    if revision is None:
156
156
        revision = branch_from.last_revision()
157
157
    br_to.update_revisions(branch_from, stop_revision=revision)