# File lib/fastcst/changeset.rb, line 569
569:         def initialize(source, target, path, out)
570:             @path = path
571:         
572:             # we just ignore symlinks since the real change happens in the target file
573:             @symlink =  File.symlink? @path
574:         
575:             # don't do anything if its a symlink
576:             if @symlink
577:                 UI.event :warn, "Deltas against symlinks are ignored since they are pointless"
578:             else @symlink        
579:                 # setup the remaining journal
580:                 @mtime = File.mtime(File.join(target, path))
581:             
582:                 # read the gear and do the delta
583:                 src_data = File.read(File.join(source, path))
584:                 tgt_data = File.read(File.join(target, path))
585:                 
586:                 io_out = StringIO.new
587:             
588:                 match_count, match_total, insert_count, insert_total = SuffixArrayDelta::make_delta(src_data, tgt_data, io_out)
589:             
590:                 # get the md5 hash of the delta and the target data before we write it out
591:                 if (src_data.length == tgt_data.length and match_count == 1 and match_total == src_data.length and insert_count == 0 and insert_total == 0)
592:                     # no changes actually, so we configure this command that with a 0 length
593:                     @length = 0
594:                     UI.event :same, @path
595:                 else
596:                     # there's actual changes so write it out after recording the length
597:                     UI.event :delta, @path
598:                 
599:                     @length = io_out.pos
600:                     io_out.rewind
601:                     out.write io_out.read
602:                 end
603:             end
604:         end