~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Aaron Bentley
  • Date: 2006-10-15 17:12:08 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20061015171208-6d6636ef7ebfa8f9
Update baz_import to match unique-root changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
import email.Utils
57
57
from progress import *
58
58
 
 
59
 
 
60
BAZ_IMPORT_ROOT = 'TREE_ROOT'
 
61
 
 
62
 
59
63
class ImportCommitReporter(NullCommitReporter):
60
64
 
61
65
    def escaped(self, escape_count, message):
440
444
                wt = None
441
445
            if wt is not None:
442
446
                wt.set_last_revision(wt.branch.last_revision())
 
447
                wt.set_root_id(BAZ_IMPORT_ROOT)
443
448
                wt.revert([])
444
449
    
445
450
        finally:
526
531
        revision_id = source.last_revision()
527
532
    wt = create_checkout(source, to_location, NULL_REVISION)
528
533
    wt.set_last_revision(revision_id)
529
 
    wt._write_inventory(wt.basis_tree().inventory)
 
534
    if revision_id not in (NULL_REVISION, None):
 
535
        wt._write_inventory(wt.basis_tree().inventory)
530
536
    return wt
531
537
 
532
538
 
630
636
                missing_ancestor = None
631
637
            for merged_rev in direct_merges:
632
638
                target_tree.add_pending_merge(revision_id(merged_rev))
 
639
            target_tree.set_root_id(BAZ_IMPORT_ROOT)
633
640
            target_tree.set_inventory(baz_inv)
634
641
            commitobj = Commit(reporter=ImportCommitReporter())
635
642
            commitobj.commit(working_tree=target_tree,