~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

Update for integration move of read_working_inventory from Branch to WorkingTree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.commit import Commit, NullCommitReporter
24
24
from bzrlib.commands import Command
25
25
from bzrlib.option import _global_option
 
26
from bzrlib.workingtree import WorkingTree
26
27
from errors import NoPyBaz
27
28
try:
28
29
    import pybaz
581
582
        else:
582
583
            log_message = log_summary
583
584
        branch.lock_write()
 
585
        target_tree = WorkingTree(revdir ,branch=branch)
 
586
        target_tree.lock_write()
584
587
        try:
585
588
            if missing_ancestor:
586
589
                # if we want it to be in revision-history, do that here.
588
591
                missing_ancestor = None
589
592
            for merged_rev in direct_merges:
590
593
                branch.add_pending_merge(revision_id(merged_rev))
591
 
            branch.set_inventory(baz_inv)
 
594
            target_tree.set_inventory(baz_inv)
592
595
            commitobj = Commit(reporter=ImportCommitReporter(pb))
593
596
            commitobj.commit(branch, log_message.decode('ascii', 'replace'), 
594
597
                             verbose=False, committer=log_creator,
595
598
                             timestamp=timestamp, timezone=0, rev_id=rev_id)
596
599
        finally:
 
600
            target_tree.unlock()
597
601
            branch.unlock()
598
602
    yield Progress("revisions", len(ancestors), len(ancestors))
599
603
    unlink_unversioned(branch, revdir)