MCPcopy Create free account
hub / github.com/TortoiseGit/TortoiseGit / Load

Method Load

src/TortoiseMerge/DiffData.cpp:183–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183BOOL CDiffData::Load()
184{
185 m_arBaseFile.RemoveAll();
186 m_arYourFile.RemoveAll();
187 m_arTheirFile.RemoveAll();
188
189 m_YourBaseBoth.Clear();
190 m_YourBaseLeft.Clear();
191 m_YourBaseRight.Clear();
192
193 m_TheirBaseBoth.Clear();
194 m_TheirBaseLeft.Clear();
195 m_TheirBaseRight.Clear();
196
197 m_Diff3.Clear();
198
199 CRegDWORD regIgnoreWS = CRegDWORD(L"Software\\TortoiseGitMerge\\IgnoreWS");
200 CRegDWORD regIgnoreEOL = CRegDWORD(L"Software\\TortoiseGitMerge\\IgnoreEOL", TRUE);
201 CRegDWORD regIgnoreCase = CRegDWORD(L"Software\\TortoiseGitMerge\\CaseInsensitive", FALSE);
202 CRegDWORD regIgnoreComments = CRegDWORD(L"Software\\TortoiseGitMerge\\IgnoreComments", FALSE);
203 IgnoreWS ignoreWs = static_cast<IgnoreWS>(static_cast<DWORD>(regIgnoreWS));
204 bool bIgnoreEOL = static_cast<DWORD>(regIgnoreEOL) != 0;
205 BOOL bIgnoreCase = static_cast<DWORD>(regIgnoreCase) != 0;
206 bool bIgnoreComments = static_cast<DWORD>(regIgnoreComments) != 0;
207
208 // The Subversion diff API only can ignore whitespaces and eol styles.
209 // It also can only handle one-byte charsets.
210 // To ignore case changes or to handle UTF-16 files, we have to
211 // save the original file in UTF-8 and/or the letters changed to lowercase
212 // so the Subversion diff can handle those.
213 CString sConvertedBaseFilename = m_baseFile.GetFilename();
214 CString sConvertedYourFilename = m_yourFile.GetFilename();
215 CString sConvertedTheirFilename = m_theirFile.GetFilename();
216
217 m_baseFile.StoreFileAttributes();
218 m_theirFile.StoreFileAttributes();
219 m_yourFile.StoreFileAttributes();
220 //m_mergedFile.StoreFileAttributes();
221
222 bool bBaseNeedConvert = false;
223 bool bTheirNeedConvert = false;
224 bool bYourNeedConvert = false;
225 bool bBaseIsUtf8 = false;
226 bool bTheirIsUtf8 = false;
227 bool bYourIsUtf8 = false;
228
229 if (IsBaseFileInUse())
230 {
231 if (!m_arBaseFile.Load(m_baseFile.GetFilename()))
232 {
233 m_sError = m_arBaseFile.GetErrorString();
234 return FALSE;
235 }
236 bBaseNeedConvert = bIgnoreCase || bIgnoreComments || (m_arBaseFile.NeedsConversion()) || !m_rx._Empty();
237 bBaseIsUtf8 = (m_arBaseFile.GetUnicodeType() != CFileTextLines::UnicodeType::ASCII) || bBaseNeedConvert;
238 }
239
240 if (IsTheirFileInUse())

Callers 5

LoadViewsMethod · 0.45
OpenUnifiedDiffFileMethod · 0.45
PatchFileMethod · 0.45
SetPicMethod · 0.45

Calls 14

StoreFileAttributesMethod · 0.80
GetErrorStringMethod · 0.80
NeedsConversionMethod · 0.80
GetUnicodeTypeMethod · 0.80
GetTempFilePathStringMethod · 0.80
SetConvertedFileNameMethod · 0.80
RemoveAllMethod · 0.45
ClearMethod · 0.45
GetFilenameMethod · 0.45
GetCountMethod · 0.45
SaveMethod · 0.45
ReserveMethod · 0.45

Tested by

no test coverage detected