# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1242230431 -7200 # Node ID 9ef720a611e08e097605f9eb6b1f90eb24e07adf # Parent 3c3c3264c36275619894f4fd07ec71f1cff0b850 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. diff --git a/hg_delta_editor.py b/hg_delta_editor.py --- 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,