[PATCH] Fix unlocking error message on hook errors
20 views
Skip to first unread message
Patrick Steinhardt
unread,
May 25, 2018, 7:07:16 AM5/25/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tortois...@googlegroups.com
Hi,
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. The bug was fixed on the 1.9.x
branch, but the patch applies to both 1.10.x and trunk.