~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: John Arbash Meinel
  • Date: 2008-05-05 20:29:06 UTC
  • mto: This revision was merged to the branch mainline in revision 3407.
  • Revision ID: john@arbash-meinel.com-20080505202906-0utn8d1ti6458rea
Ian's review feedback

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
    :param revision_ids: A set of revision_ids
158
158
    :param parent_map: The parent information for each node. Revisions which
159
159
        are considered ghosts should not be present in the map.
160
 
    :return: An the iterator from MergeSorter.iter_topo_order()
 
160
    :return: iterator from MergeSorter.iter_topo_order()
161
161
    """
162
162
    # MergeSorter requires that all nodes be present in the graph, so get rid
163
163
    # of any references pointing outside of this graph.
175
175
 
176
176
def show_pending_merges(new, to_file, short=False):
177
177
    """Write out a display of pending merges in a working tree."""
 
178
    parents = new.get_parent_ids()
 
179
    if len(parents) < 2:
 
180
        return
 
181
 
178
182
    # we need one extra space for terminals that wrap on last char
179
183
    term_width = osutils.terminal_width() - 1
180
184
    if short:
184
188
        first_prefix = '  '
185
189
        sub_prefix = '    '
186
190
 
187
 
    parents = new.get_parent_ids()
188
 
    if len(parents) < 2:
189
 
        return
190
191
    pending = parents[1:]
191
192
    branch = new.branch
192
193
    last_revision = parents[0]
193
194
    if not short:
194
195
        to_file.write('pending merges:\n')
195
 
    ignore = set([None, last_revision, _mod_revision.NULL_REVISION])
196
196
    graph = branch.repository.get_graph()
197
197
    other_revisions = [last_revision]
198
198
    log_formatter = log.LineLogFormatter(to_file)
239
239
            raise AssertionError('Somehow we misunderstood how'
240
240
                ' iter_topo_order works %s != %s' % (first, merge))
241
241
        for num, sub_merge, depth, eom in rev_id_iterator:
242
 
            if sub_merge in ignore:
243
 
                continue
244
242
            rev = revisions[sub_merge]
245
243
            if rev is None:
246
244
                to_file.write(sub_prefix + '(ghost) ' + sub_merge + '\n')