3
This contains the apply changset function for bzr
8
def apply_changeset(branch, from_file, reverse=False, auto_commit=False):
9
from bzrlib.changeset import apply_changeset as _apply_changeset
10
from bzrlib.merge import regen_inventory
11
import sys, read_changeset
14
cset_info = read_changeset.read_changeset(from_file)
15
cset = cset_info.get_changeset()
17
for file_id in branch.inventory:
18
inv[file_id] = branch.inventory.id2path(file_id)
19
changes = _apply_changeset(cset, inv, branch.base,
23
for id, path in changes.iteritems():
27
adjust_ids.append((path, id))
29
branch.set_inventory(regen_inventory(branch, branch.base, adjust_ids))
32
from bzrlib.commit import commit
33
if branch.last_patch() == cset_info.precursor:
34
# This patch can be applied directly
35
commit(branch, message = cset_info.message,
36
timestamp=float(cset_info.timestamp),
37
timezone=float(cset_info.timezone),
38
committer=cset_info.committer,
39
rev_id=cset_info.revision)