changeset 5045:8b1ee1f59b3c

dirstate: improve error message on file/directory clash
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 01 Aug 2007 12:03:10 -0700
parents 49059086c634
children ed68c8c31c9a
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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):