~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Aaron Bentley
  • Date: 2007-03-16 19:33:45 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070316193345-cvr6cxy6bie0lel6
Update bugs

Show diffs side-by-side

added added

removed removed

Lines of Context:
552
552
    if revision_id is None:
553
553
        revision_id = source.last_revision()
554
554
    wt = create_checkout(source, to_location, NULL_REVISION)
555
 
    wt.set_last_revision(revision_id)
556
 
    if revision_id not in (NULL_REVISION, None):
557
 
        wt._write_inventory(wt.basis_tree().inventory)
 
555
    wt.lock_write()
 
556
    try:
 
557
        wt.set_last_revision(revision_id)
 
558
        wt.flush()
 
559
        if revision_id not in (NULL_REVISION, None):
 
560
            basis = wt.basis_tree()
 
561
            basis.lock_read()
 
562
            try:
 
563
                wt._write_inventory(basis.inventory)
 
564
            finally:
 
565
                basis.unlock()
 
566
    finally:
 
567
        wt.unlock()
558
568
    return wt
559
569
 
560
570
 
664
674
                target_tree.add_pending_merge(revision_id(merged_rev, 
665
675
                                                          encoding))
666
676
            target_tree.set_root_id(BAZ_IMPORT_ROOT)
 
677
            target_tree.flush()
667
678
            target_tree.set_inventory(baz_inv)
668
679
            commitobj = Commit(reporter=ImportCommitReporter())
669
680
            commitobj.commit(working_tree=target_tree,