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

RE: Svn:needs-lock no longer stops checkins on non locked files.

From: Thompson, Graeme (AELE) <Graeme.Thompson_at_smiths-aerospace.com>
Date: 2007-04-23 17:42:58 CEST


We did not have a hook script on that repository.

I have now modified the supplied ensure-needs-lock.py script to also
check that the file is locked before allowing checkin.

We want to work completely in the locking model of version control and
this is one of the few things that subversion does not support out of
the box.



P.s. Specifically I have added the following below the existing loop
checking the needs-lock property:

#Check that file is in fact locked.
my @files_changed;
foreach my $line (&read_from_process($svnlook, 'changed', $repos, '-t',
  # Add only files that were added to @files_changed
  if ($line =~ /^[^A]. (.*[^\/])$/)
    push(@files_changed, $1);

foreach my $path ( @files_changed )
  my $has_lock;

  # Parse the complete list of property values of the file $path to
  # the needs-lock property
  foreach my $prop (&read_from_process($svnlook, 'lock', $repos, $path))
    if ($prop =~ /^UUID Token: (\S+)/)
      $has_lock = $1;

  # Detect error conditions and add them to @errors
  if (not $has_lock)
    push @errors, "$path : File is not locked, please either lock the
file or remove the file from the list to be checked in.";

> -----Original Message-----
> From: Mark Phippard [mailto:markphip@gmail.com]
> Sent: 23 April 2007 12:54
> To: Thompson, Graeme (AELE)
> Cc: users@subversion.tigris.org
> Subject: Re: Svn:needs-lock no longer stops checkins on non
> locked files.
> On 4/23/07, Thompson, Graeme (AELE)
> <Graeme.Thompson@smiths-aerospace.com> wrote:
> >
> > Around a year ago using a version around 1.2.3 the commit
> would have
> > been rejected...
> >
> > Is there any way to get the desired behaviour of rejecting
> the commit
> > when it is not locked using 1.4.3?
> I do not believe it ever worked the way you say it did, are
> you sure you did not have a hook script in place? It was
> never the intention of the design to require a lock in order
> to commit. Locks are a communication mechanism only, and the
> svn:needs-lock property exists only as a hint to the user
> that they should obtain a lock before editing a certain file.

The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Apr 23 17:43:00 2007

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