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]> |
Answering myself.. måndag 4 januari 2021 kl. 01:13:27 UTC+1 skrev Daniel Sahlberg: > Any ideas on this? Ideally Subversion would return the comment in addition > to the W160035 "Path ... is already locked ..." error message. I will see > if this is possible to add, it would also be beneficial for other clients > than TSVN. > It looked quite complicated to change W160035. So I digged deeper and think I have figured out a way get the lock comments in the right place. The "Locked on DESKTOP-..." lines are the lock comments. The Action column should/could probably be set to something. Also multi line lock messages should probably be handled in some way - now the lines are just concatenated to a single line (I haven't tried very long lock messages). Kind regards Daniel Sahlberg -- 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/e8bc9083-c527-49ac-b98c-6e884817be21n%40googlegroups.com.
Show Lock message on svn_wc_notify_failed_lock.patch
(text/x-diff, 1.2 KB)
Index: src/TortoiseProc/SVNProgressDlg.cpp
===================================================================
--- src/TortoiseProc/SVNProgressDlg.cpp (revision 29048)
+++ src/TortoiseProc/SVNProgressDlg.cpp (working copy)
@@ -52,6 +52,7 @@
#include "BrowseFolder.h"
#include "SimplePrompt.h"
#include "Theme.h"
+#include "../SVN/SVNInfo.h"
#include <strsafe.h>
BOOL CSVNProgressDlg::m_bAscending = FALSE;
@@ -716,7 +717,18 @@
if ((err)&&(err->apr_err == SVN_ERR_FS_OUT_OF_DATE))
m_bLockWarning = true;
if ((err)&&(err->apr_err == SVN_ERR_FS_PATH_ALREADY_LOCKED))
+ {
m_bLockExists = true;
+ SVNInfo info;
+ const SVNInfoData* infodata = info.GetFirstFileInfo(path, SVNRev(L"HEAD"), SVNRev(L"HEAD"));
+ if (infodata && !infodata->lock_comment.IsEmpty())
+ {
+ NotificationData* data2 = new NotificationData();
+ data2->sActionColumnText = L"";
+ data2->sPathColumnText = infodata->lock_comment;
+ AddItemToList(data2);
+ }
+ }
break;
case svn_wc_notify_failed_unlock:
data->sActionColumnText.LoadString(IDS_SVNACTION_FAILEDUNLOCK);