Re: [PATCH] Pre-lock script and general hook script fixes

Daniel Sahlberg via TortoiseSVN-dev <[email protected]>
Newsgroups gmane.comp.version-control.subversion.tortoisesvn.devel
Message-ID <[email protected]>
Thanks!

Did you also take a look at the patches in the first message? Sorry if it 
caused extra work for you but I split it up to make it easier to review.

I realize I forgot to attach one of the patches to the first message, I'm 
attaching all three again for easier reference.

Kind regards,
Daniel

fredag 8 januari 2021 kl. 21:45:03 UTC+1 skrev Stefan:

> committed your patch in r29050

-- 
You received this message because you are subscribed to the Google Groups "TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/tortoisesvn-dev/6aca0b1e-f530-4ce1-bc34-346384ab8a57n%40googlegroups.com.
LockCommand SetSelectedList.patch (text/x-diff, 872 B)
Index: src/TortoiseProc/Commands/LockCommand.cpp
===================================================================
--- src/TortoiseProc/Commands/LockCommand.cpp	(revision 29048)
+++ src/TortoiseProc/Commands/LockCommand.cpp	(working copy)
@@ -1,4 +1,4 @@
-// TortoiseSVN - a Windows shell extension for easy version control
+// TortoiseSVN - a Windows shell extension for easy version control
 
 // Copyright (C) 2007-2009, 2014 - TortoiseSVN
 
@@ -48,6 +48,7 @@
             progDlg.SetCommand(CSVNProgressDlg::SVNProgress_Lock);
             progDlg.SetOptions(lockDlg.m_bStealLocks ? ProgOptForce : ProgOptNone);
             progDlg.SetPathList(lockDlg.m_pathList);
+            progDlg.SetSelectedList(lockDlg.m_pathList);
             progDlg.SetCommitMessage(lockDlg.m_sLockMessage);
             progDlg.SetAutoClose (parser);
             progDlg.DoModal();
pre-lock actual parameters.patch (text/x-diff, 542 B)
Index: doc/source/en/TortoiseSVN/tsvn_dug/dug_settings_hooks.xml
===================================================================
--- doc/source/en/TortoiseSVN/tsvn_dug/dug_settings_hooks.xml	(revision 29048)
+++ doc/source/en/TortoiseSVN/tsvn_dug/dug_settings_hooks.xml	(working copy)
@@ -273,7 +273,6 @@
             <literal>LOCK</literal>
             <literal>FORCE</literal>
             <literal>MESSAGEFILE</literal>
-            <literal>ERROR</literal>
             <literal>CWD</literal>
           </para>
         </listitem>
hookkey as CString.patch (text/x-diff, 7.1 KB)
Index: src/TortoiseProc/Settings/SetHooks.cpp
===================================================================
--- src/TortoiseProc/Settings/SetHooks.cpp	(revision 29048)
+++ src/TortoiseProc/Settings/SetHooks.cpp	(working copy)
@@ -1,4 +1,4 @@
-// TortoiseSVN - a Windows shell extension for easy version control
+// TortoiseSVN - a Windows shell extension for easy version control
 
 // Copyright (C) 2003-2010, 2012, 2014-2015 - TortoiseSVN
 
