--- a/mercurial/dirstate.py Tue Oct 31 18:10:23 2006 -0800
+++ b/mercurial/dirstate.py Wed Nov 01 17:56:55 2006 +0100
@@ -211,7 +211,7 @@
self.dirs.setdefault(pc, 0)
self.dirs[pc] += delta
- def checkshadows(self, files):
+ def checkinterfering(self, files):
def prefixes(f):
for c in strutil.rfindall(f, '/'):
yield f[:c]
@@ -219,6 +219,7 @@
self.initdirs()
seendirs = {}
for f in files:
+ # shadows
if self.dirs.get(f):
raise util.Abort(_('directory named %r already in dirstate') %
f)
@@ -229,6 +230,9 @@
raise util.Abort(_('file named %r already in dirstate') %
d)
seendirs[d] = True
+ # disallowed
+ if '\r' in f or '\n' in f:
+ raise util.Abort(_("'\\n' and '\\r' disallowed in filenames"))
def update(self, files, state, **kw):
''' current states:
@@ -242,7 +246,7 @@
self.markdirty()
if state == "a":
self.initdirs()
- self.checkshadows(files)
+ self.checkinterfering(files)
for f in files:
if state == "r":
self.map[f] = ('r', 0, 0, 0)