~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Nearly complete .bzr/checkout splitout.

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 import BZRDIR
 
24
from bzrlib.bzrdir import 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
912
912
            "invalid message argument %r" % message
913
913
        direction = (forward and 'forward') or 'reverse'
914
914
        
 
915
        # log everything
 
916
        file_id = None
915
917
        if filename:
916
 
            # might be a tree:
917
 
            tree = None
918
 
            try:
919
 
                tree, fp = WorkingTree.open_containing(filename)
920
 
                b = tree.branch
921
 
                if fp != '':
922
 
                    inv = tree.read_working_inventory()
923
 
            except NotBranchError:
924
 
                pass
925
 
            if tree is None:
926
 
                b, fp = Branch.open_containing(filename)
927
 
                if fp != '':
928
 
                    inv = b.repository.get_inventory(b.last_revision())
 
918
            # find the file id to log:
 
919
 
 
920
            dir, fp = BzrDir.open_containing(filename)
 
921
            b = dir.open_branch()
929
922
            if fp != '':
 
923
                try:
 
924
                    # might be a tree:
 
925
                    inv = dir.open_workingtree().inventory
 
926
                except (errors.NotBranchError, errors.NotLocalUrl):
 
927
                    # either no tree, or is remote.
 
928
                    inv = b.basis_tree().inventory
930
929
                file_id = inv.path2id(fp)
931
 
            else:
932
 
                file_id = None  # points to branch root
933
930
        else:
934
 
            tree, relpath = WorkingTree.open_containing(u'.')
935
 
            b = tree.branch
936
 
            file_id = None
 
931
            # local dir only
 
932
            # FIXME ? log the current subdir only RBC 20060203 
 
933
            dir, relpath = BzrDir.open_containing('.')
 
934
            b = dir.open_branch()
937
935
 
938
936
        if revision is None:
939
937
            rev1 = None
973
971
                 end_revision=rev2,
974
972
                 search=message)
975
973
 
 
974
 
976
975
def get_log_format(long=False, short=False, line=False, default='long'):
977
976
    log_format = default
978
977
    if long: