# HG changeset patch # User Matt Mackall # Date 1329777771 21600 # Node ID 68007f0557de5cf7c37d117a19dac121bbbfbde9 # Parent ae5f92e154d31098719c11c22135ea3306456319 formatter: convert status command diff -r ae5f92e154d3 -r 68007f0557de mercurial/commands.py --- a/mercurial/commands.py Mon Feb 20 16:42:48 2012 -0600 +++ b/mercurial/commands.py Mon Feb 20 16:42:51 2012 -0600 @@ -5277,18 +5277,22 @@ if (opts.get('all') or opts.get('copies')) and not opts.get('no_status'): copy = copies.pathcopies(repo[node1], repo[node2]) + fm = ui.formatter('status', opts) + format = '%s %s' + end + if opts.get('no_status'): + format = '%.0s%s' + end + for state, char, files in changestates: if state in show: - format = "%s %%s%s" % (char, end) - if opts.get('no_status'): - format = "%%s%s" % end - + label = 'status.' + state for f in files: - ui.write(format % repo.pathto(f, cwd), - label='status.' + state) + fm.startitem() + fm.write("status char", format, char, + repo.pathto(f, cwd), label=label) if f in copy: - ui.write(' %s%s' % (repo.pathto(copy[f], cwd), end), + fm.write("copy", ' %s' + end, repo.pathto(copy[f], cwd), label='status.copied') + fm.end() @command('^summary|sum', [('', 'remote', None, _('check for push and pull'))], '[--remote]')