CollabNet
Submerged - CollabNet's Subversion Blog
CollabNet Community

Categories

  • Administration (7)
  • Client Tools (13)
  • downloads (2)
  • General (36)
  • Non-Developers (2)
  • Subversion Client (34)
  • Subversion Events (5)
  • Subversion in the Enterprise (25)
  • Subversion Server (21)
  • Web/Tech (1)

Past 6 Months

  • January 2010 (1)
  • December 2009 (1)
  • November 2009 (3)
  • September 2009 (1)
  • August 2009 (1)
  • July 2009 (2)

Archives

All Archives...
RSS Syndicate this blog

Changed handling of output of pre-lock hook in SVN 1.6

One of our customers reported a funny issue with the pre-lock.bat hook script. Yes, when he used Subversion Server on Windows system. The customer is using a custom pre-lock.bat script to explicitly lock the file before every commit.

Why does he explicitly lock the file while svn commit itself locks the file implicitly? He has a valid reason to do so.

In earlier releases (v1.6), Subversion discarded the stdout messages printed in hook scripts. It is applicable for all hook scripts including pre-lock.bat script. Starting with v1.6, it behaves the same with all hook scripts, except the pre-lock.bat script. The message printed in this hook script is used as a UID for the lock. It should be unique across the repository. The best part about Subversion is that it is clearly documented in the Subversion 1.6 Release Notes.

Guess what? The customer complained that the custom pre-lock.bat script worked very well in prior releases, but it do not work with Subversion 1.6. When he performed a file commit, he faced a 423 Locked Error error. We attempted to release the lock obtained by a different user, if any, using svnadmin rmlocks and svn unlock --force commands, but they did not help. When we investigated if it has to do with any stdout messages, we discovered that NO it didn't. The hook script does not print any message to stdout.

WHERE THE PROBLEM EXISTS?

The issue is that the customer has set echo on globally in his Windows system. It prints all the commands we execute in the hook script to stdout, including the comments as in rem command.

The solution is to set echo off in his system, and he no longer faces the problem!

ShareThis
Bhuvaneswaran A

About the Author

Bhuvaneswaran Arumugam is part of an Engineering Team, customizing the flagship product CollabNet TeamForge as per the client requirements. He spends some time contributing to the Open source projects Subversion and Ubuntu. In recent times, he worked on adding new sections in the Ubuntu Server Guide for the next release, Karmic. You can follow Bhuvaneswaran on Twitter: http://twitter.com/livecipher
Permalink
Categories: Subversion Events

TrackBack

TrackBack URL for this post: http://www.typepad.com/services/trackback/6a00d834515ac169e2011571dc0cc5970b

Comments

Given that every Windows system has 'echo on' by default wouldn't it be simpler just to change the pre-lock script to turn echo off for that script alone?

It is conventional in batch scripts to include the line '@echo off' near the beginning: the leading '@' character suppresses echo for that line and the command then turns echo off for the duration of the script (Windows will then restore the default setting when the script exits).

Duncan Booth | July 09, 2009 at 01:13 AM

Duncan Booth, yes, adding the line "@echo off" in the beginning of the pre-lock.bat script is simpler.

Bhuvaneswaran A | July 09, 2009 at 01:20 AM

Post a comment

If you have a TypeKey or TypePad account, please Sign In

You are currently signed in as (nobody). Sign Out

  • ©2010 CollabNet Corporation
    • Site Feedback
    • Terms of Use
    • Privacy Policy
    • Copyright & Trademark