# HG changeset patch # User Steve Borho # Date 2010-06-08 20:52:56 # Node ID fcd06ecd4cb74797f4f1da3c9221a3200afbed29 # Parent ef7636efeb013e948b4b195d8784e97d489d281e # Parent ac873ecfc3c232dcb1271fef5f873e13261e2425 Merge backout diff --git a/hgext/churn.py b/hgext/churn.py --- a/hgext/churn.py +++ b/hgext/churn.py @@ -150,10 +150,8 @@ def churn(ui, repo, *pats, **opts): if opts.get('diffstat'): width -= 15 def format(name, (added, removed)): - return "%s %15s %s%s\n" % (ui.label(pad(name, maxname), - 'ui.plain'), - ui.label('+%d/-%d' % (added, removed), - 'ui.plain'), + return "%s %15s %s%s\n" % (pad(name, maxname), + '+%d/-%d' % (added, removed), ui.label('+' * charnum(added), 'diffstat.inserted'), ui.label('-' * charnum(removed), @@ -161,14 +159,14 @@ def churn(ui, repo, *pats, **opts): else: width -= 6 def format(name, count): - return ui.label("%s %6d %s\n" % (pad(name, maxname), sum(count), - '*' * charnum(sum(count))), 'ui.plain') + return "%s %6d %s\n" % (pad(name, maxname), sum(count), + '*' * charnum(sum(count))) def charnum(count): return int(round(count * width / maxcount)) for name, count in rate: - ui.write(format(name, count), label='ui.labeled') + ui.write(format(name, count)) cmdtable = { diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -108,9 +108,7 @@ from mercurial.i18n import _ 'status.ignored': 'black bold', 'status.modified': 'blue bold', 'status.removed': 'red bold', - 'status.unknown': 'magenta bold underline', - 'ui.labeled': 'none', - 'ui.plain': 'none'} + 'status.unknown': 'magenta bold underline'} def render_effects(text, effects): @@ -144,8 +142,6 @@ def configstyles(ui): _buffers = None def style(msg, label): - if label in ('ui.plain', 'ui.labeled'): - return msg effects = [] for l in label.split(): s = _styles.get(l, '') diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2145,17 +2145,17 @@ def guard(ui, repo, *args, **opts): ''' def status(idx): guards = q.series_guards[idx] or ['unguarded'] - out = ['%s: ' % ui.label(q.series[idx], 'qguard.patch')] + ui.write('%s: ' % ui.label(q.series[idx], 'qguard.patch')) for i, guard in enumerate(guards): if guard.startswith('+'): - out.append(ui.label(guard, 'qguard.positive')) + ui.write(guard, label='qguard.positive') elif guard.startswith('-'): - out.append(ui.label(guard, 'qguard.negative')) + ui.write(guard, label='qguard.negative') else: - out.append(ui.label(guard, 'qguard.unguarded')) + ui.write(guard, label='qguard.unguarded') if i != len(guards) - 1: - out.append(ui.label(' ', 'ui.plain')) - ui.write(''.join(out) + '\n', label='ui.labeled') + ui.write(' ') + ui.write('\n') q = repo.mq patch = None args = list(args) @@ -2800,8 +2800,7 @@ def summary(orig, ui, repo, *args, **kwa if u: m.append(ui.label(_("%d unapplied"), 'qseries.unapplied') % u) if m: - ui.write("mq: ") - ui.write(', '.join(m) + '\n', label='ui.labeled') + ui.write("mq: %s\n" % ', '.join(m)) else: ui.note(_("mq: (empty queue)\n")) return r diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3280,22 +3280,22 @@ def summary(ui, repo, **opts): cleanworkdir = False if len(parents) > 1: - t += ui.label(_(' (merge)'), 'ui.plain') + t += _(' (merge)') elif branch != parents[0].branch(): - t += ui.label(_(' (new branch)'), 'ui.plain') + t += _(' (new branch)') elif (parents[0].extra().get('close') and pnode in repo.branchheads(branch, closed=True)): - t += ui.label(_(' (head closed)'), 'ui.plain') + t += _(' (head closed)') elif (not st[0] and not st[1] and not st[2] and not st[7]): - t += ui.label(_(' (clean)'), 'ui.plain') + t += _(' (clean)') cleanworkdir = True elif pnode not in bheads: - t += ui.label(_(' (new branch head)'), 'ui.plain') + t += _(' (new branch head)') if cleanworkdir: - ui.status(_('commit: %s\n') % t.strip(), label='ui.labeled') + ui.status(_('commit: %s\n') % t.strip()) else: - ui.write(_('commit: %s\n') % t.strip(), label='ui.labeled') + ui.write(_('commit: %s\n') % t.strip()) # all ancestors of branch heads - all ancestors of parent = new csets new = [0] * len(repo) diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -546,9 +546,5 @@ class ui(object): ui.write(s, 'label') is equivalent to ui.write(ui.label(s, 'label')). - - Callers of ui.label() should pass labeled text back to - ui.write() with a label of 'ui.labeled' so implementations know - that the text has already been escaped and marked up. ''' return msg