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

[PATCH] allow pre-lock hook to specify token for locking

From: Chia-liang Kao <clkao_at_clkao.org>
Date: Wed, 16 Jul 2008 17:41:02 -0700

(This is only a preliminary patch)

The patch enabling the pre-lock hook to decide the lock_token to be
used in the lock operation, which is usually autogenerated. The
changes are mostly in run_hook_cmd, making it to optionally take
stdout and return it as a string.
The function is basically reimplemented for AS400 though, so I'd
appreciate helps for making the relevant code changes in the other
part of the #ifdef... (I was also wondering why such abstraction
didn't happen in svn_io_start_cmd level though)

IMHO if the hook script decides to use such feature, it should
guarantee the uniqueness of the tokens. But kfogel mentioned on irc
we should do some guarding about it. I haven't checked if the fs
level does any guarding already, and it appears that no one is
actually using the svn_repos_fs_lock's token argument in the code
base, so there's some room for exploration.

the patch also includes my pre-{,un}lock changes, which should
probably be committed separately and i will update this patch

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_lock): allow returned new_token from pre-lock hook.

* subversion/libsvn_repos/repos.h
  (svn_repos__hooks_pre_lock): now has additional returned value for token.

* subversion/libsvn_repos/hooks.c
  (run_hook_cmd2): renamed from run_hook_cmd, allow stdout of hook to be
    captured and returned.
  (run_hook_cmd): wrapper for run_hook_cmd2 to provide compatibility.
  (svn_repos__hooks_pre_lock): call run_hook_cmd2 and return the token.

* subversion/libsvn_repos/repos.c: Document the pre-lock feature for
token from stdout.


To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-07-17 02:41:32 CEST

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.