~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Robey Pointer
  • Date: 2006-09-03 00:28:18 UTC
  • mfrom: (1981 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1996.
  • Revision ID: robey@lag.net-20060903002818-71ca5c7bfea93a26
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