Esempio n. 1
0
bool SVNLineDiff::Diff(svn_diff_t **diff, LPCTSTR line1, apr_size_t len1, LPCTSTR line2, apr_size_t len2, bool bWordDiff)
{
    if (m_subpool)
        svn_pool_clear(m_subpool);
    else
        m_subpool = svn_pool_create(m_pool);

    if (m_subpool == NULL)
        return false;

    m_bWordDiff = bWordDiff;
    m_line1 = line1;
    m_line2 = line2;
    m_line1length = len1 ? len1 : wcslen(m_line1);
    m_line2length = len2 ? len2 : wcslen(m_line2);

    m_line1pos = 0;
    m_line2pos = 0;
    m_line1tokens.clear();
    m_line2tokens.clear();
    svn_error_t * err = svn_diff_diff_2(diff, this, &SVNLineDiff_vtable, m_subpool);
    if (err)
    {
        svn_error_clear(err);
        svn_pool_clear(m_subpool);
        return false;
    }
    return true;
}
Esempio n. 2
0
/*** From diff.c ***/
svn_error_t *
svn_diff_diff(svn_diff_t **diff,
              void *diff_baton,
              const svn_diff_fns_t *vtable,
              apr_pool_t *pool)
{
  svn_diff_fns2_t *diff_fns2;
  struct fns_wrapper_baton *fwb;

  wrap_diff_fns(&diff_fns2, &fwb, vtable, diff_baton, pool);
  return svn_diff_diff_2(diff, fwb, diff_fns2, pool);
}