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

Re: [PATCH] hook script for log message newline enforcement

From: Justin Erenkrantz <justin_at_erenkrantz.com>
Date: 2006-03-03 22:07:08 CET

On 03 Mar 2006 11:32:02 -0600, kfogel@collab.net <kfogel@collab.net> wrote:
>
> elif all_revs:
> last_youngest = 0
> while True:
> youngest = svn.fs.svn_fs_youngest_rev(fs)
> if youngest >= last_youngest:
> for this_rev in range(last_youngest, youngest + 1):
> fix_up_rev(fs, this_rev)
> last_youngest = youngest + 1
> else:
> break

Yikes. Until you explained it to me on IRC, I had no clue what it's doing.
(It's attempting to ensure that we always catch every revision while the
script is running.)

However, the only real way to prevent this is to install the pre-commit hook
and then run the all-revs version of it. If you did the reverse, there's
always a race condition that you'd miss some revisions - in between the time
you ran all-revs and installed the pre-commit hook.

So, it should be something like:

elif all_revs:
  for this_rev in range(0, svn.fs.svn_fs_youngest_rev(fs) + 1):
    fix_up_rev(fs, this_rev)

It's also much shorter and easier to understand too. ;-) -- justin
Received on Fri Mar 3 22:08:12 2006

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

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