~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-14 16:16:53 UTC
  • mto: (1946.2.6 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1919.
  • Revision ID: john@arbash-meinel.com-20060814161653-54cdcdadcd4e9003
Remove bogus entry from BRANCH.TODO

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.symbol_versioning import (deprecated_function,
24
24
        zero_eight,
25
25
        )
26
 
from bzrlib.trace import warning
27
26
 
28
27
# TODO: when showing single-line logs, truncate to the width of the terminal
29
28
# if known, but only if really going to the terminal (not into a file)
113
112
    try:
114
113
        new_is_working_tree = True
115
114
        if revision is None:
116
 
            if wt.last_revision() != wt.branch.last_revision():
117
 
                warning("working tree is out of date, run 'bzr update'")
118
115
            new = wt
119
116
            old = new.basis_tree()
120
117
        elif len(revision) > 0:
154
151
 
155
152
def show_pending_merges(new, to_file):
156
153
    """Write out a display of pending merges in a working tree."""
157
 
    parents = new.get_parent_ids()
158
 
    if len(parents) < 2:
 
154
    pending = new.pending_merges()
 
155
    branch = new.branch
 
156
    if len(pending) == 0:
159
157
        return
160
 
    pending = parents[1:]
161
 
    branch = new.branch
162
 
    last_revision = parents[0]
163
158
    print >>to_file, 'pending merges:'
 
159
    last_revision = branch.last_revision()
164
160
    if last_revision is not None:
165
 
        try:
166
 
            ignore = set(branch.repository.get_ancestry(last_revision))
167
 
        except errors.NoSuchRevision:
168
 
            # the last revision is a ghost : assume everything is new 
169
 
            # except for it
170
 
            ignore = set([None, last_revision])
 
161
        ignore = set(branch.repository.get_ancestry(last_revision))
171
162
    else:
172
163
        ignore = set([None])
173
 
    # TODO: this could be improved using merge_sorted - we'd get the same 
174
 
    # output rather than one level of indent.
175
 
    for merge in pending:
 
164
    for merge in new.pending_merges():
176
165
        ignore.add(merge)
177
166
        try:
178
167
            from bzrlib.osutils import terminal_width
180
169
            m_revision = branch.repository.get_revision(merge)
181
170
            print >> to_file, ' ', line_log(m_revision, width - 3)
182
171
            inner_merges = branch.repository.get_ancestry(merge)
183
 
            assert inner_merges[0] is None
 
172
            assert inner_merges[0] == None
184
173
            inner_merges.pop(0)
185
174
            inner_merges.reverse()
186
175
            for mmerge in inner_merges: