You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jack Farley <su...@theweldstudio.com> on 2007/07/27 01:29:54 UTC

Quick problem with svn

Hello,

I have just noticed a problem with svn. It may just be my set up... I have
the following type of structure with the folders with a * requiring
authentication
svn/
 |-gen/ *
 |-uni/
    |-current/ *
    |-archive/*

and the following config for apache

DAV svn
      SVNPath /var/svn
      AuthzSVNAccessFile /var/svn/conf/svnpolicy
      Satisfy Any
      Require valid-user
      AuthType Basic
      AuthName "Repository"
      AuthUserFile /var/svn/conf/svnusers

The problem is when I try and check out the top directory (svn) it only
checks out the uni directory (excluding current and archive) even if I use
the --username and --password in the command line. I know that this
behaviour is correct for the set up I have atm, but I was wondering if there
is anyway to  make it so when I do try and checkout the top directory while
giving the username and password for the folders requiring authentication
that it actually checks out these folders at the same time.

Cheers.

From,
Jack

Re: Multiple post-commit scripts for multiple projects

Posted by Karl Fogel <kf...@red-bean.com>.
Graham Anderson <gr...@gmail.com> writes:
> Is there a pre-existing template/example for something like this?  I
> am more than a bit new at writing post-commit scripts.
>
> I was successfully using this post-commit 'compiled' C example.
> Unfortunately, this will only work as one post-commit per repository
> :(
> #include <stddef.h>
> #include <stdlib.h>
> #include <unistd.h>
> int main(void)
> {
>   execl("/usr/local/bin/svn", "svn", "update", "/home/joe/
> public_html/",
>         (const char *) NULL);
>   return(EXIT_FAILURE);
> }

You probably should write your hook in a scripting language (like
Python), using existing post-commit scripts (found on the Internet and
in Subversions tools/ and contrib/ areas) as examples.

If there's someone in your organization, or a friend, with some
scripting experience, you should take advantage of that.  It'll save
you a *lot* of time.  (I think the kind of help you want may be beyond
the usual scope of this list, though anyone's certainly welcome to
volunteer to help of course).

Good luck,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Multiple post-commit scripts for multiple projects

Posted by Graham Anderson <gr...@gmail.com>.
Is there a pre-existing template/example for something like this?  I  
am more than a bit new at writing post-commit scripts.

I was successfully using this post-commit 'compiled' C example.  
Unfortunately, this will only work as one post-commit per repository :(
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
   execl("/usr/local/bin/svn", "svn", "update", "/home/joe/ 
public_html/",
         (const char *) NULL);
   return(EXIT_FAILURE);
}

many thanks in advance

G

On Aug 17, 2007, at 4:40 PM, Andy Levy wrote:

> On 8/17/07, Graham Anderson <gr...@gmail.com> wrote:
>> Hi
>>
>> Within the same repository, is it possible to execute a post-commit
>> depending on the  project/directory being updated?
>>
>> Essentially(in the same repository), project1 executes project1_post-
>> commit, project2 executes project2_post-commit
>> Is this possible, or should I have multiple repositories instead?
>
> Have you considered one script which checks the paths modified in the
> commit and then fires the appropriate sub-script (or just has
> subroutines for each project)?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Multiple post-commit scripts for multiple projects

Posted by Andy Levy <an...@gmail.com>.
On 8/17/07, Graham Anderson <gr...@gmail.com> wrote:
> Hi
>
> Within the same repository, is it possible to execute a post-commit
> depending on the  project/directory being updated?
>
> Essentially(in the same repository), project1 executes project1_post-
> commit, project2 executes project2_post-commit
> Is this possible, or should I have multiple repositories instead?

Have you considered one script which checks the paths modified in the
commit and then fires the appropriate sub-script (or just has
subroutines for each project)?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Multiple post-commit scripts for multiple projects

Posted by Graham Anderson <gr...@gmail.com>.
Thanks for the script :)

G


On Aug 18, 2007, at 4:31 AM, John Peacock wrote:

> Graham Anderson wrote:
>> Hi
>>
>> Within the same repository, is it possible to execute a post-commit
>> depending on the  project/directory being updated?
>
> Yes, see theze Perl modules (the first which I wrote and the second  
> which I am
> the current maintainer):
>
>      http://search.cpan.org/search?query=SVN-Notify-Mirror
> and  http://search.cpan.org/search?query=SVN-Notify-Config
>
> The former can be used to keep local, remote, or even rsync'd  
> working copies in
> sync with multiple paths in the repository.  The latter makes it  
> possible to do
> it without even a "script" per se.  For example, here is the entire  
> contents of
> a post-commit script:
>
> #!/usr/bin/perl -MSVN::Notify::Config=$0
> --- #YAML:1.0
> '':
>   PATH: "/usr/bin:/usr/local/bin"
> '/path':
>   handler: HTML::ColorDiff
>   to: project-admin@example.com
> '/path/snapshot':
>   fork: 1
>   handler: Snapshot
>   to: "/tmp/tarball-%{%Y%m%d}-${revision}.tar.gz"
> '/path/multitarget':
>   to:
>     - alice@localhost
>     - bob@localhost
>     - root@localhost
> '/path/tags':
>   handler: Mirror
>   to: '/path/to/another/dir'
>   tag-regex: "RELEASE_"
>
> That is the configuration data, in YAML format, but that is also  
> the script
> itself.  To annotate what that does:
>
> 1) Commits to '/path' generate a colorized diff e-mail to project- 
> admin@example.com.
>
> 2) Commits to '/path/snapshot' cause a tarball to be created.
>
> 3) Commits to '/path/multitarget' send a commit e-mail to three  
> addresses.
>
> 4) Commits to '/path/tags' cause the working copy in '/path/to/ 
> another/dir' to
> be switched to the new tag.
>
> HTH
>
> John
>
> -- 
> John Peacock
> Director of Information Research and Technology
> Rowman & Littlefield Publishing Group
> 4501 Forbes Blvd
> Suite H
> Lanham, MD 20706
> 301-459-3366 x.5010
> fax 301-429-5747

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Multiple post-commit scripts for multiple projects

Posted by John Peacock <jp...@rowman.com>.
Graham Anderson wrote:
> Hi
> 
> Within the same repository, is it possible to execute a post-commit 
> depending on the  project/directory being updated?

Yes, see theze Perl modules (the first which I wrote and the second which I am
the current maintainer):

     http://search.cpan.org/search?query=SVN-Notify-Mirror
and  http://search.cpan.org/search?query=SVN-Notify-Config

The former can be used to keep local, remote, or even rsync'd working copies in
sync with multiple paths in the repository.  The latter makes it possible to do
it without even a "script" per se.  For example, here is the entire contents of
a post-commit script:

#!/usr/bin/perl -MSVN::Notify::Config=$0
--- #YAML:1.0
'':
  PATH: "/usr/bin:/usr/local/bin"
'/path':
  handler: HTML::ColorDiff
  to: project-admin@example.com
'/path/snapshot':
  fork: 1
  handler: Snapshot
  to: "/tmp/tarball-%{%Y%m%d}-${revision}.tar.gz"
'/path/multitarget':
  to:
    - alice@localhost
    - bob@localhost
    - root@localhost
'/path/tags':
  handler: Mirror
  to: '/path/to/another/dir'
  tag-regex: "RELEASE_"

That is the configuration data, in YAML format, but that is also the script
itself.  To annotate what that does:

1) Commits to '/path' generate a colorized diff e-mail to project-admin@example.com.

2) Commits to '/path/snapshot' cause a tarball to be created.

3) Commits to '/path/multitarget' send a commit e-mail to three addresses.

4) Commits to '/path/tags' cause the working copy in '/path/to/another/dir' to
be switched to the new tag.

HTH

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Blvd
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Multiple post-commit scripts for multiple projects

Posted by Graham Anderson <gr...@gmail.com>.
Hi

Within the same repository, is it possible to execute a post-commit   
depending on the  project/directory being updated?

Essentially(in the same repository), project1 executes project1_post- 
commit, project2 executes project2_post-commit
Is this possible, or should I have multiple repositories instead?

many thanks
G

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org