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


C++ SVNRev::IsHead方法代码示例

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


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

示例1: SetEndRevision

void CMergeWizardTree::SetEndRevision(const SVNRev& rev)
{
    if (rev.IsHead())
        CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
    else
    {
        CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
        m_sEndRev = rev.ToString();
        UpdateData(FALSE);
    }
}
开发者ID:Kasper8660,项目名称:tortoisesvn,代码行数:11,代码来源:MergeWizardTree.cpp

示例2: SetRevision

void CSwitchDlg::SetRevision(const SVNRev& rev)
{
	if (rev.IsHead())
		CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
	else
	{
		CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
		m_rev = rev.ToString();
		UpdateData(FALSE);
	}
}
开发者ID:fatterbetter,项目名称:ZTools,代码行数:11,代码来源:SwitchDlg.cpp

示例3: SetRevision

void CExportDlg::SetRevision(const SVNRev& rev)
{
    if (rev.IsHead())
        CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
    else
    {
        CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
        CString sRev;
        sRev.Format(L"%ld", (LONG)rev);
        SetDlgItemText(IDC_REVISION_NUM, sRev);
    }
}
开发者ID:Kasper8660,项目名称:tortoisesvn,代码行数:12,代码来源:ExportDlg.cpp

示例4: SetRevision

void CCopyDlg::SetRevision(const SVNRev& rev)
{
    if (rev.IsHead())
    {
        CheckRadioButton(IDC_COPYHEAD, IDC_COPYREV, IDC_COPYHEAD);
    }
    else if (rev.IsWorking())
    {
        CheckRadioButton(IDC_COPYHEAD, IDC_COPYREV, IDC_COPYWC);
    }
    else
    {
        CheckRadioButton(IDC_COPYHEAD, IDC_COPYREV, IDC_COPYREV);
        CString temp;
        temp.Format(L"%ld", (LONG)rev);
        SetDlgItemText(IDC_COPYREVTEXT, temp);
    }
}
开发者ID:Kasper8660,项目名称:tortoisesvn,代码行数:18,代码来源:CopyDlg.cpp

示例5: OnInitDialog

BOOL CEditPropExternalsValue::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
    BlockResize(DIALOG_BLOCKVERTICAL);

    ExtendFrameIntoClientArea(IDC_GROUPBOTTOM);
    m_aeroControls.SubclassOkCancelHelp(this);

    m_sWCPath = m_External.targetDir;

    SVNRev rev = m_External.revision;
    SVNRev pegRev = SVNRev(m_External.pegrevision);

    if ((pegRev.IsValid() && !pegRev.IsHead()) || (rev.IsValid() && !rev.IsHead()))
    {
        CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);

        if (m_External.revision.value.number == m_External.pegrevision.value.number)
        {
            m_sPegRev = pegRev.ToString();
        }
        else
        {
            m_sRevision = rev.ToString();
            m_sPegRev = pegRev.ToString();
        }
    }
    else
    {
        CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
    }

    m_URLCombo.LoadHistory(L"Software\\TortoiseSVN\\History\\repoURLS", L"url");
    m_URLCombo.SetURLHistory(true, false);
    m_URLCombo.SetWindowText(CPathUtils::PathUnescape(m_External.url));

    UpdateData(false);

    CString sWindowTitle;
    GetWindowText(sWindowTitle);
    CAppUtils::SetWindowTitle(m_hWnd, m_pathList.GetCommonRoot().GetUIPathString(), sWindowTitle);

    AddAnchor(IDC_WCLABEL, TOP_LEFT);
    AddAnchor(IDC_WCPATH, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_URLLABEL, TOP_LEFT);
    AddAnchor(IDC_URLCOMBO, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_BROWSE, TOP_RIGHT);
    AddAnchor(IDC_PEGLABEL, TOP_LEFT);
    AddAnchor(IDC_OPERATIVELABEL, TOP_LEFT);
    AddAnchor(IDC_PEGREV, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_GROUPBOTTOM, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_REVISION_HEAD, TOP_LEFT);
    AddAnchor(IDC_REVISION_N, TOP_LEFT);
    AddAnchor(IDC_REVISION_NUM, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_SHOW_LOG, TOP_RIGHT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);

    EnableSaveRestore(L"EditPropExternalsValue");

    return TRUE;
}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:64,代码来源:EditPropExternalsValue.cpp

示例6: DiffProps

bool SVNDiff::DiffProps(const CTSVNPath& filePath, const SVNRev& rev1, const SVNRev& rev2, svn_revnum_t &baseRev) const
{
    bool retvalue = false;
    // diff the properties
    SVNProperties propswc(filePath, rev1, false, false);
    SVNProperties propsbase(filePath, rev2, false, false);

#define MAX_PATH_LENGTH 80
    WCHAR pathbuf1[MAX_PATH] = {0};
    if (filePath.GetWinPathString().GetLength() >= MAX_PATH)
    {
        std::wstring str = filePath.GetWinPath();
        std::wregex rx(L"^(\\w+:|(?:\\\\|/+))((?:\\\\|/+)[^\\\\/]+(?:\\\\|/)[^\\\\/]+(?:\\\\|/)).*((?:\\\\|/)[^\\\\/]+(?:\\\\|/)[^\\\\/]+)$");
        std::wstring replacement = L"$1$2...$3";
        std::wstring str2 = std::regex_replace(str, rx, replacement);
        if (str2.size() >= MAX_PATH)
            str2 = str2.substr(0, MAX_PATH-2);
        PathCompactPathEx(pathbuf1, str2.c_str(), MAX_PATH_LENGTH, 0);
    }
    else
        PathCompactPathEx(pathbuf1, filePath.GetWinPath(), MAX_PATH_LENGTH, 0);

    if ((baseRev == 0) && (!filePath.IsUrl()) && (rev1.IsBase() || rev2.IsBase()))
    {
        SVNStatus stat;
        CTSVNPath dummy;
        svn_client_status_t * s = stat.GetFirstFileStatus(filePath, dummy);
        if (s)
            baseRev = s->revision;
    }
    // check for properties that got removed
    for (int baseindex = 0; baseindex < propsbase.GetCount(); ++baseindex)
    {
        std::string basename = propsbase.GetItemName(baseindex);
        tstring basenameU = CUnicodeUtils::StdGetUnicode(basename);
        tstring basevalue = (LPCTSTR)CUnicodeUtils::GetUnicode(propsbase.GetItemValue(baseindex).c_str());
        bool bFound = false;
        for (int wcindex = 0; wcindex < propswc.GetCount(); ++wcindex)
        {
            if (basename.compare (propswc.GetItemName(wcindex))==0)
            {
                bFound = true;
                break;
            }
        }
        if (!bFound)
        {
            // write the old property value to temporary file
            CTSVNPath wcpropfile = CTempFiles::Instance().GetTempFilePath(false);
            CTSVNPath basepropfile = CTempFiles::Instance().GetTempFilePath(false);
            FILE * pFile;
            _tfopen_s(&pFile, wcpropfile.GetWinPath(), L"wb");
            if (pFile)
            {
                fclose(pFile);
                FILE * pFile2;
                _tfopen_s(&pFile2, basepropfile.GetWinPath(), L"wb");
                if (pFile2)
                {
                    fputs(CUnicodeUtils::StdGetUTF8(basevalue).c_str(), pFile2);
                    fclose(pFile2);
                }
                else
                    return false;
            }
            else
                return false;
            SetFileAttributes(wcpropfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
            SetFileAttributes(basepropfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
            CString n1, n2;
            bool bSwitch = false;
            if (rev1.IsWorking())
                n1.Format(IDS_DIFF_PROP_WCNAME, basenameU.c_str());
            if (rev1.IsBase())
            {
                if (baseRev)
                    n1.FormatMessage(IDS_DIFF_PROP_BASENAMEREV, basenameU.c_str(), baseRev);
                else
                    n1.Format(IDS_DIFF_PROP_BASENAME, basenameU.c_str());
            }
            if (rev1.IsHead())
                n1.Format(IDS_DIFF_PROP_REMOTENAME, basenameU.c_str());
            if (n1.IsEmpty())
            {
                CString temp;
                temp.Format(IDS_DIFF_REVISIONPATCHED, (LONG)rev1);
                n1 = basenameU.c_str();
                n1 += L" " + temp;
                bSwitch = true;
            }
            else
            {
                n1 = CString(pathbuf1) + L" - " + n1;
            }
            if (rev2.IsWorking())
                n2.Format(IDS_DIFF_PROP_WCNAME, basenameU.c_str());
            if (rev2.IsBase())
            {
                if (baseRev)
                    n2.FormatMessage(IDS_DIFF_PROP_BASENAMEREV, basenameU.c_str(), baseRev);
//.........这里部分代码省略.........
开发者ID:code-mx,项目名称:tortoisesvn,代码行数:101,代码来源:SVNDiff.cpp

示例7: FetchRevisionData

bool CFullHistory::FetchRevisionData ( CString path
                                     , SVNRev pegRev
                                     , bool showWCRev
                                     , bool showWCModification
                                     , CProgressDlg* progress
                                     , ITaskbarList3 * pTaskBarList
                                     , HWND hWnd)
{
    // clear any previously existing SVN error info

    svn_error_clear(Err);
    Err = NULL;

    // remove internal data from previous runs

    CFuture<bool> clearJob (this, &CFullHistory::ClearCopyInfo, &cpuLoadScheduler);

    // set some text on the progress dialog, before we wait
    // for the log operation to start
    this->progress = progress;
    this->taskbarlist = pTaskBarList;
    this->hwnd = hWnd;

    CString temp;
    temp.LoadString (IDS_REVGRAPH_PROGGETREVS);
    progress->SetLine(1, temp);

    temp.LoadString (IDS_REVGRAPH_PROGPREPARING);
    progress->SetLine(2, temp);
    progress->SetProgress(0, 1);
    progress->ShowModeless (hWnd);
    if (taskbarlist)
    {
        taskbarlist->SetProgressState(hwnd, TBPF_INDETERMINATE);
    }

    // prepare the path for Subversion
    CTSVNPath svnPath (path);
    CStringA url = CPathUtils::PathEscape
                        (CUnicodeUtils::GetUTF8
                            (svn.GetURLFromPath (svnPath)));

    // we have to get the log from the repository root

    CTSVNPath rootPath;
    svn_revnum_t head;
    if (FALSE == svn.GetRootAndHead (svnPath, rootPath, head))
    {
        Err = svn_error_dup(const_cast<svn_error_t*>(svn.GetSVNError()));
        return false;
    }

    if (pegRev.IsHead())
        pegRev = head;

    headRevision = head;
    CString escapedRepoRoot = rootPath.GetSVNPathString();
    relPath = CPathUtils::PathUnescape (url.Mid (escapedRepoRoot.GetLength()));
    repoRoot = CPathUtils::PathUnescape (escapedRepoRoot);

    // fix issue #360: use WC revision as peg revision

    pegRevision = pegRev;
    if (pegRevision == NO_REVISION)
    {
        if (!svnPath.IsUrl())
        {
            SVNInfo info;
            const SVNInfoData * baseInfo
                = info.GetFirstFileInfo (svnPath, SVNRev(), SVNRev());
            if (baseInfo != NULL)
                pegRevision = baseInfo->rev;
        }
    }

    // fetch missing data from the repository
    try
    {
        // select / construct query object and optimize revision range to fetch

        svnQuery.reset (new CSVNLogQuery (ctx, pool));

        bool cacheIsComplete = false;
        if (svn.GetLogCachePool()->IsEnabled())
        {
            CLogCachePool* pool = svn.GetLogCachePool();
            query.reset (new CCacheLogQuery (pool, svnQuery.get()));

            // get the cache and the lowest missing revision
            // (in off-line mode, the query may not find the cache as
            // it cannot contact the server to get the UUID)

            uuid = pool->GetRepositoryInfo().GetRepositoryUUID (rootPath);
            cache = pool->GetCache (uuid, escapedRepoRoot);

            firstRevision = cache != NULL
                          ? cache->GetRevisions().GetFirstMissingRevision(1)
                          : 0;

            // if the cache is already complete, the firstRevision here is
//.........这里部分代码省略.........
开发者ID:Kasper8660,项目名称:tortoisesvn,代码行数:101,代码来源:FullHistory.cpp


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