[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
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.

Regards
Patrick
hook-unlock-errormsg.patch
signature.asc

Stefan

unread,
May 25, 2018, 10:19:49 AM5/25/18
to TortoiseSVN-dev
Thanks for the patch!
Committed in r28229

Stefan
Reply all
Reply to author
Forward
0 new messages