You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sylvain Viart <sy...@easyrencontre.com> on 2007/09/17 07:51:11 UTC

properties or config file to setup special folder permission on deployment?

Hi,

I'm working on some script to encapsulate web trees deployment based on 
subversion. Unfortunately, svn doesn't handle unix folder permission 
very well and I also reset permission to ensure developer's lock during 
deployment.

So I'm trying to fix it by adding svn meta data based on properties.

http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html

Unfortunately svn doesn't seems to provide a fast way to lookup for 
properties from the WC.

So I'm thinking to incorporate a config file for deployment which 
purpose would be to handle folder permission.

Note that I'm not using svn for remote deployment on the final 
destination, I use rsync + some shell script.

If someone can give me some better svn-way approach?
Or may be the good question could be, how are we supposed to use 
properties efficiently?

svn proplist -v -R ., is pretty slow on my big multiproject WC.

Regards,
Sylvain.

-- 
Sylvain Viart | Responsable d'exploitation | EasyflirtPartners.biz
Direct:+33 1 77 35 34 20 | std:+33 1 77 35 34 17 | gsm:+33 6 62 79 85 53
2L Multimedia SAS, Park Nord, Les Pléiades #33, 74370 Metz-Tessy


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


Re: properties or config file to setup special folder permission on deployment? svn WC hacking API

