changeset 335:9ef720a611e0

HgChangeReceiver: better diagnostics for invalid links Issue better diagnostics when something pretends to be a link, but isn't. This was reported by `doub' on #mercurial.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 13 May 2009 18:00:31 +0200
parents 3c3c3264c362
children c0b943cef0c3
files hg_delta_editor.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hg_delta_editor.py
+++ b/hg_delta_editor.py
@@ -690,9 +690,11 @@ class HgChangeReceiver(delta.Editor):
                 is_link = self.current_files_symlink.get(current_file, 'l' in flags)
                 if current_file in self.current_files:
                     data = self.current_files[current_file]
-                    if is_link:
-                        assert data.startswith('link ')
+                    if is_link and data.startswith('link '):
                         data = data[len('link '):]
+                    elif is_link:
+                        raise ValueError('file erronously marked as a link: '
+                                         '%s (%r)' % (current_file, flags))
                 else:
                     data = parent_ctx.filectx(path).data()
                 return context.memfilectx(path=path,