Example #1
0
void CRevisionGraphWnd::UnifiedDiffRevs(bool bHead)
{
    ASSERT(m_SelectedEntry1 != NULL);
    ASSERT(m_SelectedEntry2 != NULL);

    CSyncPointer<SVN> svn (m_state.GetSVN());

    CTSVNPath url1;
    CTSVNPath url2;
    SVNRev rev1;
    SVNRev rev2;
    SVNRev peg;

    GetSelected (m_SelectedEntry1, bHead, url1, rev1, peg);
    GetSelected (m_SelectedEntry2, bHead, url2, rev2, peg);

    bool alternativeTool = !!(GetAsyncKeyState(VK_SHIFT) & 0x8000);
    if (m_state.PromptShown())
    {
        SVNDiff diff (svn.get(), this->m_hWnd);
        diff.SetAlternativeTool (alternativeTool);
        diff.ShowUnifiedDiff (url1, rev1, url2, rev2, peg, L"");
    }
    else
    {
        CAppUtils::StartShowUnifiedDiff(m_hWnd, url1, rev1,
            url2, rev2, peg,
            SVNRev(), L"", alternativeTool);
    }
}
Example #2
0
bool CRevisionGraphWnd::AnalyzeRevisionData()
{
    CSyncPointer<const CFullGraph> fullGraph (m_state.GetFullGraph());
    if ((fullGraph.get() != NULL) && (fullGraph->GetNodeCount() > 0))
    {
        // filter graph

        CSyncPointer<CAllRevisionGraphOptions> options (m_state.GetOptions());
        options->Prepare();

        std::unique_ptr<CVisibleGraph> visibleGraph (new CVisibleGraph());
        CVisibleGraphBuilder builder ( *fullGraph
                                     , *visibleGraph
                                     , options->GetCopyFilterOptions());
        builder.Run();
        options->GetModificationOptions().Apply (visibleGraph.get());

        index_t index = 0;
        for (size_t i = 0, count = visibleGraph->GetRootCount(); i < count; ++i)
            index = visibleGraph->GetRoot (i)->InitIndex (index);

        // layout nodes

        std::unique_ptr<CStandardLayout> newLayout
            ( new CStandardLayout ( m_state.GetFullHistory()->GetCache()
                                  , visibleGraph.get()
                                  , m_state.GetFullHistory()->GetWCInfo()));
        options->GetLayoutOptions().Apply (newLayout.get());
        newLayout->Finalize();

        // switch state

        m_state.SetAnalysisResult (visibleGraph, newLayout);
    }

    return m_state.GetNodes().get() != NULL;
}