Posted by Erik Huelsmann <eh...@gmail.com>.
On 9/21/07, Sylvain Viart <sy...@easyrencontre.com> wrote:
> Hi Erik.
>
> Erik Huelsmann a écrit :
> > http://svn.collab.net/repos/svn/trunk/subversion/include/svn_wc.h
> >
> >> I started but it's far to be obvious what to do with this API.
> >>
> >> I've found this link
> >> http://people.apache.org/~rooneg/talks/version-control/version-control.htm
> > I don't think hacking straight in the wc code will be faster than
> > using 'svn pg -R .', which gets (and prints) all properties on all
> > targets in the working copy. It's the C version of what you'll be
> > writing in perl..
> Hum
>
> in fact if I hack directly the wc, but with the API, I can skip files
> and treat only folder for example :
>
> trunc/sylvain$ find -type d | grep -v \.svn | wc -l
> 1106
>
> trunc/sylvain$ find ! -type d | grep -v \.svn | wc -l
> 8404
>
> I just need to find example of the code, actually I don't know if I need
> to create a pool an svn_client an svn_wc_entry, and adm_access
>
> or something... :-(

Have you read:
http://svnbook.red-bean.com/en/1.4/svn.developer.usingapi.html ?

Also, for reference works, you can use
http://svn.collab.net/svn-doxygen/
http://apr.apache.org/docs/apr/trunk/
and http://apr.apache.org/docs/apr-util/trunk/

You could try reading http://subversion.tigris.org/hacking.html too.

HTH,

Erik.

Re: properties or config file to setup special folder permission on deployment? svn WC hacking API

Posted by Sylvain Viart <sy...@easyrencontre.com>.
Hi Erik.

Erik Huelsmann a écrit :
> http://svn.collab.net/repos/svn/trunk/subversion/include/svn_wc.h
>   
>> I started but it's far to be obvious what to do with this API.
>>
>> I've found this link
>> http://people.apache.org/~rooneg/talks/version-control/version-control.htm
> I don't think hacking straight in the wc code will be faster than
> using 'svn pg -R .', which gets (and prints) all properties on all
> targets in the working copy. It's the C version of what you'll be
> writing in perl..
Hum

in fact if I hack directly the wc, but with the API, I can skip files 
and treat only folder for example :

trunc/sylvain$ find -type d | grep -v \.svn | wc -l
1106

trunc/sylvain$ find ! -type d | grep -v \.svn | wc -l
8404

I just need to find example of the code, actually I don't know if I need 
to create a pool an svn_client an svn_wc_entry, and adm_access

or something... :-(

regards,
Sylvain.

-- 
Sylvain Viart | Responsable d'exploitation | EasyflirtPartners.biz
Direct:+33 1 77 35 34 20 | std:+33 1 77 35 34 17 | gsm:+33 6 62 79 85 53
2L Multimedia SAS, Park Nord, Les Pléiades #33, 74370 Metz-Tessy


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


Re: properties or config file to setup special folder permission on deployment?

Posted by Erik Huelsmann <eh...@gmail.com>.
On 9/18/07, Sylvain Viart <sy...@easyrencontre.com> wrote:
> Hi Erik,
>
> Erik Huelsmann a écrit :
> Can I program it my self for now, using svn API?

> Sure, but at home (I'm at work atm), I have a python script which
parses the
> output from 'svn pl -R .', which I'll be updating to use
the --xml option as
> soon as it comes available. I can send you the
script, if you want.

> I'm not using svnclient 1.5 so it won't be useful I think.
> I will by more interested by hacking directly inside the wc structure.
>
>
> Where should I start for example using svn API for exploring wc?

> You can start by reading the header file describing the C interface.
The
> perl bindings are a near 1-to-1 mapping of those interfaces.
> See:
http://svn.collab.net/repos/svn/trunk/subversion/include/svn_wc.h
> I started but it's far to be obvious what to do with this API.
>
> I've found this link
> http://people.apache.org/~rooneg/talks/version-control/version-control.html
>
> Which describe some basic concept about SVN API.
>
> here is a peace of C code from the link above illustrating the wc
> manipulation :
>
> svn_error_t *print_info(const char *path, apr_pool_t *pool) {
> svn_wc_adm_access_t *adm_access;
 svn_wc_entry_t *entry;

> SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, path, FALSE, 0,
> NULL,
 NULL, pool));

 SVN_ERR(svn_wc_entry(&entry, path, adm_access, TRUE,
> pool));

 printf("name: %s\n", entry->name);
 printf("revision: %ld\n",
> entry->revision);
 printf("url: %s\n", entry->url);
 printf("author: %s\n",
> entry->cmt_author);
 printf("commit date: %s\n", entry->cmt_date);
> printf("last changed rev: %ld\n", entry->cmt_rev);

 return SVN_NO_ERROR;
}
>
> I'm still looking to some perl example to translate this code. Now I've got
> some SVN vocabulary : baton, pool, etc.

I don't think hacking straight in the wc code will be faster than
using 'svn pg -R .', which gets (and prints) all properties on all
targets in the working copy. It's the C version of what you'll be
writing in perl...

Then, you can catch that output in perl and act on it as required (for
example by changing the file permissions...)

bye,

Erik.

Re: properties or config file to setup special folder permission on deployment?

Posted by Sylvain Viart <sy...@easyrencontre.com>.
Hi Erik,

Erik Huelsmann a écrit :
>> Can I program it my self for now, using svn API?
>>     
>
> Sure, but at home (I'm at work atm), I have a python script which
> parses the output from 'svn pl -R .', which I'll be updating to use
> the --xml option as soon as it comes available. I can send you the
> script, if you want.
>   
I'm not using svnclient 1.5 so it won't be useful I think.
I will by more interested by hacking directly inside the wc structure.

>> Where should I start for example using svn API for exploring wc?
>>     
>
> You can start by reading the header file describing the C interface.
> The perl bindings are a near 1-to-1 mapping of those interfaces. See:
> http://svn.collab.net/repos/svn/trunk/subversion/include/svn_wc.h
>   
I started but it's far to be obvious what to do with this API.

I've found this link
http://people.apache.org/~rooneg/talks/version-control/version-control.html

Which describe some basic concept about SVN API.

here is a peace of C code from the link above illustrating the wc 
manipulation :

svn_error_t *print_info(const char *path, apr_pool_t *pool) {
  svn_wc_adm_access_t *adm_access;
  svn_wc_entry_t *entry;

  SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, path, FALSE, 0, NULL,
                           NULL, pool));

  SVN_ERR(svn_wc_entry(&entry, path, adm_access, TRUE, pool));

  printf("name: %s\n", entry->name);
  printf("revision: %ld\n", entry->revision);
  printf("url: %s\n", entry->url);
  printf("author: %s\n", entry->cmt_author);
  printf("commit date: %s\n", entry->cmt_date);
  printf("last changed rev: %ld\n", entry->cmt_rev);

  return SVN_NO_ERROR;
}


I'm still looking to some perl example to translate this code. Now I've 
got some SVN vocabulary : baton, pool, etc.

> PS: Please keep conversation on the list.
>   
Wrong post, should have been to the list. :-\

Regards,
Sylvain.

Re: properties or config file to setup special folder permission on deployment?

Posted by Erik Huelsmann <eh...@gmail.com>.
On 9/18/07, Sylvain Viart <sy...@easyrencontre.com> wrote:
> Erik Huelsmann a écrit :
> On 9/18/07, Sylvain Viart <sy...@easyrencontre.com>
> wrote:

> Seems all my initial post?

May be something about the svn API using the
> wc?
I've not found yet good example using perl bindings.

> Yes, sorry about that. There are some performance issues with large
working
> copies, especially with respect to properties. These are
expected to be
> addressed though in one of the next major version
updates (hopefully 1.6).

