// Update our composite status and deal with things if it's changed void CCachedDirectory::UpdateCurrentStatus() { svn_wc_status_kind newStatus = CalculateRecursiveStatus(); if ((newStatus != m_currentFullStatus)&&(m_ownStatus.IsVersioned())) { if ((m_currentFullStatus != svn_wc_status_none)&&(m_ownStatus.GetEffectiveStatus() != svn_wc_status_ignored)) { // Our status has changed - tell the shell CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": Dir %s, status change from %d to %d\n"), m_directoryPath.GetWinPath(), m_currentFullStatus, newStatus); CSVNStatusCache::Instance().UpdateShell(m_directoryPath); } if (m_ownStatus.GetEffectiveStatus() != svn_wc_status_ignored) m_currentFullStatus = newStatus; else m_currentFullStatus = svn_wc_status_ignored; } // And tell our parent, if we've got one... // we tell our parent *always* about our status, even if it hasn't // changed. This is to make sure that the parent has really our current // status - the parent can decide itself if our status has changed // or not. CTSVNPath parentPath = m_directoryPath.GetContainingDirectory(); if(!parentPath.IsEmpty()) { CCachedDirectory * cachedDir = CSVNStatusCache::Instance().GetDirectoryCacheEntry(parentPath); if (cachedDir) cachedDir->UpdateChildDirectoryStatus(m_directoryPath, m_currentFullStatus); } }
// Update our composite status and deal with things if it's changed void CCachedDirectory::UpdateCurrentStatus() { git_wc_status_kind newStatus = CalculateRecursiveStatus(); CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": UpdateCurrentStatus %s new:%d old: %d\n"), m_directoryPath.GetWinPath(), newStatus, m_currentFullStatus); if (newStatus != m_currentFullStatus && m_ownStatus.IsDirectory()) { m_currentFullStatus = newStatus; // Our status has changed - tell the shell CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": Dir %s, status change from %d to %d\n"), m_directoryPath.GetWinPath(), m_currentFullStatus, newStatus); CGitStatusCache::Instance().UpdateShell(m_directoryPath); } // And tell our parent, if we've got one... // we tell our parent *always* about our status, even if it hasn't // changed. This is to make sure that the parent has really our current // status - the parent can decide itself if our status has changed // or not. CTGitPath parentPath = m_directoryPath.GetContainingDirectory(); if(!parentPath.IsEmpty()) { // We have a parent // just version controled directory need to cache. CString root1, root2; if (parentPath.HasAdminDir(&root1) && (CGitStatusCache::Instance().IsRecurseSubmodules() || m_directoryPath.HasAdminDir(&root2) && root1 == root2)) { CCachedDirectory * cachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(parentPath); if (cachedDir) cachedDir->UpdateChildDirectoryStatus(m_directoryPath, m_currentFullStatus); } } }
// Update our composite status and deal with things if it's changed void CCachedDirectory::UpdateCurrentStatus() { git_wc_status_kind newStatus = CalculateRecursiveStatus(); ATLTRACE(_T("UpdateCurrentStatus %s new:%d old: %d\n"), m_directoryPath.GetWinPath(), newStatus, m_currentFullStatus); if ( this->m_ownStatus.GetEffectiveStatus() < git_wc_status_normal ) { if (::PathFileExists(this->m_directoryPath.GetWinPathString()+_T("\\.git"))) { //project root must be normal status at least. ATLTRACE(_T("force update project root directory as normal status\n")); this->m_ownStatus.ForceStatus(git_wc_status_normal); } } if ((newStatus != m_currentFullStatus) && m_ownStatus.IsVersioned()) { if ((m_currentFullStatus != git_wc_status_none)&&(m_ownStatus.GetEffectiveStatus() != git_wc_status_missing)) { // Our status has changed - tell the shell ATLTRACE(_T("Dir %s, status change from %d to %d, send shell notification\n"), m_directoryPath.GetWinPath(), m_currentFullStatus, newStatus); CGitStatusCache::Instance().UpdateShell(m_directoryPath); } if (m_ownStatus.GetEffectiveStatus() != git_wc_status_missing) m_currentFullStatus = newStatus; else m_currentFullStatus = git_wc_status_missing; } // And tell our parent, if we've got one... // we tell our parent *always* about our status, even if it hasn't // changed. This is to make sure that the parent has really our current // status - the parent can decide itself if our status has changed // or not. CTGitPath parentPath = m_directoryPath.GetContainingDirectory(); if(!parentPath.IsEmpty()) { // We have a parent // just version controled directory need to cache. CString root1, root2; if(parentPath.HasAdminDir(&root1) && m_directoryPath.HasAdminDir(&root2) && root1 == root2) { CCachedDirectory * cachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(parentPath); if (cachedDir) cachedDir->UpdateChildDirectoryStatus(m_directoryPath, m_currentFullStatus); } } }