~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Aaron Bentley
  • Date: 2006-11-23 18:06:43 UTC
  • Revision ID: abentley@panoramicfeedback.com-20061123180643-6ry3xqozdbn4cfhy
Update docs

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.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()
 
555
    wt.set_last_revision(revision_id)
 
556
    if revision_id not in (NULL_REVISION, None):
 
557
        wt._write_inventory(wt.basis_tree().inventory)
568
558
    return wt
569
559
 
570
560
 
674
664
                target_tree.add_pending_merge(revision_id(merged_rev, 
675
665
                                                          encoding))
676
666
            target_tree.set_root_id(BAZ_IMPORT_ROOT)
677
 
            target_tree.flush()
678
667
            target_tree.set_inventory(baz_inv)
679
668
            commitobj = Commit(reporter=ImportCommitReporter())
680
669
            commitobj.commit(working_tree=target_tree,