dirstate: improve error message on file/directory clash
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 01 Aug 2007 12:03:10 -0700
changeset 5045 8b1ee1f59b3c
parent 5041 49059086c634
child 5046 ed68c8c31c9a
dirstate: improve error message on file/directory clash
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Aug 01 09:57:05 2007 -0700
+++ b/mercurial/dirstate.py	Wed Aug 01 12:03:10 2007 -0700
@@ -191,13 +191,14 @@
             raise util.Abort(_("'\\n' and '\\r' disallowed in filenames"))
         # shadows
         if f in self._dirs:
-            raise util.Abort(_('directory named %r already in dirstate') % f)
+            raise util.Abort(_('directory %r already in dirstate') % f)
         for c in strutil.rfindall(f, '/'):
             d = f[:c]
             if d in self._dirs:
                 break
             if d in self._map:
-                raise util.Abort(_('file named %r already in dirstate') % d)
+                raise util.Abort(_('file %r in dirstate clashes with %r') %
+                                 (d, f))
         self._incpath(f)
 
     def normal(self, f):