~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

Merge in bzrdir work to enable checkout improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import sys
18
 
from bzrlib.osutils import is_inside_any
 
18
 
19
19
from bzrlib.delta import compare_trees
 
20
from bzrlib.errors import NoSuchRevision
20
21
from bzrlib.log import line_log
21
 
from bzrlib.errors import NoSuchRevision
 
22
from bzrlib.osutils import is_inside_any
 
23
from bzrlib.workingtree import WorkingTree
22
24
 
23
25
# TODO: when showing single-line logs, truncate to the width of the terminal
24
26
# if known, but only if really going to the terminal (not into a file)
66
68
    try:
67
69
        new_is_working_tree = True
68
70
        if revision is None:
69
 
            old = branch.basis_tree()
70
 
            new = branch.working_tree()
 
71
            new = WorkingTree(branch.base, branch)
 
72
            old = new.basis_tree()
71
73
        elif len(revision) > 0:
72
74
            try:
73
75
                rev_id = revision[0].in_history(branch).rev_id
74
 
                old = branch.revision_tree(rev_id)
 
76
                old = branch.repository.revision_tree(rev_id)
75
77
            except NoSuchRevision, e:
76
78
                raise BzrCommandError(str(e))
77
79
            if len(revision) > 1:
78
80
                try:
79
81
                    rev_id = revision[1].in_history(branch).rev_id
80
 
                    new = branch.revision_tree(rev_id)
 
82
                    new = branch.repository.revision_tree(rev_id)
81
83
                    new_is_working_tree = False
82
84
                except NoSuchRevision, e:
83
85
                    raise BzrCommandError(str(e))
84
86
            else:
85
 
                new = branch.working_tree()
 
87
                new = WorkingTree(branch.base, branch)
86
88
                
87
 
 
88
89
        delta = compare_trees(old, new, want_unchanged=show_unchanged,
89
90
                              specific_files=specific_files)
90
 
 
91
91
        delta.show(to_file,
92
92
                   show_ids=show_ids,
93
93
                   show_unchanged=show_unchanged)
109
109
    print >>to_file, 'pending merges:'
110
110
    last_revision = branch.last_revision()
111
111
    if last_revision is not None:
112
 
        ignore = set(branch.get_ancestry(last_revision))
 
112
        ignore = set(branch.repository.get_ancestry(last_revision))
113
113
    else:
114
114
        ignore = set()
115
115
    for merge in new.pending_merges():
116
116
        ignore.add(merge)
117
117
        try:
118
 
            m_revision = branch.get_revision(merge)
 
118
            m_revision = branch.repository.get_revision(merge)
119
119
            print >> to_file, ' ', line_log(m_revision, 77)
120
 
            inner_merges = branch.get_ancestry(merge)
 
120
            inner_merges = branch.repository.get_ancestry(merge)
121
121
            inner_merges.reverse()
122
122
            for mmerge in inner_merges:
123
123
                if mmerge in ignore:
124
124
                    continue
125
 
                mm_revision = branch.get_revision(mmerge)
 
125
                mm_revision = branch.repository.get_revision(mmerge)
126
126
                print >> to_file, '   ', line_log(mm_revision, 75)
127
127
                ignore.add(mmerge)
128
128
        except NoSuchRevision: