~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Got the bzrdir api straightened out, plenty of refactoring to use it pending, but the api is up and running.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import sys
22
22
 
23
23
import bzrlib
24
 
from bzrlib.bzrdir import BzrDir
 
24
import bzrlib.bzrdir as bzrdir
25
25
from bzrlib._merge_core import ApplyMerge3
26
26
from bzrlib.commands import Command, display_command
27
27
from bzrlib.branch import Branch
565
565
        br_from.lock_read()
566
566
        try:
567
567
            if basis is not None:
568
 
                basis_branch = WorkingTree.open_containing(basis)[0].branch
 
568
                basis_dir = bzrdir.BzrDir.open_containing(basis)[0]
569
569
            else:
570
 
                basis_branch = None
 
570
                basis_dir = None
571
571
            if len(revision) == 1 and revision[0] is not None:
572
572
                revision_id = revision[0].in_history(br_from)[1]
573
573
            else:
574
 
                revision_id = None
 
574
                # FIXME - wt.last_revision, fallback to branch, fall back to
 
575
                # None or perhaps NULL_REVISION to mean copy nothing
 
576
                # RBC 20060209
 
577
                revision_id = br_from.last_revision()
575
578
            if to_location is None:
576
579
                to_location = os.path.basename(from_location.rstrip("/\\"))
577
580
                name = None
589
592
                else:
590
593
                    raise
591
594
            try:
592
 
                branch = br_from.clone(to_location, revision_id, basis_branch)
 
595
                dir = br_from.bzrdir.sprout(to_location, revision_id, basis_dir)
 
596
                branch = dir.open_branch()
593
597
            except bzrlib.errors.NoSuchRevision:
594
598
                rmtree(to_location)
595
599
                msg = "The branch %s has no revision %s." % (from_location, revision[0])
917
921
        if filename:
918
922
            # find the file id to log:
919
923
 
920
 
            dir, fp = BzrDir.open_containing(filename)
 
924
            dir, fp = bzrdir.BzrDir.open_containing(filename)
921
925
            b = dir.open_branch()
922
926
            if fp != '':
923
927
                try:
930
934
        else:
931
935
            # local dir only
932
936
            # FIXME ? log the current subdir only RBC 20060203 
933
 
            dir, relpath = BzrDir.open_containing('.')
 
937
            dir, relpath = bzrdir.BzrDir.open_containing('.')
934
938
            b = dir.open_branch()
935
939
 
936
940
        if revision is None: