• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28229 (tree)
Time2018-05-25 23:19:19
Authorstefankueng

Log Message

Patch from Patrick Steinhardt:
When you try to commit to a server, but the commit itself is
getting rejected because of a hook, then TortoiseSVN will prompt
the user to unbreak the lock. Outputting this error message is
wrong, though, as rejection through a hook will not cause any
locks to be retained after the operation.

The issue stems from the macro SVN_ERR_IS_UNLOCK_ERROR, which
TortoiseSVN uses to determine whether unlock instructions shall
be appended to the error messages. Because Subversion allows
pre-lock hooks, an SVN_ERR_REPOS_HOOK_FAILURE message is also
considered an unlock error, even though in most cases it is not.
And even if it was an error regarding the pre-lock hook, the user
would not be able to fix that by unlocking something in his
working copy, as the hook is server-side and only used to check
whether a lock shall be granted at all.

Fix the erroneous message by only emitting it if the error is
_not_ an SVN_ERR_REPOS_HOOK_FAILURE.

The attached patch does that.

Change Summary

Incremental Difference

--- trunk/src/SVN/SVNBase.cpp (revision 28228)
+++ trunk/src/SVN/SVNBase.cpp (revision 28229)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2010-2016 - TortoiseSVN
3+// Copyright (C) 2010-2016, 2018 - 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
@@ -186,7 +186,8 @@
186186 // the lock has already been broken from another working copy
187187 temp.LoadString(IDS_SVNERR_UNLOCKFAILEDNOLOCK);
188188 }
189- else if (SVN_ERR_IS_UNLOCK_ERROR(Err))
189+ else if ((Err->apr_err != SVN_ERR_REPOS_HOOK_FAILURE) &&
190+ SVN_ERR_IS_UNLOCK_ERROR(Err))
190191 {
191192 // if you want to break the lock, use the "check for modifications" dialog
192193 temp.LoadString(IDS_SVNERR_UNLOCKFAILED);
Show on old repository browser