Revision | 29097 (tree) |
---|---|
Zeit | 2021-03-31 01:25:14 |
Autor | stefankueng |
use the advanced setting includeExternals when switching after a branch/tag
@@ -1,6 +1,6 @@ | ||
1 | -// TortoiseSVN - a Windows shell extension for easy version control | |
1 | +// TortoiseSVN - a Windows shell extension for easy version control | |
2 | 2 | |
3 | -// Copyright (C) 2007-2012, 2014 - TortoiseSVN | |
3 | +// Copyright (C) 2007-2012, 2014, 2021 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -25,7 +25,7 @@ | ||
25 | 25 | |
26 | 26 | bool CopyCommand::Execute() |
27 | 27 | { |
28 | - bool bRet = false; | |
28 | + bool bRet = false; | |
29 | 29 | CString msg; |
30 | 30 | if (parser.HasKey(L"logmsg")) |
31 | 31 | { |
@@ -37,31 +37,37 @@ | ||
37 | 37 | CStringUtils::ReadStringFromTextFile(logmsgfile, msg); |
38 | 38 | } |
39 | 39 | |
40 | - BOOL repeat = FALSE; | |
40 | + BOOL repeat = FALSE; | |
41 | 41 | CCopyDlg dlg; |
42 | 42 | |
43 | - dlg.m_path = cmdLinePath; | |
44 | - CString url = parser.GetVal(L"url"); | |
45 | - CString logmessage = msg; | |
46 | - SVNRev copyRev = SVNRev::REV_HEAD; | |
47 | - BOOL doSwitch = parser.HasKey(L"switchaftercopy"); | |
48 | - BOOL makeParents = parser.HasKey(L"makeparents"); | |
43 | + dlg.m_path = cmdLinePath; | |
44 | + CString url = parser.GetVal(L"url"); | |
45 | + CString logMessage = msg; | |
46 | + SVNRev copyRev = SVNRev::REV_HEAD; | |
47 | + BOOL doSwitch = parser.HasKey(L"switchaftercopy"); | |
48 | + BOOL makeParents = parser.HasKey(L"makeparents"); | |
49 | 49 | do |
50 | 50 | { |
51 | - repeat = FALSE; | |
52 | - dlg.m_URL = url; | |
53 | - dlg.m_sLogMessage = logmessage; | |
54 | - dlg.m_CopyRev = copyRev; | |
55 | - dlg.m_bDoSwitch = doSwitch; | |
51 | + repeat = FALSE; | |
52 | + dlg.m_URL = url; | |
53 | + dlg.m_sLogMessage = logMessage; | |
54 | + dlg.m_CopyRev = copyRev; | |
55 | + dlg.m_bDoSwitch = doSwitch; | |
56 | 56 | dlg.m_bMakeParents = makeParents; |
57 | 57 | if (dlg.DoModal() == IDOK) |
58 | 58 | { |
59 | - theApp.m_pMainWnd = NULL; | |
59 | + CRegDWORD updateExternals(L"Software\\TortoiseSVN\\IncludeExternals", true); | |
60 | + bool ignoreExternals = false; | |
61 | + if (dlg.m_bDoSwitch) | |
62 | + ignoreExternals = static_cast<DWORD>(updateExternals) == 0; | |
63 | + | |
64 | + theApp.m_pMainWnd = nullptr; | |
60 | 65 | CSVNProgressDlg progDlg; |
61 | 66 | progDlg.SetCommand(CSVNProgressDlg::SVNProgress_Copy); |
62 | - progDlg.SetAutoClose (parser); | |
67 | + progDlg.SetAutoClose(parser); | |
63 | 68 | DWORD options = dlg.m_bDoSwitch ? ProgOptSwitchAfterCopy : ProgOptNone; |
64 | 69 | options |= dlg.m_bMakeParents ? ProgOptMakeParents : ProgOptNone; |
70 | + options |= ignoreExternals ? ProgOptIgnoreExternals : ProgOptNone; | |
65 | 71 | progDlg.SetOptions(options); |
66 | 72 | progDlg.SetPathList(pathList); |
67 | 73 | progDlg.SetUrl(dlg.m_URL); |
@@ -68,20 +74,20 @@ | ||
68 | 74 | progDlg.SetCommitMessage(dlg.m_sLogMessage); |
69 | 75 | progDlg.SetRevision(dlg.m_CopyRev); |
70 | 76 | progDlg.SetExternals(dlg.GetExternalsToTag()); |
71 | - url = dlg.m_URL; | |
72 | - logmessage = dlg.m_sLogMessage; | |
73 | - copyRev = dlg.m_CopyRev; | |
74 | - doSwitch = dlg.m_bDoSwitch; | |
77 | + url = dlg.m_URL; | |
78 | + logMessage = dlg.m_sLogMessage; | |
79 | + copyRev = dlg.m_CopyRev; | |
80 | + doSwitch = dlg.m_bDoSwitch; | |
75 | 81 | makeParents = dlg.m_bMakeParents; |
76 | 82 | progDlg.DoModal(); |
77 | 83 | CRegDWORD err(L"Software\\TortoiseSVN\\ErrorOccurred", FALSE); |
78 | - err = (DWORD)progDlg.DidErrorsOccur(); | |
79 | - bRet = !progDlg.DidErrorsOccur(); | |
80 | - repeat = progDlg.DidErrorsOccur(); | |
84 | + err = static_cast<DWORD>(progDlg.DidErrorsOccur()); | |
85 | + bRet = !progDlg.DidErrorsOccur(); | |
86 | + repeat = progDlg.DidErrorsOccur(); | |
81 | 87 | CRegDWORD bFailRepeat = CRegDWORD(L"Software\\TortoiseSVN\\CommitReopen", FALSE); |
82 | - if (DWORD(bFailRepeat) == FALSE) | |
83 | - repeat = false; // do not repeat if the user chose not to in the settings. | |
88 | + if (static_cast<DWORD>(bFailRepeat) == FALSE) | |
89 | + repeat = false; // do not repeat if the user chose not to in the settings. | |
84 | 90 | } |
85 | - } while(repeat); | |
91 | + } while (repeat); | |
86 | 92 | return bRet; |
87 | 93 | } |
\ No newline at end of file |