~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Log works in local treeless branches (#84247)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1509
1509
        if location:
1510
1510
            # find the file id to log:
1511
1511
 
1512
 
            dir, fp = bzrdir.BzrDir.open_containing(location)
1513
 
            b = dir.open_branch()
 
1512
            tree, b, fp = bzrdir.BzrDir.open_containing_tree_or_branch(
 
1513
                location)
1514
1514
            if fp != '':
1515
 
                try:
1516
 
                    # might be a tree:
1517
 
                    inv = dir.open_workingtree().inventory
1518
 
                except (errors.NotBranchError, errors.NotLocalUrl):
1519
 
                    # either no tree, or is remote.
1520
 
                    inv = b.basis_tree().inventory
 
1515
                if tree is None:
 
1516
                    tree = b.basis_tree()
 
1517
                inv = tree.inventory
1521
1518
                file_id = inv.path2id(fp)
1522
1519
                if file_id is None:
1523
1520
                    raise errors.BzrCommandError(