'Given a list of source paths and a destination path, produces the
appropriate rsync command for copying them. Remote paths must be
pre-encoded.'

def _make_rsync_cmd(self, sources, dest, delete_dest, preserve_symlinks):

    ssh_cmd = make_ssh_command(user=self.user, port=self.port, opts=self.master_ssh_option, hosts_file=self.known_hosts_file)
    if delete_dest:
        delete_flag = '--delete'
    else:
        delete_flag = ''
    if preserve_symlinks:
        symlink_flag = ''
    else:
        symlink_flag = '-L'
    command = "rsync    %s    %s    --timeout=1800    --rsh='%s'    -az    %s    %s"
    return (command % (symlink_flag, delete_flag, ssh_cmd, '    '.join(sources), dest))
