~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Aaron Bentley
  • Date: 2006-08-23 20:17:52 UTC
  • Revision ID: abentley@panoramicfeedback.com-20060823201752-5f198811ed09f00d
Stop using EmptyTree

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from bzrlib.option import _global_option, Option
32
32
from bzrlib.merge import merge_inner
33
33
from bzrlib.revision import NULL_REVISION
34
 
from bzrlib.tree import EmptyTree
35
34
import bzrlib.ui
36
35
import bzrlib.ui.text
37
36
from bzrlib.workingtree import WorkingTree
422
421
                                   dir=os.path.dirname(output_dir))
423
422
        try:
424
423
            wt = WorkingTree.open(output_dir)
 
424
            old_last_revision = wt.last_revision()
425
425
        except (NotBranchError, NoWorkingTree):
426
426
            wt = None
427
 
        if wt is None:
428
 
            old_basis = EmptyTree()
429
 
        else:
430
 
            old_basis = wt.basis_tree()
 
427
            old_last_revision = None 
431
428
        try:
432
429
            for result in iter_import_version(output_dir, ancestors, tempdir,
433
430
                    pb=progress_bar,
445
442
                wt = None
446
443
            if wt is not None:
447
444
                wt.set_last_revision(wt.branch.last_revision())
 
445
                old_basis = \
 
446
                    wt.branch.repository.revision_tree(old_last_revision)
448
447
                merge_inner(wt.branch, wt.basis_tree(), old_basis, 
449
448
                            ignore_zero=True, this_tree=wt)
450
449
                wt.revert([])