diff -r 1bb2a56a9d73 -r edd06611a7c6 mercurial/commands.py --- a/mercurial/commands.py Thu Mar 10 13:43:47 2011 +0100 +++ b/mercurial/commands.py Thu Mar 10 16:49:37 2011 +0100 @@ -1175,6 +1175,7 @@ if len(items) > 1 or items and sections: raise util.Abort(_('only one config item permitted')) for section, name, value in ui.walkconfig(untrusted=untrusted): + value = str(value).replace('\n', '\\n') sectname = section + '.' + name if values: for v in values: