当前位置: 首页>>代码示例>>C++>>正文


C++ SVN类代码示例

本文整理汇总了C++中SVN的典型用法代码示例。如果您正苦于以下问题:C++ SVN类的具体用法?C++ SVN怎么用?C++ SVN使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SVN类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnButtonClicked

HRESULT CNewTreeConflictEditorDlg::OnButtonClicked(HWND hWnd, int id)
{
    for (SVNConflictOptions::const_iterator it = m_options.begin(); it != m_options.end(); ++it)
    {
        svn_client_conflict_option_id_t optionId = (*it)->GetId();
        if (optionId + 100 == id)
        {
            if (m_svn)
            {
                if (!m_svn->ResolveTreeConflict(*m_conflictInfo, *it->get()))
                {
                    m_svn->ShowErrorDialog(hWnd);
                    return S_FALSE;
                }
            }
            else
            {
                SVN svn;
                if (!svn.ResolveTreeConflict(*m_conflictInfo, *it->get()))
                {
                    svn.ShowErrorDialog(hWnd);
                    return S_FALSE;
                }
            }
            m_choice = optionId;
            return S_OK;
        }
    }

    return S_OK;
}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:31,代码来源:NewTreeConflictEditorDlg.cpp

示例2: UpdateData

void CUpdateDlg::OnBnClickedSparse()
{
    UpdateData();

    CString strURLs;

    CTSVNPathList paths;
    paths.LoadFromAsteriskSeparatedString (strURLs);

    SVN svn;
    CString strUrl = svn.GetURLFromPath(m_wcPath);

    CRepositoryBrowser browser(strUrl, SVNRev::REV_HEAD, this);
    browser.SetSparseCheckoutMode(m_wcPath);
    if (browser.DoModal() == IDOK)
    {
        m_checkoutDepths = browser.GetUpdateDepths();
        CString sCustomDepth = CString(MAKEINTRESOURCE(IDS_SVN_DEPTH_CUSTOM));
        int customIndex = m_depthCombo.FindStringExact(-1, sCustomDepth);
        if (customIndex == CB_ERR)
        {
            customIndex = m_depthCombo.AddString(sCustomDepth);
        }
        m_depthCombo.SetCurSel(customIndex);
    }
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例3: main

int main ( int argc, const char* argv[] )
{
    Configuration config ( "svnbot.conf" );
    if ( config.isOk () )
    {
        struct SVNData
        {
            SVN svn;
            int lastRev;
        };

        SkypeConnector connector ( config.getSkypeName().c_str() );

        // Load the repositories from the config and get the initial revision
        puts ( "Fetching initial revisions...");
        std::map<std::string, SVNData> repos;
        for ( auto& repo : config.getRepos() )
        {
            printf ( "\t[%s] ", repo.first.c_str() );
            fflush ( stdout );

            SVN svn ( repo.second );
            int lastRev = svn.getRevision ();
            printf ( "%d\n", lastRev );

            repos[repo.first] = {svn, lastRev};
        }

        // Poll
        while ( true )
        {
            puts ( "Polling...");
            for ( auto& repo : repos )
            {
                printf ( "\t[%s] %d -> ", repo.first.c_str(), repo.second.lastRev );
                fflush ( stdout );

                auto& data = repo.second;
                int rev = data.svn.getRevision ();
                printf ( "%d\n", rev );

                while ( rev > data.lastRev )
                {
                    data.lastRev++;
                    std::string log;
                    data.svn.getLog ( data.lastRev, &log );
                    if ( log.length() > 0 )
                        connector.send ( "CHATMESSAGE %s [%s]\n%s", config.getSkypeChannel().c_str(), repo.first.c_str(), log.c_str() );
                }
            }

            sleep ( config.getPollInterval() );
        }
    }
    return EXIT_SUCCESS;
}
开发者ID:ryden,项目名称:SkypeSVNBot,代码行数:56,代码来源:main.cpp

示例4: OnButtonClicked

HRESULT CTextConflictEditorDlg::OnButtonClicked(HWND hWnd, int id)
{
    if (id == 1000)
    {
        // Edit conflicts
        CTSVNPath theirs, mine, base;
        m_merged = m_conflictInfo->GetPath();
        m_conflictInfo->GetTextContentFiles(base, theirs, mine);
        m_mergedCreationTime = m_merged.GetLastWriteTime();
        ::SendMessage(hWnd, TDM_ENABLE_BUTTON, 100 + svn_client_conflict_option_merged_text, 0);

        CString filename, n1, n2, n3, n4;
        filename = m_merged.GetUIFileOrDirectoryName();
        n1.Format(IDS_DIFF_WCNAME, (LPCTSTR)filename);
        n2.Format(IDS_DIFF_BASENAME, (LPCTSTR)filename);
        n3.Format(IDS_DIFF_REMOTENAME, (LPCTSTR)filename);
        n4.Format(IDS_DIFF_MERGEDNAME, (LPCTSTR)filename);

        CAppUtils::MergeFlags flags;
        flags.AlternativeTool((GetKeyState(VK_SHIFT) & 0x8000) != 0);
        flags.PreventSVNResolve(true);
        CAppUtils::StartExtMerge(flags,
                                 base, theirs, mine, m_merged, true, n1, n1, n3, n4, filename);
        return S_FALSE;
    }
    for (SVNConflictOptions::const_iterator it = m_options.begin(); it != m_options.end(); ++it)
    {
        svn_client_conflict_option_id_t optionId = (*it)->GetId();
        int buttonID = 100 + optionId;

        if (buttonID == id)
        {
            if (m_svn)
            {
                if (!m_svn->ResolveTextConflict(*m_conflictInfo, *it->get()))
                {
                    m_svn->ShowErrorDialog(hWnd);
                    return S_FALSE;
                }
            }
            else
            {
                SVN svn;
                if (!svn.ResolveTextConflict(*m_conflictInfo, *it->get()))
                {
                    svn.ShowErrorDialog(hWnd);
                    return S_FALSE;
                }
            }
            m_choice = optionId;
            return S_OK;
        }
    }

    return S_OK;
}
开发者ID:YueLinHo,项目名称:TortoiseSvn,代码行数:56,代码来源:TextConflictEditorDlg.cpp

示例5: taskdlg

bool RenameCommand::RenameWithReplace(HWND hWnd, const CTSVNPathList &srcPathList,
                                      const CTSVNPath &destPath,
                                      const CString &message /* = L"" */,
                                      bool move_as_child /* = false */,
                                      bool make_parents /* = false */) const
{
    SVN svn;
    UINT idret = IDYES;
    bool bRet = true;
    if (destPath.Exists() && !destPath.IsDirectory() && !destPath.IsEquivalentToWithoutCase(srcPathList[0]))
    {
        CString sReplace;
        sReplace.Format(IDS_PROC_REPLACEEXISTING, destPath.GetWinPath());

        CTaskDialog taskdlg(sReplace,
                            CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK2)),
                            L"TortoiseSVN",
                            0,
                            TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW);
        taskdlg.AddCommandControl(1, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK3)));
        taskdlg.AddCommandControl(2, CString(MAKEINTRESOURCE(IDS_PROC_REPLACEEXISTING_TASK4)));
        taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
        taskdlg.SetDefaultCommandControl(2);
        taskdlg.SetMainIcon(TD_WARNING_ICON);
        INT_PTR ret = taskdlg.DoModal(hWnd);
        if (ret == 1) // replace
            idret = IDYES;
        else
            idret = IDNO;

        if (idret == IDYES)
        {
            if (!svn.Remove(CTSVNPathList(destPath), true, false))
            {
                destPath.Delete(true);
            }
        }
    }
    if ((idret != IDNO)&&(!svn.Move(srcPathList, destPath, message, move_as_child, make_parents)))
    {
        auto apr_err = svn.GetSVNError()->apr_err;
        if ((apr_err == SVN_ERR_ENTRY_NOT_FOUND) || (apr_err == SVN_ERR_WC_PATH_NOT_FOUND))
        {
            bRet = !!MoveFile(srcPathList[0].GetWinPath(), destPath.GetWinPath());
        }
        else
        {
            svn.ShowErrorDialog(hWnd, srcPathList.GetCommonDirectory());
            bRet = false;
        }
    }
    if (idret == IDNO)
        bRet = false;
    return bRet;
}
开发者ID:fatterbetter,项目名称:ZTools,代码行数:55,代码来源:RenameCommand.cpp

示例6: UpdateFullHistory

void CRevisionGraphDlg::UpdateFullHistory()
{
    m_Graph.SetDlgTitle (false);

    SVN svn;
    LogCache::CRepositoryInfo& cachedProperties
        = svn.GetLogCachePool()->GetRepositoryInfo();
    CString root = m_Graph.m_state.GetRepositoryRoot();
    CString uuid = m_Graph.m_state.GetRepositoryUUID();

    cachedProperties.ResetHeadRevision (uuid, root);

    m_bFetchLogs = true;
    StartWorkerThread();
}
开发者ID:Kasper8660,项目名称:tortoisesvn,代码行数:15,代码来源:RevisionGraphDlg.cpp

示例7: builder

bool CRevisionGraphWnd::FetchRevisionData
    ( const CString& path
    , SVNRev pegRevision
    , CProgressDlg* progress
    , ITaskbarList3 * pTaskbarList
    , HWND hWnd)
{
    // (re-)fetch the data
    SVN svn;
    if (svn.GetRepositoryRoot(CTSVNPath(path)) == svn.GetURLFromPath(CTSVNPath(path)))
    {
        m_state.SetLastErrorMessage(CString(MAKEINTRESOURCE(IDS_REVGRAPH_ERR_NOGRAPHFORROOT)));
        return false;
    }

    std::unique_ptr<CFullHistory> newFullHistory (new CFullHistory());

    bool showWCRev
        = m_state.GetOptions()->GetOption<CShowWC>()->IsSelected();
    bool showWCModification
        = m_state.GetOptions()->GetOption<CShowWCModification>()->IsSelected();
    bool result = newFullHistory->FetchRevisionData ( path
                                                    , pegRevision
                                                    , showWCRev
                                                    , showWCModification
                                                    , progress
                                                    , pTaskbarList
                                                    , hWnd);

    m_state.SetLastErrorMessage (newFullHistory->GetLastErrorMessage());

    if (result)
    {
        std::unique_ptr<CFullGraph> newFullGraph (new CFullGraph());

        CFullGraphBuilder builder (*newFullHistory, *newFullGraph);
        builder.Run();

        CFullGraphFinalizer finalizer (*newFullHistory, *newFullGraph);
        finalizer.Run();

        m_state.SetQueryResult ( newFullHistory
                               , newFullGraph
                               , showWCRev || showWCModification);
    }

    return result;
}
开发者ID:,项目名称:,代码行数:48,代码来源:

示例8: GetSelectedRepo

void CSettingsLogCaches::OnBnClickedExport()
{
    TRepo repo = GetSelectedRepo();
    if (!repo.first.IsEmpty())
    {
        CString path;
        if (CAppUtils::FileOpenSave(path, NULL, IDS_SETTINGS_LOGCACHE_EXPORT, IDS_LOGCACHE_EXPORTFILTER, false, CString(), GetSafeHwnd()))
        {
            SVN svn;
            CCachedLogInfo* cache
                = svn.GetLogCachePool()->GetCache (repo.second, repo.first);
            CCSVWriter writer;
            writer.Write(*cache, (LPCTSTR)path);
        }
    }
}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:16,代码来源:SettingsLogCaches.cpp

示例9: CString

void CEditPropExternals::OnBnClickedFindhead()
{
    CProgressDlg progDlg;
    progDlg.ShowModal(m_hWnd, TRUE);
    progDlg.SetTitle(IDS_EDITPROPS_PROG_FINDHEADTITLE);
    progDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_EDITPROPS_PROG_FINDHEADROOTS)));
    DWORD count = 0;
    DWORD total = (DWORD)m_externals.size()*4;
    SVN svn;
    svn.SetPromptParentWindow(m_hWnd);
    SVNInfo svnInfo;
    svnInfo.SetPromptParentWindow(m_hWnd);
    for (auto it = m_externals.begin(); it != m_externals.end(); ++it)
    {
        progDlg.SetProgress(count++, total);
        if (progDlg.HasUserCancelled())
            break;
        if (it->root.IsEmpty())
        {
            CTSVNPath p = it->path;
            p.AppendPathString(it->targetDir);
            it->root = svn.GetRepositoryRoot(p);
        }
    }

    progDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_EDITPROPS_PROG_FINDHEADREVS)));
    SVNLogHelper logHelper;
    for (auto it = m_externals.begin(); it != m_externals.end(); ++it)
    {
        progDlg.SetProgress(count, total);
        progDlg.SetLine(2, it->url, true);
        if (progDlg.HasUserCancelled())
            break;
        count += 4;
        if (!it->root.IsEmpty())
        {
            auto youngestRev = logHelper.GetYoungestRev(CTSVNPath(it->fullurl));
            if (!youngestRev.IsValid())
                it->headrev = svn.GetHEADRevision(CTSVNPath(it->fullurl), true);
            else
                it->headrev = youngestRev;
        }
    }
    progDlg.Stop();
    m_ExtList.Invalidate();
}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:46,代码来源:EditPropExternals.cpp

示例10: Shelve

bool ShelveCommand::Shelve(const CString& shelveName, const CTSVNPathList& paths)
{
    CProgressDlg progDlg;
    progDlg.SetTitle(IDS_PROC_PATCHTITLE);
    progDlg.SetShowProgressBar(false);
    progDlg.ShowModeless(CWnd::FromHandle(GetExplorerHWND()));

    CTSVNPath sDir = paths.GetCommonRoot();
    SVN svn;
    if (!svn.Shelve(shelveName, paths, svn_depth_infinity /*, changelists*/))
    {
        progDlg.Stop();
        svn.ShowErrorDialog(GetExplorerHWND(), sDir);
        return FALSE;
    }

    progDlg.Stop();

    return TRUE;
}
开发者ID:YueLinHo,项目名称:TortoiseSvn,代码行数:20,代码来源:ShelveCommand.cpp

示例11: EndDialog

void CTreeConflictEditorDlg::OnBnClickedResolveusingtheirs()
{
    int retVal = IDOK;
    if (m_bInteractive)
    {
        m_choice = svn_wc_conflict_choose_merged;
        EndDialog(retVal);
    }
    else
    {
        SVN svn;
        if (!svn.Resolve(m_path, svn_wc_conflict_choose_merged, false, true, svn_wc_conflict_kind_tree))
        {
            svn.ShowErrorDialog(m_hWnd, m_path);
            retVal = IDCANCEL;
        }
        else
            m_choice = svn_wc_conflict_choose_merged;
        EndDialog(retVal);
    }
}
开发者ID:memoarfaa,项目名称:tortoisesvn,代码行数:21,代码来源:TreeConflictEditorDlg.cpp

示例12: SetIcon

BOOL CMergeWizard::OnInitDialog()
{
    BOOL bResult = CResizableSheetEx::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    SetIcon(m_hIcon, TRUE);         // Set big icon
    SetIcon(m_hIcon, FALSE);        // Set small icon

    SVN svn;
    url = svn.GetURLFromPath(wcPath);
    sUUID = svn.GetUUIDFromPath(wcPath);

    MARGINS margs;
    margs.cxLeftWidth = 0;
    margs.cyTopHeight = 0;
    margs.cxRightWidth = 0;
    margs.cyBottomHeight = BOTTOMMARG;

    if ((DWORD)CRegDWORD(L"Software\\TortoiseSVN\\EnableDWMFrame", TRUE))
    {
        HIGHCONTRAST hc = { sizeof(HIGHCONTRAST) };
        SystemParametersInfo(SPI_GETHIGHCONTRAST, sizeof(HIGHCONTRAST), &hc, FALSE);
        BOOL bEnabled = FALSE;
        if (((hc.dwFlags & HCF_HIGHCONTRASTON) == 0) && SUCCEEDED(DwmIsCompositionEnabled(&bEnabled)) && bEnabled)
        {
            DwmExtendFrameIntoClientArea(m_hWnd, &margs);
            ShowGrip(false);
        }
        m_aeroControls.SubclassOkCancelHelp(this);
        m_aeroControls.SubclassControl(this, ID_WIZFINISH);
        m_aeroControls.SubclassControl(this, ID_WIZBACK);
        m_aeroControls.SubclassControl(this, ID_WIZNEXT);
    }

    if ((m_pParentWnd == NULL) && (GetExplorerHWND()))
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(L"MergeWizard");

    return bResult;
}
开发者ID:yuexiaoyun,项目名称:tortoisesvn,代码行数:40,代码来源:MergeWizard.cpp

示例13: while

void CSettingsLogCaches::FillRepositoryList()
{
    int count = m_cRepositoryList.GetItemCount();
    while (count > 0)
        m_cRepositoryList.DeleteItem (--count);

    SVN svn;
    CLogCachePool* caches = svn.GetLogCachePool();
    repos = caches->GetRepositoryURLs();

    for (IT iter = repos.begin(), end = repos.end(); iter != end; ++iter, ++count)
    {
        CString url = iter->first;

        m_cRepositoryList.InsertItem (count, url);
        size_t fileSize = caches->FileSize (iter->second, url) / 1024;

        CString sizeText;
        sizeText.Format(L"%Iu", fileSize);
        m_cRepositoryList.SetItemText (count, 1, sizeText);
    }
}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:22,代码来源:SettingsLogCaches.cpp

示例14: OnOK

void CCreatePatch::OnOK()
{
    if (m_bThreadRunning)
        return;

    int nListItems = m_PatchList.GetItemCount();
    m_filesToRevert.Clear();

    for (int j=0; j<nListItems; j++)
    {
        const CSVNStatusListCtrl::FileEntry * entry = m_PatchList.GetConstListEntry(j);
        if (entry->IsChecked())
        {
            // Unversioned files are not included in the resulting patch file!
            // We add those files to a list which will be used to add those files
            // before creating the patch.
            if ((entry->status == svn_wc_status_none)||(entry->status == svn_wc_status_unversioned))
            {
                m_filesToRevert.AddPath(entry->GetPath());
            }
        }
    }

    if (m_filesToRevert.GetCount())
    {
        // add all unversioned files to version control
        // so they're included in the resulting patch
        // NOTE: these files must be reverted after the patch
        // has been created! Since this dialog doesn't create the patch
        // itself, the calling function is responsible to revert these files!
        SVN svn;
        svn.Add(m_filesToRevert, NULL, svn_depth_empty, false, false, false, true);
    }

    //save only the files the user has selected into the path list
    m_PatchList.WriteCheckedNamesToPathList(m_pathList);

    CResizableStandAloneDialog::OnOK();
}
开发者ID:,项目名称:,代码行数:39,代码来源:

示例15: CString

void CRepoCreationFinished::OnBnClickedCreatefolders()
{
    // create the default folder structure in a temp folder
    CTSVNPath tempDir = CTempFiles::Instance().GetTempDirPath(true);
    if (tempDir.IsEmpty())
    {
        ::MessageBox(m_hWnd, CString(MAKEINTRESOURCE(IDS_ERR_CREATETEMPDIR)), CString(MAKEINTRESOURCE(IDS_APPNAME)), MB_ICONERROR);
        return;
    }
    CTSVNPath tempDirSub = tempDir;
    tempDirSub.AppendPathString(L"trunk");
    CreateDirectory(tempDirSub.GetWinPath(), NULL);
    tempDirSub = tempDir;
    tempDirSub.AppendPathString(L"branches");
    CreateDirectory(tempDirSub.GetWinPath(), NULL);
    tempDirSub = tempDir;
    tempDirSub.AppendPathString(L"tags");
    CreateDirectory(tempDirSub.GetWinPath(), NULL);

    CString url;
    if (m_RepoPath.GetWinPathString().GetAt(0) == '\\')    // starts with '\' means an UNC path
    {
        CString p = m_RepoPath.GetWinPathString();
        p.TrimLeft('\\');
        url = L"file://"+p;
    }
    else
        url = L"file:///"+m_RepoPath.GetWinPathString();

    // import the folder structure into the new repository
    SVN svn;
    if (!svn.Import(tempDir, CTSVNPath(url), CString(MAKEINTRESOURCE(IDS_MSG_IMPORTEDSTRUCTURE)), NULL, svn_depth_infinity, true, true, false))
    {
        svn.ShowErrorDialog(m_hWnd);
        return;
    }
    MessageBox(CString(MAKEINTRESOURCE(IDS_MSG_IMPORTEDSTRUCTUREFINISHED)), L"TortoiseSVN", MB_ICONINFORMATION);
    DialogEnableWindow(IDC_CREATEFOLDERS, FALSE);
}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:39,代码来源:RepoCreationFinished.cpp


注:本文中的SVN类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。