~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Aaron Bentley
  • Date: 2006-02-22 14:39:42 UTC
  • mto: (2027.1.2 revert-subpath-56549)
  • mto: This revision was merged to the branch mainline in revision 1570.
  • Revision ID: abentley@panoramicfeedback.com-20060222143942-ae72299f2de66767
Fixed build_tree with symlinks

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
22
23
 
23
24
# TODO: when showing single-line logs, truncate to the width of the terminal
24
25
# if known, but only if really going to the terminal (not into a file)
66
67
    try:
67
68
        new_is_working_tree = True
68
69
        if revision is None:
69
 
            old = branch.basis_tree()
70
 
            new = branch.working_tree()
 
70
            new = branch.bzrdir.open_workingtree()
 
71
            old = new.basis_tree()
71
72
        elif len(revision) > 0:
72
73
            try:
73
74
                rev_id = revision[0].in_history(branch).rev_id
74
 
                old = branch.revision_tree(rev_id)
 
75
                old = branch.repository.revision_tree(rev_id)
75
76
            except NoSuchRevision, e:
76
77
                raise BzrCommandError(str(e))
77
 
            if len(revision) > 1:
 
78
            if (len(revision) > 1) and (revision[1].spec is not None):
78
79
                try:
79
80
                    rev_id = revision[1].in_history(branch).rev_id
80
 
                    new = branch.revision_tree(rev_id)
 
81
                    new = branch.repository.revision_tree(rev_id)
81
82
                    new_is_working_tree = False
82
83
                except NoSuchRevision, e:
83
84
                    raise BzrCommandError(str(e))
84
85
            else:
85
 
                new = branch.working_tree()
 
86
                new = branch.bzrdir.open_workingtree()
86
87
                
87
 
 
88
88
        delta = compare_trees(old, new, want_unchanged=show_unchanged,
89
89
                              specific_files=specific_files)
90
 
 
91
90
        delta.show(to_file,
92
91
                   show_ids=show_ids,
93
92
                   show_unchanged=show_unchanged)
109
108
    print >>to_file, 'pending merges:'
110
109
    last_revision = branch.last_revision()
111
110
    if last_revision is not None:
112
 
        ignore = set(branch.get_ancestry(last_revision))
 
111
        ignore = set(branch.repository.get_ancestry(last_revision))
113
112
    else:
114
113
        ignore = set()
115
114
    for merge in new.pending_merges():
116
115
        ignore.add(merge)
117
116
        try:
118
 
            m_revision = branch.get_revision(merge)
 
117
            m_revision = branch.repository.get_revision(merge)
119
118
            print >> to_file, ' ', line_log(m_revision, 77)
120
 
            inner_merges = branch.get_ancestry(merge)
 
119
            inner_merges = branch.repository.get_ancestry(merge)
121
120
            inner_merges.reverse()
122
121
            for mmerge in inner_merges:
123
122
                if mmerge in ignore:
124
123
                    continue
125
 
                mm_revision = branch.get_revision(mmerge)
 
124
                mm_revision = branch.repository.get_revision(mmerge)
126
125
                print >> to_file, '   ', line_log(mm_revision, 75)
127
126
                ignore.add(mmerge)
128
127
        except NoSuchRevision: