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

[PATCH] Pass REPOS-PATH in local style to Hooks

From: Chris Foote <cafoote_at_yahoo.com>
Date: 2007-01-08 02:17:05 CET

This patch converts the SVNPath and SVNParentPath values to the internal
path
style in
the apache config and then converts the repos path to local style when it
is
passed to the
hooks.

On windows the REPOS-PATH parameter passed to the hooks use the same format
as in your Apache Config.
e.g. If you use '/' in your SVNPath then the path in passed to the hooks
also
uses a '/',
but if you use '\' then the hooks also uses a '\'.
The former causes a problem in some hook scripts/commands that don't accept
a
'/' in paths.

Chris

[[[
Ensure that the repos path is passed to the hook scripts in local style.

* subversion/mod_dav_svn/mod_dav_svn.c
  (dav_svn_path_cmd, dav_svn_parent_path_cmd): Convert the repos path to
    internal style.

* subversion/libsvn_repos/hooks.c
  (svn_repos__hooks_start_commit, svn_repos__hooks_pre_commit,
  svn_repos__hooks_post_commit, svn_repos__hooks_pre_revprop_change,
  svn_repos__hooks_post_revprop_change, svn_repos__hooks_pre_lock,
  svn_repos__hooks_post_lock, svn_repos__hooks_pre_unlock,
  svn_repos__hooks_post_unlock): Convert the repos path to local style.
]]]

Index: subversion/mod_dav_svn/mod_dav_svn.c
===================================================================
--- subversion/mod_dav_svn/mod_dav_svn.c (revision 22928)
+++ subversion/mod_dav_svn/mod_dav_svn.c (working copy)
@@ -253,7 +253,7 @@
     return "SVNPath cannot be defined at same time as SVNParentPath.";

   conf->fs_path
- = svn_path_canonicalize(apr_pstrdup(cmd->pool, arg1), cmd->pool);
+ = svn_path_internal_style(apr_pstrdup(cmd->pool, arg1), cmd->pool);

   return NULL;
 }
@@ -268,7 +268,7 @@
     return "SVNParentPath cannot be defined at same time as SVNPath.";

   conf->fs_parent_path
- = svn_path_canonicalize(apr_pstrdup(cmd->pool, arg1), cmd->pool);
+ = svn_path_internal_style(apr_pstrdup(cmd->pool, arg1), cmd->pool);

   return NULL;
 }
Index: subversion/libsvn_repos/hooks.c
===================================================================
--- subversion/libsvn_repos/hooks.c (revision 22928)
+++ subversion/libsvn_repos/hooks.c (working copy)
@@ -524,7 +524,7 @@
       const char *args[4];

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = user ? user : "";
       args[3] = NULL;

@@ -553,7 +553,7 @@
       const char *args[4];

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = txn_name;
       args[3] = NULL;

@@ -582,7 +582,7 @@
       const char *args[4];

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = apr_psprintf(pool, "%ld", rev);
       args[3] = NULL;

@@ -627,7 +627,7 @@
       action_string[1] = '\0';

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = apr_psprintf(pool, "%ld", rev);
       args[3] = author ? author : "";
       args[4] = name;
@@ -689,7 +689,7 @@
       action_string[1] = '\0';

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = apr_psprintf(pool, "%ld", rev);
       args[3] = author ? author : "";
       args[4] = name;
@@ -725,7 +725,7 @@
       const char *args[5];

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = path;
       args[3] = username;
       args[4] = NULL;
@@ -761,7 +761,7 @@
       SVN_ERR(create_temp_file(&stdin_handle, paths_str, pool));

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = username;
       args[3] = NULL;
       args[4] = NULL;
@@ -794,7 +794,7 @@
       const char *args[5];

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = path;
       args[3] = username ? username : "";
       args[4] = NULL;
@@ -831,7 +831,7 @@
       SVN_ERR(create_temp_file(&stdin_handle, paths_str, pool));

       args[0] = hook;
- args[1] = svn_repos_path(repos, pool);
+ args[1] = svn_path_local_style(svn_repos_path(repos, pool), pool);
       args[2] = username ? username : "";
       args[3] = NULL;
       args[4] = NULL;

Send instant messages to your online friends http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jan 8 02:17:13 2007

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.