[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Problems in 1.8 with Hook Scripts

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Wed, 19 Jun 2013 19:54:29 +0200

On 18.06.2013 22:17, Alexander Haley wrote:
> On Tue, Jun 18, 2013 at 3:27 PM, Alexander Haley <ahaley_at_meditech.com
> <mailto:ahaley_at_meditech.com>> wrote:
>
> I am encountering two problems (which I believe to be opposite sides
> of the same coin) with client defined hook scripts as of the 1.8.0
> release.
>
> [...]
>
> Notice the new 'enforce' option - and notice that the
> post_update_hook is entirely removed. I suspect an investigation
> into the registry import/export code for the client hooks would turn
> up this bug readily enough.
>
>
> Seems to me that the problem is in the *src\Utils\Hooks.cpp *code,
> in bool CHooks::Save() , where the defined hooks are stored back into
> the registry key , the code that glues together the string to store
> looks like:
>
> for (hookiterator it = begin(); it != end(); ++it)
> {
> strhooks += GetHookTypeString(it->first.htype);
> strhooks += '\n';
> strhooks += it->first.path.GetWinPathString();
> strhooks += '\n';
> strhooks += it->second.commandline;
> strhooks += '\n';
> strhooks += (it->second.bWait ? _T("true") : _T("false"));
> strhooks += '\n';
> strhooks += (it->second.bShow ? _T("show") : _T("hide"));
> strhooks += '\n';
> if (it->second.bEnforce)
> strhooks += _T("enforce\n");
> }
>
> Those last two lines, that tack on the 'enforce\n' bit ... well, if
> bEnforce isn't true, then no '\n' delimiter will be tacked on, and then
> later during the read in, if there are more than one hooks stored in the
> registry string, they'll be fouled up via an off-by-one style error.
> Perhaps something like:
>
> strhooks += (it->second.bEnforce ? _T("enforce") : _T("disregard"));
> strhooks += '\n';
>
> would fix this ... Hope that is useful...

Thanks for the report.
I've opened issue #482 for this:
http://code.google.com/p/tortoisesvn/issues/detail?id=482

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest interface to (Sub)version control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3058541
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2013-06-19 19:54:36 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.