> Ok, but it doesn't help me right now. I'm using svn client version 1.4.2
> (r22196).
>
> In 1.5, there will be xml output for 'svn pl -R .' (ie 'svn pl -R
--xml .'
> will be supported) which should make it easy to read all
properties on all
> paths at once.

> Can I program it my self for now, using svn API?

Sure, but at home (I'm at work atm), I have a python script which
parses the output from 'svn pl -R .', which I'll be updating to use
the --xml option as soon as it comes available. I can send you the
script, if you want.

> Where should I start for example using svn API for exploring wc?

You can start by reading the header file describing the C interface.
The perl bindings are a near 1-to-1 mapping of those interfaces. See:
http://svn.collab.net/repos/svn/trunk/subversion/include/svn_wc.h

HTH,

Erik.
PS: Please keep conversation on the list.

Re: properties or config file to setup special folder permission on deployment?

Posted by Erik Huelsmann <eh...@gmail.com>.
On 9/18/07, Sylvain Viart <sy...@easyrencontre.com> wrote:
> Hi,
>
> Seems all my initial post?
>
> May be something about the svn API using the wc?
> I've not found yet good example using perl bindings.

Yes, sorry about that. There are some performance issues with large
working copies, especially with respect to properties. These are
expected to be addressed though in one of the next major version
updates (hopefully 1.6).

In 1.5, there will be xml output for 'svn pl -R .' (ie 'svn pl -R
--xml .' will be supported) which should make it easy to read all
properties on all paths at once.

bye,

Erik.

> Regards,
> Sylvain.
>
> Erik Huelsmann a écrit :
> > On 9/17/07, Sylvain Viart <sy...@easyrencontre.com> wrote:
> >
> >> Hi,
> >>
> >> I'm working on some script to encapsulate web trees deployment based on
> >> subversion. Unfortunately, svn doesn't handle unix folder permission
> >> very well and I also reset permission to ensure developer's lock during
> >> deployment.
> [...]
> >> Or may be the good question could be, how are we supposed to use
> >> properties efficiently?
> >>
> >> svn proplist -v -R ., is pretty slow on my big multiproject WC.
> >>
>
>
> --
> Sylvain Viart | Responsable d'exploitation | EasyflirtPartners.biz
> Direct:+33 1 77 35 34 20 | std:+33 1 77 35 34 17 | gsm:+33 6 62 79 85 53
> 2L Multimedia SAS, Park Nord, Les Pléiades #33, 74370 Metz-Tessy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

Re: properties or config file to setup special folder permission on deployment?

Posted by Sylvain Viart <sy...@easyrencontre.com>.
Hi,

Seems all my initial post?

May be something about the svn API using the wc?
I've not found yet good example using perl bindings.

Regards,
Sylvain.

Erik Huelsmann a écrit :
> On 9/17/07, Sylvain Viart <sy...@easyrencontre.com> wrote:
>   
>> Hi,
>>
>> I'm working on some script to encapsulate web trees deployment based on
>> subversion. Unfortunately, svn doesn't handle unix folder permission
>> very well and I also reset permission to ensure developer's lock during
>> deployment.
[...]
>> Or may be the good question could be, how are we supposed to use
>> properties efficiently?
>>
>> svn proplist -v -R ., is pretty slow on my big multiproject WC.
>>     


-- 
Sylvain Viart | Responsable d'exploitation | EasyflirtPartners.biz
Direct:+33 1 77 35 34 20 | std:+33 1 77 35 34 17 | gsm:+33 6 62 79 85 53
2L Multimedia SAS, Park Nord, Les Pléiades #33, 74370 Metz-Tessy


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


Re: properties or config file to setup special folder permission on deployment?

Posted by Erik Huelsmann <eh...@gmail.com>.
On 9/17/07, Sylvain Viart <sy...@easyrencontre.com> wrote:
> Hi,
>
> I'm working on some script to encapsulate web trees deployment based on
> subversion. Unfortunately, svn doesn't handle unix folder permission
> very well and I also reset permission to ensure developer's lock during
> deployment.
>
> So I'm trying to fix it by adding svn meta data based on properties.
>
> http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html
>
> Unfortunately svn doesn't seems to provide a fast way to lookup for
> properties from the WC.
>
> So I'm thinking to incorporate a config file for deployment which
> purpose would be to handle folder permission.
>
> Note that I'm not using svn for remote deployment on the final
> destination, I use rsync + some shell script.
>
> If someone can give me some better svn-way approach?
> Or may be the good question could be, how are we supposed to use
> properties efficiently?
>
> svn proplist -v -R ., is pretty slow on my big multiproject WC.

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