~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Alexander Belchenko
  • Date: 2006-07-31 16:12:57 UTC
  • mto: (1711.2.111 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1906.
  • Revision ID: bialix@ukr.net-20060731161257-91a231523255332c
new official bzr.ico

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
 
    parents = new.get_parent_ids()
155
 
    if len(parents) < 2:
 
154
    pending = new.pending_merges()
 
155
    branch = new.branch
 
156
    if len(pending) == 0:
156
157
        return
157
 
    pending = parents[1:]
158
 
    branch = new.branch
159
 
    last_revision = parents[0]
160
158
    print >>to_file, 'pending merges:'
 
159
    last_revision = branch.last_revision()
161
160
    if last_revision is not None:
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])
 
161
        ignore = set(branch.repository.get_ancestry(last_revision))
168
162
    else:
169
163
        ignore = set([None])
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:
 
164
    for merge in new.pending_merges():
173
165
        ignore.add(merge)
174
166
        try:
175
167
            from bzrlib.osutils import terminal_width
177
169
            m_revision = branch.repository.get_revision(merge)
178
170
            print >> to_file, ' ', line_log(m_revision, width - 3)
179
171
            inner_merges = branch.repository.get_ancestry(merge)
180
 
            assert inner_merges[0] is None
 
172
            assert inner_merges[0] == None
181
173
            inner_merges.pop(0)
182
174
            inner_merges.reverse()
183
175
            for mmerge in inner_merges: