• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28831 (tree)
Zeit2020-03-26 05:08:06
Autorstefankueng

Log Message

* add option to the settings dialog to chose which shelfing API to use
* show an error balloon when shelfing with an empty name

Ändern Zusammenfassung

Diff

--- trunk/src/TortoiseProc/Settings/SettingsDialogs3.cpp (revision 28830)
+++ trunk/src/TortoiseProc/Settings/SettingsDialogs3.cpp (revision 28831)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2011, 2013-2016 - TortoiseSVN
3+// Copyright (C) 2011, 2013-2016, 2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -21,7 +21,6 @@
2121 #include "SettingsDialogs3.h"
2222 #include <afxdialogex.h>
2323
24-
2524 // SettingsDialogs3 dialog
2625
2726 IMPLEMENT_DYNAMIC(SettingsDialogs3, ISettingsPropPage)
@@ -32,9 +31,9 @@
3231 , m_bIncludeExternals(FALSE)
3332 , m_bIncludeLocks(FALSE)
3433 {
35- m_regPreFetch = CRegDWORD(L"Software\\TortoiseSVN\\RepoBrowserPrefetch", TRUE);
34+ m_regPreFetch = CRegDWORD(L"Software\\TortoiseSVN\\RepoBrowserPrefetch", TRUE);
3635 m_regIncludeExternals = CRegDWORD(L"Software\\TortoiseSVN\\RepoBrowserShowExternals", TRUE);
37- m_regIncludeLocks = CRegDWORD(L"Software\\TortoiseSVN\\RepoBrowserShowLocks", TRUE);
36+ m_regIncludeLocks = CRegDWORD(L"Software\\TortoiseSVN\\RepoBrowserShowLocks", TRUE);
3837 }
3938
4039 SettingsDialogs3::~SettingsDialogs3()
@@ -46,20 +45,19 @@
4645 ISettingsPropPage::DoDataExchange(pDX);
4746 DDX_Check(pDX, IDC_ALLOWPREFETCH, m_bPreFetch);
4847 DDX_Check(pDX, IDC_SHOWEXTERNALS, m_bIncludeExternals);
49- DDX_Check(pDX, IDC_SHOWLOCKS, m_bIncludeLocks);
48+ DDX_Check(pDX, IDC_SHOWLOCKS, m_bIncludeLocks);
5049 }
5150
52-
5351 BEGIN_MESSAGE_MAP(SettingsDialogs3, ISettingsPropPage)
5452 ON_BN_CLICKED(IDC_ALLOWPREFETCH, &SettingsDialogs3::OnBnClicked)
5553 ON_BN_CLICKED(IDC_SHOWEXTERNALS, &SettingsDialogs3::OnBnClicked)
56- ON_BN_CLICKED(IDC_SHOWLOCKS, &SettingsDialogs3::OnBnClicked)
54+ ON_BN_CLICKED(IDC_SHOWLOCKS, &SettingsDialogs3::OnBnClicked)
55+ ON_BN_CLICKED(IDC_SHELF_V2, &SettingsDialogs3::OnBnClicked)
56+ ON_BN_CLICKED(IDC_SHELF_V3, &SettingsDialogs3::OnBnClicked)
5757 END_MESSAGE_MAP()
5858
59-
6059 // SettingsDialogs3 message handlers
6160
62-
6361 void SettingsDialogs3::OnBnClicked()
6462 {
6563 SetModified();
@@ -71,10 +69,17 @@
7169
7270 EnableToolTips();
7371
74- m_bPreFetch = m_regPreFetch;
72+ m_bPreFetch = m_regPreFetch;
7573 m_bIncludeExternals = m_regIncludeExternals;
76- m_bIncludeLocks = m_regIncludeLocks;
74+ m_bIncludeLocks = m_regIncludeLocks;
7775
76+ char* pValue = nullptr;
77+ size_t len = 0;
78+ errno_t err = _dupenv_s(&pValue, &len, "SVN_EXPERIMENTAL_COMMANDS");
79+ auto isV3 = ((err == 0) && pValue && strstr(pValue, "shelf3"));
80+ free(pValue);
81+ CheckRadioButton(IDC_SHELF_V2, IDC_SHELF_V3, isV3 ? IDC_SHELF_V3 : IDC_SHELF_V2);
82+
7883 m_tooltips.AddTool(IDC_ALLOWPREFETCH, IDS_SETTINGS_REPOBROWSER_PREFETCH_TT);
7984 m_tooltips.AddTool(IDC_SHOWEXTERNALS, IDS_SETTINGS_REPOBROWSER_EXTERNALS_TT);
8085 m_tooltips.AddTool(IDC_SHOWLOCKS, IDS_SETTINGS_REPOBROWSER_LOCKS_TT);
@@ -86,12 +91,24 @@
8691 BOOL SettingsDialogs3::OnApply()
8792 {
8893 UpdateData();
89- Store (m_bPreFetch, m_regPreFetch);
90- Store (m_bIncludeExternals, m_regIncludeExternals);
91- Store (m_bIncludeLocks, m_regIncludeLocks);
94+ Store(m_bPreFetch, m_regPreFetch);
95+ Store(m_bIncludeExternals, m_regIncludeExternals);
96+ Store(m_bIncludeLocks, m_regIncludeLocks);
9297
98+ char* pValue = nullptr;
99+ size_t len = 0;
100+ errno_t err = _dupenv_s(&pValue, &len, "SVN_EXPERIMENTAL_COMMANDS");
101+ auto wasV3 = ((err == 0) && pValue && strstr(pValue, "shelf3"));
102+ free(pValue);
103+
104+ auto isV3 = IsDlgButtonChecked(IDC_SHELF_V3) != FALSE;
105+ CRegString regShelf = CRegString(L"Environment\\SVN_EXPERIMENTAL_COMMANDS");
106+ regShelf = isV3 ? L"shelf3" : L"shelf2";
107+ if (isV3 != wasV3)
108+ {
109+ SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)L"Environment", SMTO_ABORTIFHUNG, 5000, NULL);
110+ m_restart = Restart_System;
111+ }
93112 SetModified(FALSE);
94113 return ISettingsPropPage::OnApply();
95114 }
96-
97-
--- trunk/src/TortoiseProc/ShelveDlg.cpp (revision 28830)
+++ trunk/src/TortoiseProc/ShelveDlg.cpp (revision 28831)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2017-2018 - TortoiseSVN
3+// Copyright (C) 2017-2018, 2020 - TortoiseSVN
44 // Copyright (C) 2019 - TortoiseGit
55
66 // This program is free software; you can redistribute it and/or
@@ -239,7 +239,8 @@
239239 if (m_bThreadRunning)
240240 return;
241241
242- FillData();
242+ if (!FillData())
243+ return;
243244 m_revert = true;
244245
245246 CResizableStandAloneDialog::OnOK();
@@ -250,12 +251,14 @@
250251 if (m_bThreadRunning)
251252 return;
252253
253- FillData();
254+ if (!FillData())
255+ return;
256+ m_revert = false;
254257
255258 CResizableStandAloneDialog::OnOK();
256259 }
257260
258-void CShelve::FillData()
261+bool CShelve::FillData()
259262 {
260263 CString val;
261264 auto sel = m_cShelvesCombo.GetCurSel();
@@ -267,10 +270,17 @@
267270 m_cShelvesCombo.GetWindowText(val);
268271 m_sShelveName = val;
269272
273+ if (m_sShelveName.IsEmpty())
274+ {
275+ m_tooltips.ShowBalloon(&m_cShelvesCombo, IDS_ERR_SHELFNAME_EMPTY, IDS_ERR_ERROR, TTI_ERROR);
276+ return false;
277+ }
278+
270279 m_sLogMsg = m_cLogMessage.GetText();
271280
272281 //save only the files the user has selected into the path list
273282 m_PatchList.WriteCheckedNamesToPathList(m_pathList);
283+ return true;
274284 }
275285
276286 LRESULT CShelve::OnSVNStatusListCtrlNeedsRefresh(WPARAM, LPARAM)
--- trunk/src/TortoiseProc/ShelveDlg.h (revision 28830)
+++ trunk/src/TortoiseProc/ShelveDlg.h (revision 28831)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2017-2018 - TortoiseSVN
3+// Copyright (C) 2017-2018, 2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -46,7 +46,7 @@
4646 virtual BOOL PreTranslateMessage(MSG* pMsg);
4747 virtual void OnCancel();
4848 virtual void OnOK();
49- void FillData();
49+ bool FillData();
5050 afx_msg void OnBnClickedSelectall();
5151 afx_msg void OnBnClickedHelp();
5252 afx_msg void OnShelveNameChanged();
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Show on old repository browser