@@ -95,7 +95,7 @@
         for (hookiterator it = CHooks::Instance().begin(); it != CHooks::Instance().end(); ++it)
         {
             int pos = m_cHookList.InsertItem(m_cHookList.GetItemCount(), CHooks::Instance().GetHookTypeString(it->first.htype));
-            m_cHookList.SetItemText(pos, 1, it->first.path.GetWinPathString());
+            m_cHookList.SetItemText(pos, 1, it->first.path);
             m_cHookList.SetItemText(pos, 2, it->second.commandline);
             m_cHookList.SetItemText(pos, 3, (it->second.bWait ? L"true" : L"false"));
             m_cHookList.SetItemText(pos, 4, (it->second.bShow ? L"show" : L"hide"));
@@ -121,7 +121,7 @@
         {
             hookkey key;
             key.htype = CHooks::GetHookType((LPCTSTR)m_cHookList.GetItemText(index, 0));
-            key.path = CTSVNPath(m_cHookList.GetItemText(index, 1));
+            key.path = CTSVNPath(m_cHookList.GetItemText(index, 1)).GetWinPathString();
             CHooks::Instance().Remove(key);
             m_cHookList.DeleteItem(index);
             SetModified();
@@ -140,7 +140,7 @@
         CSetHooksAdv dlg;
         int index = m_cHookList.GetNextSelectedItem(pos);
         dlg.key.htype = CHooks::GetHookType((LPCTSTR)m_cHookList.GetItemText(index, 0));
-        dlg.key.path = CTSVNPath(m_cHookList.GetItemText(index, 1));
+        dlg.key.path = CTSVNPath(m_cHookList.GetItemText(index, 1)).GetWinPathString();
         dlg.cmd.commandline = m_cHookList.GetItemText(index, 2);
         dlg.cmd.bWait = (m_cHookList.GetItemText(index, 3).Compare(L"true")==0);
         dlg.cmd.bShow = (m_cHookList.GetItemText(index, 4).Compare(L"show")==0);
@@ -149,7 +149,7 @@
         if (dlg.DoModal() == IDOK)
         {
             CHooks::Instance().Remove(key);
-            CHooks::Instance().Add(dlg.key.htype, dlg.key.path, dlg.cmd.commandline,
+            CHooks::Instance().Add(dlg.key.htype, CTSVNPath(dlg.key.path), dlg.cmd.commandline,
                                    dlg.cmd.bWait, dlg.cmd.bShow, dlg.cmd.bEnforce);
             RebuildHookList();
             SetModified();
@@ -162,7 +162,7 @@
     CSetHooksAdv dlg;
     if (dlg.DoModal() == IDOK)
     {
-        CHooks::Instance().Add(dlg.key.htype, dlg.key.path, dlg.cmd.commandline,
+        CHooks::Instance().Add(dlg.key.htype, CTSVNPath(dlg.key.path), dlg.cmd.commandline,
                                dlg.cmd.bWait, dlg.cmd.bShow, dlg.cmd.bEnforce);
         RebuildHookList();
         SetModified();
@@ -209,7 +209,7 @@
         hookkey key = dlg.key;
         if (dlg.DoModal() == IDOK)
         {
-            CHooks::Instance().Add(dlg.key.htype, dlg.key.path, dlg.cmd.commandline,
+            CHooks::Instance().Add(dlg.key.htype, CTSVNPath(dlg.key.path), dlg.cmd.commandline,
                                    dlg.cmd.bWait, dlg.cmd.bShow, dlg.cmd.bEnforce);
             RebuildHookList();
             SetModified();
Index: src/TortoiseProc/Settings/SetHooksAdv.cpp
===================================================================
--- src/TortoiseProc/Settings/SetHooksAdv.cpp	(revision 29048)
+++ src/TortoiseProc/Settings/SetHooksAdv.cpp	(working copy)
@@ -1,4 +1,4 @@
-// TortoiseSVN - a Windows shell extension for easy version control
+// TortoiseSVN - a Windows shell extension for easy version control
 
 // Copyright (C) 2003-2010, 2012-2016 - TortoiseSVN
 
@@ -101,7 +101,7 @@
         }
     }
 
-    m_sPath = key.path.GetWinPathString();
+    m_sPath = key.path;
     m_sCommandLine = cmd.commandline;
     m_bWait = cmd.bWait;
     m_bHide = !cmd.bShow;
@@ -135,7 +135,7 @@
     if (cursel != CB_ERR)
     {
         key.htype = (hooktype)m_cHookTypeCombo.GetItemData(cursel);
-        key.path = CTSVNPath(m_sPath);
+        key.path = CTSVNPath(m_sPath).GetWinPathString();
         cmd.commandline = m_sCommandLine;
         cmd.bWait = !!m_bWait;
         cmd.bShow = !m_bHide;
Index: src/Utils/Hooks.cpp
===================================================================
--- src/Utils/Hooks.cpp	(revision 29048)
+++ src/Utils/Hooks.cpp	(working copy)
@@ -69,7 +69,7 @@
         if ((pos = strhooks.Find('\n')) >= 0)
         {
             // line 2
-            key.path = CTSVNPath(strhooks.Mid(0, pos));
+            key.path = CTSVNPath(strhooks.Mid(0, pos)).GetWinPathString();
             if (pos+1 < strhooks.GetLength())
                 strhooks = strhooks.Mid(pos+1);
             else
@@ -160,7 +160,7 @@
     {
         strhooks += GetHookTypeString(it->first.htype);
         strhooks += '\n';
-        strhooks += it->first.path.GetWinPathString();
+        strhooks += it->first.path;
         strhooks += '\n';
         strhooks += it->second.commandline;
         strhooks += '\n';
@@ -190,7 +190,7 @@
 {
     hookkey key;
     key.htype = ht;
-    key.path = Path;
+    key.path = Path.GetWinPathString();
     hookiterator it = find(key);
     if (it!=end())
         erase(it);
@@ -517,10 +517,10 @@
                 {
                     if (ith->first.htype == pre_connect_hook)
                     {
-                        CString sUrl = svn.GetURLFromPath(ith->first.path);
+                        CString sUrl = svn.GetURLFromPath(CTSVNPath(ith->first.path));
                         hookkey hk;
                         hk.htype = pre_connect_hook;
-                        hk.path = CTSVNPath(sUrl);
+                        hk.path = CTSVNPath(sUrl).GetWinPathString();
                         insert(std::pair<hookkey, hookcmd>(hk, ith->second));
                     }
                 }
@@ -613,7 +613,7 @@
         do
         {
             key.htype = t;
-            key.path = path;
+            key.path = path.GetWinPathString();
             hookiterator it = find(key);
             if (it != end())
             {
@@ -620,12 +620,12 @@
                 return it;
             }
             path = path.GetContainingDirectory();
-        } while(!path.IsEmpty());
+        } while (!path.IsEmpty());
     }
 
     // try the wc root path
     key.htype = t;
-    key.path = m_wcRootPath;
+    key.path = m_wcRootPath.GetWinPathString();
     hookiterator it = find(key);
     if (it != end())
     {
@@ -634,7 +634,7 @@
 
     // look for a script with a path as '*'
     key.htype = t;
-    key.path = CTSVNPath(L"*");
+    key.path = L"*";
     it = find(key);
     if (it != end())
     {
@@ -776,7 +776,7 @@
     hookcmd cmd;
 
     key.htype = t;
-    key.path = wcRootPath;
+    key.path = wcRootPath.GetWinPathString();
 
     int pos = 0;
     CString temp;
Index: src/Utils/Hooks.h
===================================================================
--- src/Utils/Hooks.h	(revision 29048)
+++ src/Utils/Hooks.h	(working copy)
@@ -53,7 +53,7 @@
 {
 public:
     hooktype        htype;
-    CTSVNPath       path;
+    CString         path;
 
     bool operator < (const hookkey& hk) const
     {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.