comparison hg_delta_editor.py @ 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 75f082b5897e
children
comparison
equal deleted inserted replaced
334:3c3c3264c362 335:9ef720a611e0
688 flags = parent_ctx.flags(path) 688 flags = parent_ctx.flags(path)
689 is_exec = self.current_files_exec.get(current_file, 'x' in flags) 689 is_exec = self.current_files_exec.get(current_file, 'x' in flags)
690 is_link = self.current_files_symlink.get(current_file, 'l' in flags) 690 is_link = self.current_files_symlink.get(current_file, 'l' in flags)
691 if current_file in self.current_files: 691 if current_file in self.current_files:
692 data = self.current_files[current_file] 692 data = self.current_files[current_file]
693 if is_link: 693 if is_link and data.startswith('link '):
694 assert data.startswith('link ')
695 data = data[len('link '):] 694 data = data[len('link '):]
695 elif is_link:
696 raise ValueError('file erronously marked as a link: '
697 '%s (%r)' % (current_file, flags))
696 else: 698 else:
697 data = parent_ctx.filectx(path).data() 699 data = parent_ctx.filectx(path).data()
698 return context.memfilectx(path=path, 700 return context.memfilectx(path=path,
699 data=data, 701 data=data,
700 islink=is_link, isexec=is_exec, 702 islink=is_link, isexec=is_exec,