CLogChangedPath::CLogChangedPath ( const CRevisionInfoContainer::CChangesIterator& iter , const CDictionaryBasedTempPath& logPath) : path (iter.GetPath()) , copyFromPath (NULL, (index_t)NO_INDEX) , copyFromRev (0) { flags.nodeKind = static_cast<svn_node_kind_t>(iter->GetPathType()); flags.action = (DWORD)iter.GetAction() / 4; flags.textModifies = static_cast<svn_tristate_t>(iter->GetTextModifies()); flags.propsModifies = static_cast<svn_tristate_t>(iter->GetPropsModifies()); // check relevance for log path flags.relevantForStartPath = logPath.IsSameOrParentOf (path) || logPath.IsSameOrChildOf (path); // set copy-from info, if available if (iter.HasFromPath() && (iter.GetFromRevision() != NO_REVISION)) { copyFromPath = iter.GetFromPath(); copyFromRev = iter.GetFromRevision(); } }
void CLogChangedPathArray::Add ( CRevisionInfoContainer::CChangesIterator& first , const CRevisionInfoContainer::CChangesIterator& last , CDictionaryBasedTempPath& logPath) { reserve (last - first); for (; first != last; ++first) emplace_back(first, logPath); // update log path to the *last* copy source we found // because it will also be the closed one (parent may // have copied from somewhere else) for (size_t i = size(); i > 0; --i) { CLogChangedPath& change = at(i-1); // relevant for this path and // has the log path be renamed? if ( change.IsRelevantForStartPath() && (change.GetCopyFromRev() > 0) && logPath.IsSameOrChildOf (change.GetCachedPath())) { // note: this only works if the log is fetched top-to-bottom // but since we do that, it shouldn't be a problem logPath = logPath.ReplaceParent ( change.GetCachedPath() , change.GetCachedCopyFromPath()); copiedSelf = true; return; } } actions = 0; }