diff mercurial/dirstate.py @ 13944:bc32bb0e909f

util: new function checkfilename checkfilename checks for restrictions on filenames imposed by Mercurial itself, irrespective of on what platform it is run.
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 15 Apr 2011 16:15:30 +0200
parents 10c7d92ac482
children 23f2736abce3
line wrap: on
line diff
--- a/mercurial/dirstate.py	Fri Apr 15 16:15:28 2011 +0200
+++ b/mercurial/dirstate.py	Fri Apr 15 16:15:30 2011 +0200
@@ -269,9 +269,7 @@
     def _addpath(self, f, check=False):
         oldstate = self[f]
         if check or oldstate == "r":
-            if '\r' in f or '\n' in f:
-                raise util.Abort(
-                    _("'\\n' and '\\r' disallowed in filenames: %r") % f)
+            util.checkfilename(f)
             if f in self._dirs:
                 raise util.Abort(_('directory %r already in dirstate') % f)
             # shadows