diff -r 366fa83f9820 -r 23f2736abce3 mercurial/scmutil.py --- a/mercurial/scmutil.py Thu Apr 21 12:10:03 2011 +0200 +++ b/mercurial/scmutil.py Thu Apr 21 13:18:52 2011 +0200 @@ -9,9 +9,14 @@ import util, error import os, errno, stat +def checkfilename(f): + '''Check that the filename f is an acceptable filename for a tracked file''' + if '\r' in f or '\n' in f: + raise util.Abort(_("'\\n' and '\\r' disallowed in filenames: %r") % f) + def checkportable(ui, f): '''Check if filename f is portable and warn or abort depending on config''' - util.checkfilename(f) + checkfilename(f) val = ui.config('ui', 'portablefilenames', 'warn') lval = val.lower() abort = os.name == 'nt' or lval == 'abort'