/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/changeset/apply_changeset.py

  • Committer: Aaron Bentley
  • Date: 2006-05-14 01:42:41 UTC
  • mto: (1185.82.108 w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: aaron.bentley@utoronto.ca-20060514014241-bbfa844d9fd6d32b
Got merge test working

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
            for p_id in rev.parent_ids:
44
44
                if repository.has_revision(p_id):
45
45
                    present_parents.append(p_id)
46
 
                    parent_invs.append(repository.get_inventory(revision))
 
46
                    parent_invs.append(repository.get_inventory(p_id))
47
47
 
48
48
            inv = cset_tree.inventory
49
49
            
51
51
            for path, ie in inv.iter_entries():
52
52
                w = repository.weave_store.get_weave_or_empty(ie.file_id,
53
53
                        repository.get_transaction())
54
 
                if ie.revision not in w._name_map:
 
54
                if ie.revision not in w:
55
55
                    repository.weave_store.add_text(ie.file_id, 
56
56
                                                    rev.revision_id,
57
57
                    cset_tree.get_file(ie.file_id).readlines(),
58
58
                    present_parents, repository.get_transaction())
59
59
 
60
 
            # Now add the inventory information
61
 
            txt = serializer_v5.write_inventory_to_string(inv)
62
 
            sha1 = sha_string(txt)
63
 
            repository.control_weaves.add_text('inventory', 
64
 
                rev.revision_id, 
65
 
                split_lines(txt), 
66
 
                present_parents,
67
 
                repository.get_transaction())
68
 
 
69
 
            # And finally, insert the revision
70
 
            rev_tmp = StringIO()
71
 
            serializer_v5.write_revision(rev, rev_tmp)
72
 
            rev_tmp.seek(0)
73
 
            repository.revision_store.add(rev_tmp, rev.revision_id)
 
60
            repository.add_revision(rev.revision_id, rev, inv)
74
61
        finally:
75
 
            branch.unlock()
 
62
            repository.unlock()
76
63
 
77
64
def apply_changeset(branch, from_file, reverse=False, auto_commit=False):
78
65
    """Read in a changeset from the given file, and apply it to