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

Re: wc.db - sync props

From: Branko Čibej <brane_at_wandisco.com>
Date: Sun, 20 Jan 2013 18:01:50 +0100

On 20.01.2013 16:56, Matwey V. Kornilov wrote:
> Hi,
>
> I am running svn 1.7.8, both on server and client.
>
> My pre_commit hook at server changes specific props in some transactions.
> But, at client side in wc.db I have user (uncorrected) version of this
> props. svn update does not sync props from server with those of wc.db. At
> the same time svn checkout does well.
>
> The question is: how to properly update working wc.db syncing with server?

You are modifying versioned information in a hook. You should not do
that. The Book has a big warning about that, see:

http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.reposadmin.create.hooks

    While hook scripts can do almost anything, there is one dimension in
    which hook script authors should show restraint: do /not/ modify a
    commit transaction using hook scripts. While it might be tempting to
    use hook scripts to automatically correct errors, shortcomings, or
    policy violations present in the files being committed, doing so can
    cause problems. Subversion keeps client-side caches of certain bits
    of repository data, and if you change a commit transaction in this
    way, those caches become indetectably stale. This inconsistency can
    lead to surprising and unexpected behavior. Instead of modifying the
    transaction, you should simply /validate/ the transaction in
    the |pre-commit| hook and reject the commit if it does not meet the
    desired requirements. As a bonus, your users will learn the value of
    careful, compliance-minded work habits.

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com
Received on 2013-01-20 18:02:28 CET

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

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