~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
 
152
152
def show_pending_merges(new, to_file):
153
153
    """Write out a display of pending merges in a working tree."""
154
 
    pending = new.pending_merges()
 
154
    parents = new.get_parent_ids()
 
155
    if len(parents) < 2:
 
156
        return
 
157
    pending = parents[1:]
155
158
    branch = new.branch
156
 
    if len(pending) == 0:
157
 
        return
 
159
    last_revision = parents[0]
158
160
    print >>to_file, 'pending merges:'
159
 
    last_revision = branch.last_revision()
160
161
    if last_revision is not None:
161
 
        ignore = set(branch.repository.get_ancestry(last_revision))
 
162
        try:
 
163
            ignore = set(branch.repository.get_ancestry(last_revision))
 
164
        except errors.NoSuchRevision:
 
165
            # the last revision is a ghost : assume everything is new 
 
166
            # except for it
 
167
            ignore = set([None, last_revision])
162
168
    else:
163
169
        ignore = set([None])
164
 
    for merge in new.pending_merges():
 
170
    # TODO: this could be improved using merge_sorted - we'd get the same 
 
171
    # output rather than one level of indent.
 
172
    for merge in pending:
165
173
        ignore.add(merge)
166
174
        try:
167
175
            from bzrlib.osutils import terminal_width
169
177
            m_revision = branch.repository.get_revision(merge)
170
178
            print >> to_file, ' ', line_log(m_revision, width - 3)
171
179
            inner_merges = branch.repository.get_ancestry(merge)
172
 
            assert inner_merges[0] == None
 
180
            assert inner_merges[0] is None
173
181
            inner_merges.pop(0)
174
182
            inner_merges.reverse()
175
183
            for mmerge in inner_merges: